Repository navigation
feat(helm): render canonicalization and the contentDigest/inputDigest split (#1237) - #1889
Merged
Merged
Conversation
# Conflicts: # lexicons/helm/src/plugin.ts
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.
Part of #1228 — Phase 2.
What
A pinned render's output now normalizes to a canonical byte form before digesting, and a render record carries two digests with different jobs.
inputDigestanswers "same inputs?" cheaply. It is asha256:over the canonical JSON of the declared inputs — chart reference, chart version, resolved values, capability facts. It is the same digesthelmInstallrecords in the release ledger (#1243): both now delegate to one shared helper,helmInputDigest, so the two cannot drift.contentDigestanswers "same bytes on the cluster?". It is a fullsha256:over the canonical rendered bytes and is the artifact identity.They diverge exactly when a render is not a function of its declared inputs. Two renders with the same
inputDigestand differentcontentDigests mean the chart is unstable or an input escaped declaration.renderStability(records)reads the recorded renders and names that divergence.Canonicalization scope
Follows the epic's findings, nothing more.
# Source:header survives as each document's leading line (it is the origin-routing key). CRLF endings, trailing whitespace, other comments, and empty or comment-only documents do not.Gate
Only pinned renders (capability profile present — the v1 gate) record digests. An unpinned render's bytes depend on the local helm binary's defaulted capabilities, so a digest over them would assert an identity the render does not have; unpinned renders record neither. The classifier (#1234) is not forced into the render path — it needs chart source on disk, which a repo-fetched render does not keep.
The 16-hex cache key stays as it was, cache lookup only, so existing caches remain valid.
Stack
Stacked on #1886 (
feat/1235-capability-profiles) — theHelmRenderRecord/getHelmRenderRecords()seam and the profile plumbing come from there. That branch predates #1243/#1234 on main, so this branch also mergesorigin/mainto reachhelmInstallInputDigest; the base-branch diff shows those main commits until #1886 lands. If the base branch goes away, this rebases onto main.Tests
renderStabilityreports stableinputDigestequalshelmInstallInputDigestfor the same inputs (both sides of the shared helper)contentDigestandinputDigestboth move when values changerenderStability; different release names never groupednpx vitest run lexicons/helm/src— 654 passed.npm run build -w @intentius/chant-lexicon-helmclean.just lintclean.Closes #1237
Absorbs #1886 (its branch is this PR's base and its CI would not trigger after two pushes; the profile work rides here).
Closes #1235