Commit b42689d
authored
feat(helm): derive chart appVersion from the release, and lint with ct (#7643)
* improvement(helm): lint the chart with ct instead of hand-rolled checks
Replaces `helm lint` and the bespoke version-bump job with chart-testing,
the CNCF chart linter that ingress-nginx, prometheus-community and
external-secrets all gate on. It subsumes both: `helm lint` plus yamllint
over Chart.yaml and every values file, Chart.yaml schema validation, and
--check-version-increment, which is on by default and is exactly what the
33 lines of bash were reimplementing.
One trap worth recording. Passing `--charts` silently DISABLES the version
check -- it prints "Version increment checking disabled." and still exits 0,
so wiring it that way would have swapped a working gate for one that can
never fail. The PR path uses `--chart-dirs helm --target-branch <base>`; a
push has no base to diff, so `--charts` is correct there. Verified both
directions in a scratch repo with a real remote: content changed without a
bump gives "chart version not ok. Needs a version bump!" and exit 1, the
same change with a bump gives "Chart version ok."
Three chart fixes ct's yamllint required: 66 lines of trailing whitespace in
values.yaml, one inline comment a space short of the two yamllint wants, and
brace spacing in ci/full-values.yaml. Nothing but whitespace -- no
non-comment line changed, and both rendered manifest sets are byte-identical
before and after.
Renames ci/kind-values.yaml to ci/kind-overlay.yaml. ct treats every
ci/*-values.yaml as a standalone values set, but that file is a partial
layered on default-values.yaml, so linting it alone tripped the chart's own
required-secret guards. The new name is outside the glob and the header says
why.
Maintainer validation stays off: it resolves maintainers[].name against real
forge accounts and ours is the display name "Sim Team", so enabling it would
change what Artifact Hub shows.
* feat(helm): derive chart appVersion from the release instead of gating on it
appVersion is what the chart's image tags default to, so a stale one publishes
a chart that installs an older Sim than the release it ships with, and
images.yaml -- the list an operator mirrors into a disconnected registry --
names the wrong tags with it. Published chart versions are immutable, so each
stale value is frozen the moment it ships.
It was bumped by hand, drifted forty releases, and drifted twice more after a
check started catching it. That is the tell: the check could refuse to publish
but could not supply the value, so the only thing it reliably produced was a
red build on every release and a chart that never shipped. Only 1.11.0 was
ever published for exactly this reason.
The publish jobs now derive it. On a release merge the tag does not exist yet
-- this commit is what cuts it -- so the version comes from the commit
subject, and from the latest release for every other push. Both publish paths
run the same script before packaging, so the OCI artifact and the HTTP repo
cannot disagree.
Removes the post-merge check, which is now unreachable by construction, and
does not replace it with the pre-merge title gate that was considered: that
one guarded ground truth with a heuristic, and its failure mode was passing
silently.
Precedent is cert-manager, whose chart also lives in its application repo and
which injects the version at package time. The projects that commit the value
and bump by hand -- argo-cd, ingress-nginx, prometheus-community -- all keep
the chart in a separate repository, where a human is already editing
Chart.yaml as the unit of change. We are the former shape.
Verified the resolution across six subjects: release commit, multi-line body
carrying a decoy version, ordinary push, leading whitespace, shell
metacharacters (no expansion), and a version that is not at the start. Also
verified the script's exit codes directly rather than through a pipe, since a
gate that cannot fail is the thing being replaced here.
Sets appVersion to v0.8.26, two releases ahead of where it was stuck, and
regenerates images.yaml with it.
* fix(helm): match ci.yml's release predicate and resolve the version once
Two review findings, both real.
The leading-whitespace tolerance was wrong here. detect-version in ci.yml is
what actually cuts the tag and builds the images, and it anchors the version
at the first character. Accepting a subject it rejects meant the chart could
publish naming a release that was never created, pointing at images that do
not exist. The pattern is now identical to ci.yml's, with a comment saying it
has to stay that way. The tolerance came from a PR-title parsing problem in an
earlier design; commit subjects have a different authority.
The two publish jobs also resolved the version independently, and they run in
parallel. A release becoming public between those two API calls would package
the same immutable chart version with different appVersions, so the OCI
artifact and the HTTP repo would install different Sims. Resolution moved to
one job both consume, which also removes the duplicated logic.
Separately, --check only inspected Chart.yaml while the script writes both
that and the inventory derived from it, so it could report success over a
stale inventory. It now verifies both halves; confirmed it exits 1 when the
inventory is stale and 0 once regenerated.1 parent 6954859 commit b42689d
7 files changed
Lines changed: 303 additions & 161 deletions
File tree
- .github/workflows
- helm/sim
- ci
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
49 | 55 | | |
50 | 56 | | |
51 | 57 | | |
| |||
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
67 | | - | |
68 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
69 | 100 | | |
70 | 101 | | |
71 | 102 | | |
| |||
122 | 153 | | |
123 | 154 | | |
124 | 155 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | 156 | | |
159 | 157 | | |
160 | 158 | | |
| |||
180 | 178 | | |
181 | 179 | | |
182 | 180 | | |
183 | | - | |
| 181 | + | |
184 | 182 | | |
185 | 183 | | |
186 | 184 | | |
| |||
195 | 193 | | |
196 | 194 | | |
197 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
198 | 239 | | |
199 | 240 | | |
200 | 241 | | |
| |||
206 | 247 | | |
207 | 248 | | |
208 | 249 | | |
209 | | - | |
| 250 | + | |
210 | 251 | | |
211 | 252 | | |
212 | 253 | | |
| |||
234 | 275 | | |
235 | 276 | | |
236 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
237 | 291 | | |
238 | 292 | | |
239 | 293 | | |
| |||
249 | 303 | | |
250 | 304 | | |
251 | 305 | | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | 306 | | |
291 | 307 | | |
292 | 308 | | |
| |||
424 | 440 | | |
425 | 441 | | |
426 | 442 | | |
427 | | - | |
| 443 | + | |
428 | 444 | | |
429 | 445 | | |
430 | 446 | | |
| |||
454 | 470 | | |
455 | 471 | | |
456 | 472 | | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
457 | 487 | | |
458 | 488 | | |
459 | 489 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
4 | 8 | | |
5 | 9 | | |
6 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
0 commit comments