-
Notifications
You must be signed in to change notification settings - Fork 9
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
ci: capture script failures properly #156
ci: capture script failures properly #156
Conversation
Caution Review failedThe pull request is closed. WalkthroughThe pull request introduces consistent error handling across several shell scripts in the development helpers directory. The changes focus on adding Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (7)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 3
🧹 Nitpick comments (5)
tools/development/helpers/format-python.sh (1)
12-12
: Handle potential popd failuresAdd error handling to
popd
to prevent silent failures if the directory stack becomes corrupted.-popd > /dev/null +popd > /dev/null || exit 1🧰 Tools
🪛 Shellcheck (0.10.0)
[warning] 12-12: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
(SC2164)
tools/development/helpers/check-format-python.sh (1)
12-12
: Handle potential popd failuresAdd error handling to
popd
to prevent silent failures if the directory stack becomes corrupted.-popd > /dev/null +popd > /dev/null || exit 1🧰 Tools
🪛 Shellcheck (0.10.0)
[warning] 12-12: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
(SC2164)
tools/development/helpers/test-python.sh (1)
13-13
: Handle potential popd failuresAdd error handling to
popd
to prevent silent failures if the directory stack becomes corrupted.-popd > /dev/null +popd > /dev/null || exit 1🧰 Tools
🪛 Shellcheck (0.10.0)
[warning] 13-13: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
(SC2164)
tools/development/helpers/format-cpp.sh (1)
12-12
: Handle potential popd failuresAdd error handling to
popd
to prevent silent failures if the directory stack becomes corrupted.-popd > /dev/null +popd > /dev/null || exit 1🧰 Tools
🪛 Shellcheck (0.10.0)
[warning] 12-12: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
(SC2164)
tools/development/helpers/check-format-cpp.sh (1)
12-12
: Handle potential popd failuresAdd error handling to
popd
to prevent silent failures if the directory stack becomes corrupted.-popd > /dev/null +popd > /dev/null || exit 1🧰 Tools
🪛 Shellcheck (0.10.0)
[warning] 12-12: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
(SC2164)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
tools/development/helpers/check-format-cpp.sh
(1 hunks)tools/development/helpers/check-format-python.sh
(1 hunks)tools/development/helpers/format-cpp.sh
(1 hunks)tools/development/helpers/format-python.sh
(1 hunks)tools/development/helpers/test-python.sh
(1 hunks)
🧰 Additional context used
🪛 Shellcheck (0.10.0)
tools/development/helpers/format-python.sh
[warning] 12-12: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
(SC2164)
tools/development/helpers/check-format-python.sh
[warning] 12-12: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
(SC2164)
tools/development/helpers/test-python.sh
[error] 10-10: Double quote array expansions to avoid re-splitting elements.
(SC2068)
[warning] 13-13: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
(SC2164)
tools/development/helpers/check-format-cpp.sh
[warning] 9-9: Quote this to prevent word splitting.
(SC2046)
[warning] 12-12: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
(SC2164)
tools/development/helpers/format-cpp.sh
[warning] 9-9: Quote this to prevent word splitting.
(SC2046)
[warning] 12-12: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
(SC2164)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Build and Push and Tag Base Image with Version / Build Development Image
🔇 Additional comments (2)
tools/development/helpers/format-python.sh (1)
9-10
: LGTM: Error handling added for black commandThe addition of
|| exit 1
ensures formatting failures are properly captured and reported.tools/development/helpers/check-format-python.sh (1)
9-10
: LGTM: Error handling added for black check commandThe addition of
|| exit 1
ensures formatting check failures are properly captured and reported.
b73a22a
to
ade9a41
Compare
4cdb71f
into
ci/fix-intermittent-qemu-issues
This reverts commit 4cdb71f.
This reverts commit 4cdb71f.
* ci: capture exit code properly * chore: simplify exit * style: fix whitespace
This reverts commit 4cdb71f.
Jobs in downstream repos which used the
ostk-*
helper scripts (like Check C++ Format) were not correctly raising their error codes. This is because the .sh scripts would return the exit code of the final command (popd
), regardless of what commands failed earlier in the script.We can check the exit code of the commands we're interested in, and append an
|| exit 1
to cause the script to return an error if the command itself failed.For example, this job passed even though
clang-format
itself failed. This PR and its failing job demonstrates the effect of this change.Summary by CodeRabbit
Summary by CodeRabbit