fix(record): prefer branch-qualified cells over legacy cells - #167
Merged
Merged
Conversation
IterRecords returns cells sorted by directory name, so a legacy <app-id>-<arch> cell sorts after the branch-qualified <app-id>-<branch>-<arch> cell it replaces. mergeRecord keeps the last write for a given ref and arch, so on an upgraded records dir the stale legacy digest and labels won. Drop the legacy cell when a branch-qualified cell for the same app, architecture, and branch exists.
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.
build-sitenow indexes the branch-qualified cell when a records dir holds both a legacy<app-id>-<arch>cell and a fresh<app-id>-<branch>-<arch>cell for the same app, architecture, and branch. An in-place upgrade can no longer publish a stale digest and labels.Problem
A records dir that survives an upgrade can hold two cells for one app, architecture, and branch: the legacy
<app-id>-<arch>cell and the branch-qualified<app-id>-<branch>-<arch>cell that #162 introduced.IterRecordssorts cells by directory name, so the legacy cell is returned last, andmergeRecordkeeps the last write for a given ref and architecture. The stale legacy digest and labels win, silently.Fix
IterRecordsnow prefers the branch-qualified cell. When both forms exist for the same app, architecture, and branch, the legacy cell is dropped, deterministically and independent of write order. A legacy cell with no branch-qualified counterpart still loads, so records that have not been re-pushed keep working.Coverage
masterand2.54) in a singlepush-ocirun against a local registry, then builds the site and asserts both refs reachindex/static, both.flatpakreffiles are generated, the dotted branch reaches its record with the sanitized tag, and no legacy cell is written.Impact