feat(tests): update_fixtures.py: github run_id

[no changelog]
pull/3916/head
Martin Milata 3 weeks ago
parent 3760dd307c
commit 6ff7322408

@ -27,6 +27,7 @@ def get_branch_ui_fixtures_results(
branch_name: str,
only_jobs: Iterable[str] | None,
exclude_jobs: Iterable[str] | None,
run_id: int | None,
) -> dict[str, AnyDict]:
print(f"Checking branch {branch_name}")
@ -34,7 +35,7 @@ def get_branch_ui_fixtures_results(
LIST_RUNS_TEMPLATE.format(branch=branch_name, workflow="core.yml")
)
response.raise_for_status()
run_id = response.json()["workflow_runs"][0]["id"]
run_id = run_id or response.json()["workflow_runs"][0]["id"]
def yield_key_value() -> Iterator[tuple[str, AnyDict]]:
for model in MODELS:

@ -42,6 +42,7 @@ def _get_current_git_branch() -> str:
help="Fetch from GitHub Actions instead of GitLab CI",
)
@click.option("-b", "--branch", help="Branch name")
@click.option("-r", "--run-id", help="GitHub Actions run id", type=int)
@click.option(
"-o",
"--only-jobs",
@ -58,6 +59,7 @@ def _get_current_git_branch() -> str:
def ci(
github: bool,
branch: str | None,
run_id: int | None,
only_jobs: Iterable[str] | None,
exclude_jobs: Iterable[str] | None,
remove_missing: bool,
@ -80,7 +82,9 @@ def ci(
if github:
from github import get_branch_ui_fixtures_results
ui_results = get_branch_ui_fixtures_results(branch, only_jobs, exclude_jobs)
ui_results = get_branch_ui_fixtures_results(
branch, only_jobs, exclude_jobs, run_id
)
else:
from gitlab import get_branch_ui_fixtures_results, get_jobs_of_interest

Loading…
Cancel
Save