ci(feat): refactor error handling#25610
Conversation
Signed-off-by: Josh Marinacci <joshua@marinacci.org>
Signed-off-by: Josh Marinacci <joshua@marinacci.org>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Signed-off-by: Josh Marinacci <joshua@marinacci.org>
Signed-off-by: Josh Marinacci <joshua@marinacci.org>
71410a3 to
069cda4
Compare
Signed-off-by: Josh Marinacci <joshua@marinacci.org>
Signed-off-by: Josh Marinacci <joshua@marinacci.org>
Signed-off-by: Josh Marinacci <joshua@marinacci.org>
Signed-off-by: Josh Marinacci <joshua@marinacci.org>
Signed-off-by: Josh Marinacci <joshua@marinacci.org>
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Josh Marinacci <joshua@marinacci.org>
There was a problem hiding this comment.
Pull request overview
This PR centralizes CI failure-mode calculation into a shared workflow support script and refactors several zxc-* workflows to use it, adding failed-tests aggregation where applicable.
Changes:
- Adds
.github/workflows/support/scripts/set-failure-mode.shfor step-outcome and job-aggregate failure classification. - Refactors multiple CI workflows to pass step/job status arrays into the shared script.
- Updates MATS downstream categorization to treat the new
cancelledfailure mode as environment-related.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/support/scripts/set-failure-mode.sh |
Adds shared failure-mode and failed-tests output logic. |
.github/workflows/zxc-compile-and-spotless-check.yaml |
Replaces inline failure-mode logic with script inputs. |
.github/workflows/zxc-dependency-module-check.yaml |
Replaces inline failure-mode logic with script inputs. |
.github/workflows/zxc-execute-unit-tests.yaml |
Refactors unit-test failure-mode output to use shared script. |
.github/workflows/zxc-execute-hapi-tests.yaml |
Refactors HAPI aggregate failure-mode logic and adds failed-tests job output. |
.github/workflows/zxc-execute-otter-tests.yaml |
Refactors Otter aggregate failure-mode logic and adds failed-tests job output. |
.github/workflows/zxc-mats-tests.yaml |
Refactors MATS aggregate failure-mode/failed-tests logic. |
.github/workflows/zxc-verify-gradle-build-determinism.yaml |
Refactors Gradle determinism aggregate failure-mode logic. |
.github/workflows/zxc-verify-docker-build-determinism.yaml |
Refactors Docker determinism aggregate failure-mode logic. |
.github/workflows/zxc-xts-tests.yaml |
Refactors XTS aggregate failure-mode/failed-tests logic, including panel jobs. |
.github/workflows/node-flow-build-application.yaml |
Maps MATS cancelled failure mode to environment category. |
Signed-off-by: Josh Marinacci <joshua@marinacci.org>
Signed-off-by: Josh Marinacci <joshua@marinacci.org>
Signed-off-by: Josh Marinacci <joshua@marinacci.org>
|
We are trying to provide a reason for why XTS workflows are cancelled to our Slack channels. I suggest we provide it as a separate variable, rather than trying to include it into the |
| if has_failure "${test_arr[@]}"; then | ||
| failure_mode="test" | ||
| fi | ||
| if has_failure "${workflow_arr[@]}"; then | ||
| failure_mode="workflow" | ||
| fi |
There was a problem hiding this comment.
If there is a test failure and a workflow failure, then the test failure is overwritten by the workflow failure. Suggest changing to this to elif so if we have a test failure we do not worry about the workflow failure(s).
| workflow) failure_mode="workflow" ;; | ||
| test) [[ "$failure_mode" != "workflow" ]] && failure_mode="test" ;; |
There was a problem hiding this comment.
This will overwrite the failure_mode to workflow and hide potential test failure types. We want to prioritize test failures over workflow failures.
| esac | ||
| failed_tests="${failed_tests:+${failed_tests}, }${name}" | ||
| elif [[ "$status" == "cancelled" ]]; then | ||
| [[ "$failure_mode" == "none" ]] && failure_mode="cancelled" |
There was a problem hiding this comment.
failure_mode can be workflow, test, or none. It should stay as none since there was not a failure, it was only a cancelled workflow.
| failed_tests="${failed_tests:+${failed_tests}, }${name}" | ||
| elif [[ "$status" == "cancelled" ]]; then | ||
| [[ "$failure_mode" == "none" ]] && failure_mode="cancelled" | ||
| failed_tests="${failed_tests:+${failed_tests}, }${name} (cancelled)" |
There was a problem hiding this comment.
We don't know if it was a failed test or not, so we should not add it to the failed_tests list.
Signed-off-by: Josh Marinacci <joshua@marinacci.org>
Signed-off-by: Josh Marinacci <joshua@marinacci.org>
Signed-off-by: Josh Marinacci <joshua@marinacci.org>
|
The remaining comments are regarding:
|
Description:
Create a common set-failure-mode workflow that can be used to set the failure mode variable of a single task, or aggregate a bunch of child tasks.
Related issue(s):
Partially addresses #25509 and #25513 and #25470
Notes for reviewer:
Checklist