mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-07-25 14:18:54 +00:00
ci.gatekeeper: Alias linked ci-devel results
Jobs in a manually triggered run inherit the ci-devel workflow name. They therefore cannot satisfy required names belonging to regular CI or self-hosted static checks. Match jobs from the validated run under those two workflow names and reuse the current required-job filtering and status handling. Generated-By: GitHub Copilot Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
This commit is contained in:
@@ -47,6 +47,10 @@ _CI_DEVEL_OVERLAPPING_WORKFLOWS = {
|
||||
".github/workflows/ci-on-push.yaml",
|
||||
".github/workflows/static-checks-self-hosted.yaml",
|
||||
}
|
||||
_CI_DEVEL_WORKFLOW_ALIASES = (
|
||||
"Kata Containers CI",
|
||||
"Static checks self-hosted",
|
||||
)
|
||||
_GH_SUMMARY_URL = (
|
||||
f"{os.environ.get('GITHUB_SERVER_URL')}/"
|
||||
f"{os.environ.get('GITHUB_REPOSITORY')}/actions/runs/"
|
||||
@@ -286,6 +290,13 @@ class Checker:
|
||||
return (self.ci_devel_run is not None and
|
||||
run.get("path") in _CI_DEVEL_OVERLAPPING_WORKFLOWS)
|
||||
|
||||
def workflow_names(self, run):
|
||||
"""Get workflow names used to match a run's jobs"""
|
||||
if (self.ci_devel_run is not None and
|
||||
run["id"] == self.ci_devel_run["id"]):
|
||||
return _CI_DEVEL_WORKFLOW_ALIASES
|
||||
return (run["name"],)
|
||||
|
||||
def check_workflow_runs_status(self, attempt, workflow_runs=None):
|
||||
"""
|
||||
Checks if all required jobs passed
|
||||
@@ -301,7 +312,8 @@ class Checker:
|
||||
continue
|
||||
jobs = self.get_jobs_for_workflow_run(run["id"])
|
||||
for job in jobs:
|
||||
self.record(run["name"], job)
|
||||
for workflow in self.workflow_names(run):
|
||||
self.record(workflow, job)
|
||||
print(self)
|
||||
self.write_step_summary()
|
||||
return self.status()
|
||||
|
||||
Reference in New Issue
Block a user