fix(dockerdigest): include HideTag in ReportConfig to prevent source cache collision#8927
Merged
olblak merged 3 commits intoMay 19, 2026
Merged
Conversation
Member
|
Sorry for the issue, and thank you for the pull request. I definitely need to revamp the e2e tests to better catch this kind of regression |
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.
It's common to pair two
dockerdigestsources against the same image and tag: one withhidetag: falseforimage.tagand one withhidetag: trueforappVersion. This worked correctly for years until the source cache introduced in v0.116.0 started treating them as identical —ReportConfig()omitsHideTagfrom its output, so both sources hash to the same cache key. Whichever runs first populates the cache; the other receives a stale hit and produces the wrong result without any error — updatecli reports✔for both.This PR adds
HideTagto the struct returned byReportConfig()so each source gets a distinct cache key and executes independently.Because source execution order is non-deterministic, the failure shows up differently depending on which source wins the race:
version(hidetag=false)tag@sha256:…✓tag@sha256:…✓appversion(hidetag=true)""✗ — transformer receivestag@sha256:…;trimprefixis a no-opappversion(hidetag=true)version(hidetag=false)tag@sha256:…✓@sha256:…✗ — cache hit, no transformer on version sourceTest
To test this pull request, you can run the following commands:
The test calls
ReportConfig()on a source withhidetag: trueand asserts the returned JSON contains"HideTag":true— confirming the field is present and carries the correct value.To reproduce against a live registry, save as
reproduce.yamland runupdatecli apply -c reproduce.yaml:reproduce.yaml
On v0.116.0:
ord_a_appversion→"",ord_b_version→@sha256:…. On a patched build all four sources resolve correctly.Additional Information
Checklist
Tradeoff
HideTag: false(the default) now serializes as"HideTag":falsein the cache key JSON where it was previously absent. Users withhidetagunset will see a one-time cache miss on first run after upgrade — a fresh registry call with the correct result. No functional regression.Potential improvement
Other fields that affect the
dockerdigestoutput format, and any plugin added after #8291, should be audited to confirmReportConfig()is a complete identity function for the source's output.