ci: ignore Dockerfile comments when fingerprinting [bump:patch]#14
Merged
Conversation
The change-detection fingerprint hashed the whole Dockerfile, so a comment- or whitespace-only edit forced a full from-source rebuild (e.g. a one-word doc tweak to Dockerfile.qemu would rebuild qemu on both arches). Normalise the Dockerfile first: drop blank lines and line-leading comments, but keep parser directives (# syntax=, # escape=) which do affect the build. Inline '#' is left intact since it is not a Dockerfile comment. Real instruction changes still rebuild. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.
Problem
detectfingerprints each from-source tool by hashing its whole Dockerfile plus the build-arg version vars. So a comment- or whitespace-only edit changes the hash and forces a full rebuild — e.g. thePROOF OF CONCEPT→A fully-static…doc tweak inDockerfile.qemu(already on master) makes the next release rebuild qemu on both arches despite zero build-relevant change. The fingerprint is meant to skip exactly these no-op rebuilds.Not a correctness bug (it errs safe — never reuses a stale binary), but wasted CI: a comment typo could cost an hour of clang.
Fix
Normalise the Dockerfile before hashing: drop blank lines and line-leading comments, keep parser directives (
# syntax=,# escape=) since those affect the build. Inline#is untouched (it's not a Dockerfile comment).Verified locally (reproducing
detect's logic vsv0.5)RUN …toDockerfile.qemu→ still rebuilds (safety preserved)Note
This touches
vendor.yml, which is in the trigger paths, so merging cuts a release. Subject is[bump:patch], so it'll publish a patch (e.g.v0.6.1after the demo'sv0.6.0).