🌱 Add -f flag to curl command for fail-fast lint behavior#202
Conversation
The curl command should fail immediately on HTTP errors instead of piping error responses into bash. Adding the -f flag ensures curl returns a non-zero exit code on 4xx/5xx responses, preventing silent failures that could mask download issues. Signed-off-by: xuezhaojun <zxue@redhat.com>
|
/assign @zhujian7 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughUpdated a curl invocation in a CI lint README: the flag set changed from Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ci/lint/README-golangci-lint.md`:
- Line 12: Update the README snippet that currently shows the pipeline "@curl
-fsSL https://raw.githubusercontent.com/.../run-lint.sh | bash" to a safer
pattern so HTTP errors from curl can't be masked; either (A) run bash with the
downloaded script via command substitution (invoke bash -c with the curl output)
so curl's exit is checked before executing, or (B) ensure the shell runs with
pipefail (e.g., set -o pipefail) before the pipeline so a failing curl returns a
non-zero status; change the example accordingly wherever the "@curl -fsSL ... |
bash" line appears.
Without pipefail, even with curl -f, the pipeline exit code comes from the last command (bash). If curl fails with no output, bash receives empty stdin and exits 0, silently masking the error. Wrapping with bash -o pipefail ensures curl failures propagate correctly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: xuezhaojun <zxue@redhat.com>
|
/assign @qiujian16 |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qiujian16, xuezhaojun The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
632c728
into
open-cluster-management-io:main
Summary
-sSLto-fsSLto fail on HTTP 4xx/5xx errorsbash -o pipefailto ensure curl failures propagate correctly through the pipeWithout
-f, curl silently pipes error HTML into bash on HTTP errors. Even with-f, withoutpipefail, the pipeline exit code comes from the last command (bash), which exits 0 on empty stdin — silently masking the curl failure. Both fixes together ensure fail-fast behavior.Related issue(s)
Fixes #
Summary by CodeRabbit