Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/generate_required_checks.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment explaining what it's for?

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from pathlib import Path

from generate_workflows_lib import (
get_lint_job_datas,
get_misc_job_datas,
get_test_job_datas,
get_tox_envs,
)

tox_ini_path = Path(__file__).parent.parent.parent.joinpath("tox.ini")


def get_gh_contexts_from_jobs(job_datas):
def get_job_name(job):
if isinstance(job, str):
return job
return job["ui_name"]

return [
f""" {{ context = "{get_job_name(job)}" }},\n"""
for job in job_datas
]


jobs = sorted(
get_gh_contexts_from_jobs(get_lint_job_datas(get_tox_envs(tox_ini_path)))
+ get_gh_contexts_from_jobs(
get_test_job_datas(get_tox_envs(tox_ini_path), ["ubuntu-latest"])
)
+ get_gh_contexts_from_jobs(get_misc_job_datas(get_tox_envs(tox_ini_path)))
)
with open("opentelemetry-admin-jobs.txt", "w") as f:
for job in jobs:
f.write(job)
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ target

# Benchmark result files
*-benchmark.json

# opentelemetry-admin jobs
opentelemetry-admin-jobs.txt
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,7 @@ deps =

commands =
python {toxinidir}/.github/workflows/generate_workflows.py
python {toxinidir}/.github/workflows/generate_required_checks.py
Copy link
Member

@emdneto emdneto Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to run that here?
If I understood correctly, you want to generate the input to populate the Terraform code on the admin repo right? Maybe this fits better on scripts dir, not sure if it's necessary to run in every tox -e generate-workflows


[testenv:shellcheck]

Expand Down
Loading