Skip to content

Instantly share code, notes, and snippets.

View AjayJagan's full-sized avatar
🎯
Focusing

Ajay Jaganathan AjayJagan

🎯
Focusing
  • Red Hat
  • Bengaluru
  • 22:23 (UTC +05:30)
View GitHub Profile
@AjayJagan
AjayJagan / explanation.md
Created August 19, 2025 08:22
test prompt

I am planning to build a tool, which can analyse all the github repositories in an organization, create a dashboard out of it.

Tools Capabilities

  • We can use python to analyse the repositories.
  • The tool should go through all the repositories inside https://github.com/opendatahub-io. We can make this value parametrized.
  • For each repository, the tool should get the data about the github workflows, ingore the disabled workflows, and list out the workflows that took a lot of time to run(greater than 5 minutes) and the workfows which run very frequently(the filter is lot of time to run + more frequency). For frequency we can target the workflows which run for each pr or each pr merge etc. Please get the latest, successfull runs so that the data is accurate.
  • We need to create a dashboard, which helps the users to understand which workflows take a lot of time to run. Get creative here(Add some charts, some ways to filter workflows based on the repo etc). I will leave this creative part to you.
  • The
# Build the manager binary
ARG GOLANG_VERSION=1.23
ARG BUILDPLATFORM TARGETPLATFORM
# These built-in args are defined in the global scope, and are not automatically accessible within build stages or RUN commands.Add commentMore actions
# To expose these arguments inside the build stage, we need to redefine it without a value.
ARG TARGETOS TARGETARCH
################################################################################
@AjayJagan
AjayJagan / odh-operator-push.yaml
Last active June 19, 2025 12:34
multi arch build of odh
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
annotations:
build.appstudio.openshift.io/repo: https://github.com/AjayJagan/opendatahub-operator?rev={{revision}}
build.appstudio.redhat.com/commit_sha: '{{revision}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/cancel-in-progress: "false"
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
@AjayJagan
AjayJagan / roles.yaml
Last active December 19, 2024 17:28
Role and cluster role for admin
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: admingroup-role
namespace: {{.DSCI.Spec.ApplicationsNamespace}}
rules:
- apiGroups:
- dashboard.opendatahub.io
@AjayJagan
AjayJagan / code-analysis-data.json
Created October 11, 2024 06:01
code analysis result
"data": [
{
"id": "332b6e96-1d2e-4886-9d97-aa89e5f3f160",
"type": "issue",
"attributes": {
"classes": [
{
"id": "CWE-295",
"source": "CWE",
"type": "weakness"
@AjayJagan
AjayJagan / create-vuln-sheets.py
Created September 2, 2024 07:17
Create vulnerabilities report from quay
import requests
import json
import pandas as pd
import io
def get_vulnerabilities(auth_token: str, repo_details: []):
auth_headers = {"Authorization": f"Bearer {auth_token}"}
result = []
for repo_detail in repo_details:
@AjayJagan
AjayJagan / manifest.json
Created August 29, 2024 13:34
image manifest details
{
"digest": "sha256:35b9d2c1002201723b7f7a9f54e9406b2ec4b5b0f73d114f47c70e15956103b5",
"is_manifest_list": false,
"manifest_data": "{\"schemaVersion\":2,\"mediaType\":\"application/vnd.docker.distribution.manifest.v2+json\",\"config\":{\"mediaType\":\"application/vnd.docker.container.image.v1+json\",\"size\":3497,\"digest\":\"sha256:f59cbb5224b920a0749513965c973092b8863b2bae808590b1165df7fee66238\"},\"layers\":[{\"mediaType\":\"application/vnd.docker.image.rootfs.diff.tar.gzip\",\"size\":784760,\"digest\":\"sha256:89dd9175a24b0e74e29fc0a4ccd876178411dfe877840e69f6c13bc002da68c9\"},{\"mediaType\":\"application/vnd.docker.image.rootfs.diff.tar.gzip\",\"size\":518964,\"digest\":\"sha256:eb2fb3180c3bcd9d69a617b3c45234733f80df3149bc95cac2c4c61f6f5a4190\"},{\"mediaType\":\"application/vnd.docker.image.rootfs.diff.tar.gzip\",\"size\":9172417,\"digest\":\"sha256:97a28fc7f395efe7d2797ea89b623c18b06df10d17143e380750cd5d4b2a674f\"},{\"mediaType\":\"application/vnd.docker.image.rootfs.diff.tar.gzip\",\"size\"
@AjayJagan
AjayJagan / vulnerabilities-all.json
Created August 28, 2024 18:09
Vulnerabilities for release
This file has been truncated, but you can view the full file.
[
{
"repository": "integreatly/prometheus-blackbox-exporter",
"digests": [
{
"digest": "sha256:35b9d2c1002201723b7f7a9f54e9406b2ec4b5b0f73d114f47c70e15956103b5",
"packageVulnerabilities": []
}
]
},
@AjayJagan
AjayJagan / all_vuln_list_for_tags_images.py
Created August 28, 2024 08:26
get vulnerabilities for all tags for all images
import requests
import json
def get_vulnerabilities(auth_token: str, repo_details: []):
auth_headers = {"Authorization": f"Bearer {auth_token}"}
for repo_detail in repo_details:
print(f"Processing repo => {repo_detail.get('repository')}")
for tag in repo_detail["tag_digest_map"]:
for k, v in tag.items():
@AjayJagan
AjayJagan / read_vulns_quay.py
Last active July 15, 2024 11:20
get all vulns in quay
import requests
def get_vulnerabilities(auth_token: str, repo_details: []):
auth_headers = {"Authorization": f"Bearer {auth_token}"}
for repo_detail in repo_details:
for tag in repo_detail["tag_digest_map"]:
for k, v in tag.items():
get_vuln_url = f"https://quay.io/api/v1/repository/{repo_detail['repository']}/manifest/{tag[k]}/security?vulnerabilities=true"
response = requests.get(get_vuln_url, headers=auth_headers)