Skip to content

🌱 Add -f flag to curl command for fail-fast lint behavior#202

Merged
openshift-merge-bot[bot] merged 2 commits intoopen-cluster-management-io:mainfrom
xuezhaojun:fix/curl-fail-flag
Feb 26, 2026
Merged

🌱 Add -f flag to curl command for fail-fast lint behavior#202
openshift-merge-bot[bot] merged 2 commits intoopen-cluster-management-io:mainfrom
xuezhaojun:fix/curl-fail-flag

Conversation

@xuezhaojun
Copy link
Member

@xuezhaojun xuezhaojun commented Feb 25, 2026

Summary

  • Updated curl command from -sSL to -fsSL to fail on HTTP 4xx/5xx errors
  • Wrapped the pipeline with bash -o pipefail to ensure curl failures propagate correctly through the pipe

Without -f, curl silently pipes error HTML into bash on HTTP errors. Even with -f, without pipefail, 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

  • Chores
    • Improved CI lint process to more reliably detect and fail on HTTP errors when fetching resources during automated linting, while preserving silent output and redirect behavior so lint runs remain unobtrusive.

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>
@xuezhaojun
Copy link
Member Author

/assign @zhujian7

@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 25f3a43 and 48542c0.

📒 Files selected for processing (1)
  • ci/lint/README-golangci-lint.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • ci/lint/README-golangci-lint.md

Walkthrough

Updated a curl invocation in a CI lint README: the flag set changed from -sSL to -fsSL, adding -f to cause the command to fail on HTTP errors while retaining silent, show-error, and follow-redirect behavior.

Changes

Cohort / File(s) Summary
CI/Lint Configuration
ci/lint/README-golangci-lint.md
Modified curl invocation from -sSL to -fsSL in the lint Makefile target to add HTTP-error failure handling.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding the -f flag to curl for fail-fast behavior in linting, which matches the changeset.
Description check ✅ Passed The description covers the main changes (adding -f flag and pipefail handling) with clear explanation of why they matter, but the related issue field is incomplete (shows 'Fixes #' with no issue number).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 284a1f4 and 25f3a43.

📒 Files selected for processing (1)
  • ci/lint/README-golangci-lint.md

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>
@xuezhaojun
Copy link
Member Author

/assign @qiujian16

@qiujian16
Copy link
Member

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm label Feb 26, 2026
@openshift-ci
Copy link

openshift-ci bot commented Feb 26, 2026

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 632c728 into open-cluster-management-io:main Feb 26, 2026
13 checks passed
@xuezhaojun xuezhaojun deleted the fix/curl-fail-flag branch February 26, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants