Skip to content

Report hard lint failures even when another chart only warns - #944

Open
michaellzc wants to merge 1 commit into
marc/fix-ci-lint-scriptfrom
claude/deploy-sourcegraph-helm-pr-930-oay95k
Open

michaellzc wants to merge 1 commit into
marc/fix-ci-lint-scriptfrom
claude/deploy-sourcegraph-helm-pr-930-oay95k

Conversation

@michaellzc

Copy link
Copy Markdown
Member

Stacked on top of #930 — targets marc/fix-ci-lint-script, so the diff here is only the follow-up fix.

lint_and_record kept the first non-zero status it saw. A warning returns 255, and the Buildkite lint step soft-fails on exit 255 (.buildkite/pipeline.yaml), so a warning in an earlier chart downgraded a genuine lint failure in a later chart into a soft fail and the build went green. Now that the script lints all four charts instead of stopping at the first, that masking is reachable.

This tracks warnings and hard failures separately so severity — not order — decides the exit status:

  • any chart that fails to lint exits with that status (build fails)
  • warnings alone still exit 255 (soft fail, unchanged)
  • a chart that both warns and fails is reported as a failure
  • a per-chart Lint Summary is printed so every chart's outcome is visible in the log

Checklist

CI-only change, no chart templates or values touched, so no changelog or update-doc entry.

Test plan

Real run against all four charts with helm 3.16.3 — exits 0:

===== Lint Summary =====
PASS     charts/sourcegraph
PASS     charts/sourcegraph-migrator
PASS     charts/sourcegraph-executor/k8s
PASS     charts/sourcegraph-executor/dind

Failure modes exercised with a stub helm on $PATH that emits warnings / errors per chart:

scenario before (PR #930 head) after
chart A warns, chart B fails 255 → soft fail, build green 1 → build fails
chart A fails, chart B warns 1 1
warnings only 255 → soft fail 255 → soft fail
one chart both warns and fails 255 → soft fail 1 → build fails
all clean 0 0

Summary output for the first (previously masked) case:

===== Lint Summary =====
WARNING  chart-warn
FAIL     chart-err (helm lint exited 1)

One or more charts failed to lint

bash -n scripts/ci/lint.sh passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PjWHybsdqCvNqGoYDRCdah


Generated by Claude Code

lint_and_record kept the first non-zero status it saw. A warning returns
255, and the Buildkite lint step soft-fails on exit 255, so a warning in
an earlier chart downgraded a genuine lint failure in a later chart into
a soft fail and the build went green.

Track warnings and hard failures separately so severity, not order,
decides the exit status: any chart that fails to lint exits with that
status, warnings alone still exit 255, and a chart that both warns and
fails is reported as a failure. Add a per-chart summary so every chart's
outcome is visible in the CI log.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PjWHybsdqCvNqGoYDRCdah
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants