-
Notifications
You must be signed in to change notification settings - Fork 15.5k
[CI] Use the exit code from the premerge advisor #172393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -158,3 +158,5 @@ def main( | |
| args.pr_number, | ||
| args.return_code, | ||
| ) | ||
|
|
||
| sys.exit(args.return_code) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,10 +37,11 @@ function at-exit { | |
| python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py \ | ||
| $retcode "${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log \ | ||
| >> $GITHUB_STEP_SUMMARY | ||
| python "${MONOREPO_ROOT}"/.ci/premerge_advisor_explain.py \ | ||
| (python "${MONOREPO_ROOT}"/.ci/premerge_advisor_explain.py \ | ||
| $(git rev-parse HEAD~1) $retcode "${GITHUB_TOKEN}" \ | ||
| $GITHUB_PR_NUMBER "${BUILD_DIR}"/test-results.*.xml \ | ||
| "${MONOREPO_ROOT}"/ninja*.log | ||
| "${MONOREPO_ROOT}"/ninja*.log) | ||
| advisor_retcode=$? | ||
| fi | ||
|
|
||
| if [[ "$retcode" != "0" ]]; then | ||
|
|
@@ -54,6 +55,10 @@ function at-exit { | |
| "${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log | ||
| fi | ||
| fi | ||
|
|
||
| if [[ -n "$GITHUB_ACTIONS" ]]; then | ||
| exit $advisor_retcode | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see where this comes from. I expect it is in one of the stacked PRs though, I just can't find which one.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was supposed to be in this one. I meant to save it in the subshell above, but apparently forgot to add it in and the premerge testing passed as expected... |
||
| fi | ||
| } | ||
| trap at-exit EXIT | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this in a subshell now?
I thought maybe it was something to do with not setting the return code but afaict, the return code is propogated from the subshell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to save the return code without having the script fully exit if we return a non-zero code.