Repository navigation
fix(delete-previous-head-image): keep referrers of retained manifests - #356
Merged
Merged
Conversation
A packages-only tag can retain a platform manifest after referrer protection has already run, leaving its signatures eligible for deletion. Compute retained manifests first so their referrers survive cleanup.
…eferrers Related to DEVOPS-1831
vcauesantos
force-pushed
the
devops-1831/referrer-after-keepset
branch
from
November 13, 2026 18:55
4c73800 to
900f0aa
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.
What happened
#347 stopped the cleanup from deleting the signatures of a manifest shared with a tagged image. One case was still open.
The action decided which signatures to keep before it asked the GitHub packages API about tags. Some tags only show up there, such as
debug. A platform manifest kept because of one of those tags stayed in GHCR, but its signature and itssha256-<digest>referrer index were still deleted.A dry run with fakes against 44da6a8 showed this: it kept the
debugmanifest and planned to delete its referrer index and signature.Nothing is affected today, because candy signs only the image index. A caller that signs each platform would lose those signatures.
What this PR changes
Signatures are protected after the full keep list is known. The action first collects every manifest it keeps, for any reason: still reachable from a tag, carrying a tag only the packages API shows, or having no package version. Then it keeps the signatures and referrer indexes of all of them. The delete order does not change: leaves first, the image index last.
A manifest with no package version now keeps its signatures too. Before, they were deleted. The action cannot delete that manifest, so leaving its signatures behind matches everything else it keeps.
The README says this. It now states that every kept manifest keeps its signatures and attestations, whatever the reason it was kept.
The step summary names the new reason as
refers to kept manifest <digest>.How it was tested
debugtag that only the packages API shows. It checks that the manifest, its referrer index and its signature all stay, and that the rest of the old image is deleted. It runs for both a real delete and a dry run.mainand passes with this change.make test-delete-previous-head-image: 24 passed, after rebasing ontomain.After merge,
delete-previous-head-image/v1moves to the merge commit so callers pick up the fix.Closes DEVOPS-1831