Skip to content

Fix CI lint script to lint all charts - #930

Merged
marcleblanc2 merged 2 commits into
mainfrom
marc/fix-ci-lint-script
Sep 21, 2026
Merged

marcleblanc2 merged 2 commits into
mainfrom
marc/fix-ci-lint-script

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor
  • lint_chart exited the whole script after the first chart, so only charts/sourcegraph was ever linted
  • Lint every chart even after a failure, report per-chart results, and exit with the first failing status

Amp-Thread-ID: https://ampcode.com/threads/T-01a04192-5b1d-7040-9dc3-76f8d5a10ab0

Checklist

Test plan

Before

$ cd deploy-sourcegraph-helm
$ ./scripts/ci/lint.sh
Linting chart sourcegraph


===== Lint Output =====
==> Linting charts/sourcegraph

1 chart(s) linted, 0 chart(s) failed

After

$ cd deploy-sourcegraph-helm
$ ./scripts/ci/lint.sh
Linting chart charts/sourcegraph


===== Lint Output: charts/sourcegraph =====
==> Linting charts/sourcegraph

1 chart(s) linted, 0 chart(s) failed
Linting chart charts/sourcegraph-migrator


===== Lint Output: charts/sourcegraph-migrator =====
==> Linting charts/sourcegraph-migrator

1 chart(s) linted, 0 chart(s) failed
Linting chart charts/sourcegraph-executor/k8s


===== Lint Output: charts/sourcegraph-executor/k8s =====
==> Linting charts/sourcegraph-executor/k8s

1 chart(s) linted, 0 chart(s) failed
Linting chart charts/sourcegraph-executor/dind


===== Lint Output: charts/sourcegraph-executor/dind =====
==> Linting charts/sourcegraph-executor/dind

1 chart(s) linted, 0 chart(s) failed

@marcleblanc2
marcleblanc2 enabled auto-merge (squash) August 27, 2026 05:15
@marcleblanc2
marcleblanc2 requested a review from a team August 27, 2026 05:15
marcleblanc2 pushed a commit that referenced this pull request Sep 21, 2026
Stacked on top of
[#930](#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

- [x] Follow the [manual testing
process](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/TEST.md)
- [ ] Update
[changelog](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/charts/sourcegraph/CHANGELOG.md)
- [ ] Update [Kubernetes update
doc](https://docs.sourcegraph.com/admin/updates/kubernetes)

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.com/claude-code)

https://claude.ai/code/session_01PjWHybsdqCvNqGoYDRCdah

---
_Generated by [Claude
Code](https://claude.ai/code/session_01PjWHybsdqCvNqGoYDRCdah)_

Co-authored-by: Claude <noreply@anthropic.com>
marcleblanc2 and others added 2 commits September 21, 2026 17:56
- lint_chart exited the whole script after the first chart, so only
  charts/sourcegraph was ever linted; migrator and executor were skipped
- charts/sourcegraph-executor is a parent directory of two charts (k8s,
  dind), not a chart, so its lint line would have failed anyway
- Lint each executor chart directly, with --set executor.queueName so the
  templates render instead of warning on empty metadata.name
- Lint every chart even after a failure, report per-chart results, and
  exit with the first failing status

Amp-Thread-ID: https://ampcode.com/threads/T-01a04192-5b1d-7040-9dc3-76f8d5a10ab0
Co-authored-by: Amp <amp@ampcode.com>
Stacked on top of
[#930](#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

- [x] Follow the [manual testing
process](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/TEST.md)
- [ ] Update
[changelog](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/charts/sourcegraph/CHANGELOG.md)
- [ ] Update [Kubernetes update
doc](https://docs.sourcegraph.com/admin/updates/kubernetes)

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.com/claude-code)

https://claude.ai/code/session_01PjWHybsdqCvNqGoYDRCdah

---
_Generated by [Claude
Code](https://claude.ai/code/session_01PjWHybsdqCvNqGoYDRCdah)_

Co-authored-by: Claude <noreply@anthropic.com>
@marcleblanc2
marcleblanc2 force-pushed the marc/fix-ci-lint-script branch from ef7b548 to ecfad31 Compare September 21, 2026 23:56
@marcleblanc2
marcleblanc2 merged commit 9e7fa4b into main Sep 21, 2026
5 checks passed
@marcleblanc2
marcleblanc2 deleted the marc/fix-ci-lint-script branch September 21, 2026 23:57
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