Repository navigation
Commit 3d4e235
authored
Lint the release the same way we lint everything else (#625)
* Lint the release the same way we lint everything else
release.yml pinned golangci-lint at v2.9.0 while test.yml and security.yml
had moved to v2.11.1. Nothing noticed, because the release gate is the one
job no pull request runs.
It surfaced as v0.9.0-rc.1 failing, on this:
internal/commands/assignments.go:142:85: G115: integer overflow
conversion int -> int32 (gosec)
That conversion is guarded two lines above it — `position < 1 || position >
math.MaxInt32` returns before the cast. gosec at v2.11.1 follows the bound
and stays quiet; at v2.9.0 it does not. So the finding was a false positive
that every PR check had already passed, and the only thing it blocked was a
release tag.
The pin is now in lockstep, and scripts/check-lint-lockstep.sh enforces
that rather than trusting the "keep in lockstep" comments that were already
there and had already failed. It reads the version off every
golangci-lint-action step and fails when they disagree, naming the files:
FAIL: golangci-lint pins disagree across workflows:
.github/workflows/release.yml:v2.9.0
.github/workflows/security.yml:v2.11.1
.github/workflows/test.yml:v2.11.1
Wired into `make check`, the release gate, and test.yml ahead of the linter
itself, so drift is reported as drift instead of as a version-specific
finding in whichever job happens to be the odd one out.
No change to assignments.go: the code was already correct.
* Fail on a golangci-lint step that pins nothing
The first version of this check parsed pins and compared them, so a step
that declared no version was skipped rather than caught: delete
release.yml's version line and the check reported success across the
remaining two workflows.
That is the same hole in a different shape. An unpinned step resolves to
whatever golangci-lint-action defaults to, which moves on its own
schedule and puts the release gate back on a version nothing else runs.
Now every golangci-lint-action step must carry a version. Verified in all
four states: agreeing pins pass, a drifted pin fails naming the files, a
deleted version line fails as UNPINNED, and restoring it passes again.1 parent 7aac5fd commit 3d4e235
4 files changed
Lines changed: 84 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
| 336 | + | |
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
416 | 421 | | |
417 | 422 | | |
418 | 423 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
0 commit comments