[CI][Bugfix] Ignore AMD CI webhook no-op builds in /amd-ci run and retry (#62087)
Co-authored-by: Andreas Karatzas <akaratza@amd.com>
This commit is contained in:
co-authored by
Andreas Karatzas
parent
e56b1603af
commit
3bf25c5097
@@ -621,6 +621,16 @@ def blocks_new_run(command: str, build: Mapping[str, Any]) -> bool:
|
||||
return is_active_build(build)
|
||||
|
||||
|
||||
def list_commit_builds(
|
||||
buildkite: BuildkiteClient, command: str, commit: str
|
||||
) -> list[dict[str, Any]]:
|
||||
builds = buildkite.list_builds(commit)
|
||||
if command not in AMD_CI_COMMANDS:
|
||||
return builds
|
||||
# bootstrap-amd.sh exits before uploading any test steps for PR webhook builds.
|
||||
return [build for build in builds if build.get("source") != "webhook"]
|
||||
|
||||
|
||||
def select_latest_build(
|
||||
builds: Sequence[dict[str, Any]],
|
||||
pr_number: int,
|
||||
@@ -968,7 +978,7 @@ def handle_run_ci(
|
||||
f"{ci_name} was already requested by this comment: {duplicate['web_url']}"
|
||||
)
|
||||
|
||||
current_builds = buildkite.list_builds(pr["head"]["sha"])
|
||||
current_builds = list_commit_builds(buildkite, command, pr["head"]["sha"])
|
||||
active_build = next(
|
||||
(
|
||||
build
|
||||
@@ -1023,7 +1033,7 @@ def handle_retry_failed(
|
||||
ci_name = ci_name_for_command(command)
|
||||
run_command = run_command_for_command(command)
|
||||
retry_command = retry_command_for_command(command)
|
||||
builds = buildkite.list_builds(pr["head"]["sha"])
|
||||
builds = list_commit_builds(buildkite, command, pr["head"]["sha"])
|
||||
build = select_latest_build(builds, pr["number"])
|
||||
if build:
|
||||
metadata = build.get("meta_data") or {}
|
||||
|
||||
Reference in New Issue
Block a user