From 051ebd7ed5fed6ea3453e28a4a3c162dc220cc3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bombo?= Date: Fri, 24 Jul 2026 15:34:18 -0500 Subject: [PATCH] ci.gatekeeper: Ignore overlapping regular runs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An automatically selected ci-devel run and regular CI can report the same required job names. The existing newest-run rule can therefore select regular results based only on run timing. Ignore regular CI and self-hosted runs replaced by the validated ci-devel run while retaining every non-overlapping required workflow. Generated-By: GitHub Copilot Signed-off-by: Aurélien Bombo --- tools/testing/gatekeeper/jobs.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/testing/gatekeeper/jobs.py b/tools/testing/gatekeeper/jobs.py index e7d4b2ce92..6c0e5db944 100644 --- a/tools/testing/gatekeeper/jobs.py +++ b/tools/testing/gatekeeper/jobs.py @@ -40,6 +40,10 @@ _GH_API_URL = f"https://api.github.com/repos/{os.environ['GITHUB_REPOSITORY']}" _GH_RUNS_URL = f"{_GH_API_URL}/actions/runs" _GH_WEB_URL = f"https://github.com/{os.environ['GITHUB_REPOSITORY']}" _CI_DEVEL_WORKFLOW_PATH = ".github/workflows/ci-devel.yaml" +_CI_DEVEL_OVERLAPPING_WORKFLOWS = { + ".github/workflows/ci-on-push.yaml", + ".github/workflows/static-checks-self-hosted.yaml", +} _GH_SUMMARY_URL = ( f"{os.environ.get('GITHUB_SERVER_URL')}/" f"{os.environ.get('GITHUB_REPOSITORY')}/actions/runs/" @@ -274,6 +278,11 @@ class Checker: f"check_workflow_runs_status_{attempt}", {"head_sha": self.latest_commit_sha}) + def should_ignore_workflow_run(self, run): + """Whether a regular run overlaps the selected ci-devel run""" + return (self.ci_devel_run is not None and + run.get("path") in _CI_DEVEL_OVERLAPPING_WORKFLOWS) + def check_workflow_runs_status(self, attempt, workflow_runs=None): """ Checks if all required jobs passed @@ -283,6 +292,10 @@ class Checker: if workflow_runs is None: workflow_runs = self.get_workflow_runs(attempt) for run in workflow_runs: + if self.should_ignore_workflow_run(run): + print(f"Ignoring overlapping workflow run {run['html_url']}", + file=sys.stderr) + continue jobs = self.get_jobs_for_workflow_run(run["id"]) for job in jobs: self.record(run["name"], job)