Skip to content

Commit

Permalink
Fix: On error continue processing workflows
Browse files Browse the repository at this point in the history
In the case where a workflow does not trigger for reason and throws an
exception, this stops processing of all other workflows that were
detected. This an cause problems as other workflows may pass. As there
is no easy way to bubble triggering issues to end users not having jobs
(that might pass) not trigger because of a failure of a different
workflow (that doesn't get reported) is a problem.

Issue: RELENG-5100
Change-Id: I0bd20efa6cc8077e7453d4523e40ee92052c825a
Signed-off-by: Andrew Grimberg <[email protected]>
  • Loading branch information
tykeal committed Feb 8, 2024
1 parent f39fa79 commit 68e8ac0
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions src/gerrit_to_platform/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,16 @@ def find_and_dispatch(project: str, workflow_filter: str, inputs: Dict[str, str]
+ f"{inputs['GERRIT_CHANGE_NUMBER']} patch "
+ inputs["GERRIT_PATCHSET_NUMBER"]
)
dispatcher(
owner,
repo,
workflow["id"],
f"refs/heads/{inputs['GERRIT_BRANCH']}",
inputs,
)
try:
dispatcher(
owner,
repo,
workflow["id"],
f"refs/heads/{inputs['GERRIT_BRANCH']}",
inputs,
)
except Exception as e:
print(f"Failed to dispatch workflow: {e}")

magic_repo = get_magic_repo(platform)
if magic_repo:
Expand All @@ -152,13 +155,16 @@ def find_and_dispatch(project: str, workflow_filter: str, inputs: Dict[str, str]
+ f"{inputs['GERRIT_PATCHSET_NUMBER']} against "
+ f"{platform.value}:{owner}/{repo}"
)
dispatcher(
owner,
magic_repo,
workflow["id"],
"refs/heads/main",
inputs,
)
try:
dispatcher(
owner,
magic_repo,
workflow["id"],
"refs/heads/main",
inputs,
)
except Exception as e:
print(f"Failed to dispatch workflow: {e}")


def get_change_id(change: str) -> str:
Expand Down

0 comments on commit 68e8ac0

Please sign in to comment.