Skip to content

fix(record): prefer branch-qualified cells over legacy cells - #167

Merged
abn merged 2 commits into
mainfrom
fix/record-legacy-cell-precedence
Sep 20, 2026
Merged

abn merged 2 commits into
mainfrom
fix/record-legacy-cell-precedence

Conversation

@abn

@abn abn commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

build-site now 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. IterRecords sorts cells by directory name, so the legacy cell is returned last, and mergeRecord keeps the last write for a given ref and architecture. The stale legacy digest and labels win, silently.

Fix

IterRecords now 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

  • Unit tests pin the preference in both lexical orders (the legacy cell sorts before its replacement for some architectures and after it for others) and confirm a lone legacy cell still loads. Reverting the dedupe fails the preference test.
  • A new integration test pushes one app on two branches (master and 2.54) in a single push-oci run against a local registry, then builds the site and asserts both refs reach index/static, both .flatpakref files are generated, the dotted branch reaches its record with the sanitized tag, and no legacy cell is written.

Impact

abn added 2 commits September 20, 2026 15:56
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.
@abn
abn added this pull request to the merge queue Sep 20, 2026
Merged via the queue into main with commit 59dc4c0 Sep 20, 2026
6 checks passed
@abn
abn deleted the fix/record-legacy-cell-precedence branch September 20, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant