fix(promote): write only the component's own record to its latest_release leaf#601
Merged
Merged
Conversation
…test_release.components Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
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.
The component-scoped latest_release write passed the whole top-level latest_release value - including its own per-component components map - into the component leaf, so each component publish nested every component's markers (and the top-level-only released_by) under latest_release.components., accreting stale self and sibling data on every publish. It was invisible because no promote test fixture carried latest_release.
Fix: applyComponentLatestLeaf now projects the write into a component-shaped record (version, sha, released_on only) - byte-for-byte what the changelog reader consumes, so it round-trips - and the promote serializeState path drops its latest directive on the component branch (promotion is not a publish and must not mutate the release marker; node-patching preserves the leaf verbatim). The top-level (non-component) writer is unchanged.
Verification: build/-race/lint green, 3001 tests; red-then-green tests for the leaf shape, the finalize publish marker, the promote-does-not-touch case, and a round-trip to the changelog read; a prior test that asserted the buggy nested shape was corrected. No generated output changed; no shipped manifest carries the nested shape.