Repository navigation
👷 fix(chart,ci): ship CRDs that match the API, and gate the drift - #299
Merged
Merged
Conversation
PERF-FIX-08. The publishable Helm chart carries its own copy of the CRDs in `charts/kollect/crds/`, and nothing on the merge path regenerated it. `hack/helm-sync-crds.sh` is called only by `hack/release-assets.sh`, so drift could only surface at release time -- long after it was introduced, and by then already baked into whatever was being cut. Four chart CRDs had drifted behind `config/crd/bases`, 71 lines of real schema: kollectclusterinventories +27 kollectinventories +27 kollecttargets +9 (extractionFailures, lastExtractionError) kollectclusterscopes +8 The `kollecttargets` gap is the one that shows why this matters. The operator writes `status.extractionFailures` and `status.lastExtractionError`; a chart whose CRD does not declare them means the API server prunes both on write. The operator then looks like it simply never reports extraction failures -- no error, no event, no clue. It fails quietly, which is the worst way for a schema to be wrong. So the fix is two halves, and the gate is the half that lasts: - Sync the four CRDs, repairing the shipped chart. - Extend `hack/verify.sh` -- which already regenerates and diffs `config/crd/bases`, `config/rbac/role.yaml` and the deepcopy files -- to do the same for the chart copy. It is the natural home: `task verify` runs it, and `preflight` runs that, which is a required check. Drift now fails on the PR that introduces it and names `hack/helm-sync-crds.sh` in the failure. Proven in that order: with the drift present `hack/verify.sh` exits non-zero and prints the missing `extractionFailures`/`lastExtractionError` block; after the sync it exits 0. `task helm-test` stays green (9 suites, 40 tests).
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…gate Independent review found the drift gate had a blind spot large enough to ship through. `hack/helm-sync-crds.sh` did `cp -f`, which only ever adds and overwrites. A CRD renamed or removed upstream would linger in `charts/kollect/crds/` forever -- and because the stale file is present both in the pre-sync snapshot and after the sync, `diff -ru` sees no difference and the new gate reports clean. Reproduced: copying an existing CRD to `zz-orphan.yaml` left `hack/verify.sh` exiting 0 while the chart carried a phantom CRD. Clearing the destination first makes the copy a true mirror, so deletions propagate and the gate can see them. Same reproduction now fails correctly with `Only in .../charts/kollect/crds: zz-orphan.yaml`. The review also flagged that AGENTS.md's two enumerations of what `task verify` gates are wrong in both directions -- they list "mocks", which `hack/verify.sh` has never checked, and omit the chart CRD copy. That file is gitignored (.gitignore:12), so it is a local operator note rather than a shipped contract; corrected locally, deliberately not part of this commit.
konih
force-pushed
the
fix/perf-fix-08-chart-crd-drift-gate
branch
from
August 16, 2026 07:55
dbfbe5f to
f14d342
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



PERF-FIX-08
The publishable Helm chart carries its own copy of the CRDs in
charts/kollect/crds/, and nothing on the merge path regenerated it.hack/helm-sync-crds.shis called only byhack/release-assets.sh— so drift could only surface at release time, by which point it is already baked into whatever is being cut.Found while implementing PERF-FIX-05, verified independently on
main.The drift — 71 lines of real schema
kollectclusterinventorieskollectinventorieskollecttargetsextractionFailures,lastExtractionErrorkollectclusterscopesThe
kollecttargetsgap shows why it matters. The operator writesstatus.extractionFailuresandstatus.lastExtractionError. A chart whose CRD does not declare them means the API server prunes both on write — so the operator appears to simply never report extraction failures. No error, no event, no clue. It fails quietly, which is the worst way for a schema to be wrong.Fix — and the half that lasts
hack/verify.shalready regenerates and diffsconfig/crd/bases,config/rbac/role.yaml, and the deepcopy files. The chart copy now gets the same treatment. That is the natural home:task verifyruns it, andpreflightruns that — a required check. Drift now fails on the PR that introduces it, naminghack/helm-sync-crds.shin the failure message.Proven in that order
hack/verify.shexits non-zero and prints the missingextractionFailures/lastExtractionErrorblock.task helm-test— 9 suites, 40 tests, passing.