Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .ci/premerge_advisor_explain.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,5 @@ def main(
args.pr_number,
args.return_code,
)

sys.exit(args.return_code)
9 changes: 7 additions & 2 deletions .ci/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

advisor_retcode=$?
fi

if [[ "$retcode" != "0" ]]; then
Expand All @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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

Expand Down
Loading