Repository navigation
ci(lint): retry golangci-lint config verify on transient failures - #78
Conversation
config verify downloads its JSON schema from golangci-lint.run at run time, so a slow or unreachable site failed the required lint gate even on clean code. Retry it up to 3 times (10s, then 20s apart) and fail only if every attempt fails. An invalid .golangci.yml still fails the step, after the retries. The pinned v2.10.1 only offers a hidden debug flag for a local schema, so vendoring the schema was not used. Closes #72 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 1 billable file and costs up to $0.25.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 36 minutes for your next included review. View limit details
Comment |
|
Merge-driver verdict: CLEAN at An independent adversarial reviewer (Sonnet, high effort, cold brief, not the author) reviewed the full diff. It found no blocking findings. Shell semantics. The step sets
Local verification (fixture, macOS). I extracted the run block and ran it under
Real tool checks:
Non-blocking notes:
Gate items:
|
Summary
The Lint Code job runs
golangci-lint config verify, which downloads its JSON schema from golangci-lint.run at run time. When that site is slow, the required lint gate fails on clean code, as it did on #71 (run 38836492087,context deadline exceeded).Now
config verifyruns inside a smallverify_configfunction in the "Run golangci-lint" step. It tries up to 3 times, waiting 10s and then 20s between attempts, and logs each failed attempt to stderr. It fails the step only if all 3 attempts fail.golangci-lint runis unchanged and still runs only after verify passes.I chose option 2 (bounded retry) from the issue:
--schemaflag (pkg/commands/config_verify.go). That flag is not a supported interface, and a vendored schema would need updating on every lint bump.Closes #72
Verification (local, macOS, fake-binary harness plus the real pinned linter)
I extracted the step's
run:block and ran it underbash --noprofile --norc -eo pipefail, with a fakegolangci-lintfirst on PATH:runinvoked?runfailscdfailsreturn 1toreturn 0makes the always-fail case pass, so the harness catches it.golangci-lint@v2.10.1 config verifyon a deliberately invalid config exits 3 with schema errors. An invalid.golangci.ymltherefore still fails CI, about 30s later than before.Review
An independent non-author reviewer (Sonnet, high effort) did two passes and had no actionable findings. Pass 2 was on the exact staged tree
ddf124e. It checked:&&list: the function returns explicit statuses;run:shell; this step sets its ownset -euo pipefail;CodeRabbit was not pinged because the org's CR quota is exhausted.
🤖 Generated with Claude Code