buildx(build): pin implicit git contexts consistently#1085
Open
crazy-max wants to merge 1 commit intodocker:mainfrom
Open
buildx(build): pin implicit git contexts consistently#1085crazy-max wants to merge 1 commit intodocker:mainfrom
crazy-max wants to merge 1 commit intodocker:mainfrom
Conversation
faa4b91 to
c6971e0
Compare
|
It looks like your workflow step could use actions-toolkit/.github/workflows/test.yml Lines 202 to 220 in 3c03d19 I'd add |
Member
Author
Yes agree |
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
c6971e0 to
dde1528
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.
fixes #1083
This change makes implicit git contexts resolve to the event commit consistently across fragment and query formats. The old behavior already pinned most fragment contexts to the event SHA, but query mode still kept symbolic branch and tag refs with a checksum, which meant a later ref update could fail before BuildKit ever got to the pinned commit.
The current
gitContext()logic now treats implicit refs as commit-pinned by default and only preserves a symbolic ref in query mode when the caller explicitly provided a checksum. This keeps the old explicit checksum contract, keepsrefs/pull/*/headpinned to the pull request head SHA instead of the merge SHA, and removes the older split where pull request refs had special ad hoc handling while branches and tags followed a different path. The function was also simplified in place so the main concepts are easier to read, namely the explicit checksum, the implicit pinned ref, and the final rendered URL.The history here matters because the previous fix only addressed
refs/pull/*drift, but the real problem was broader. Older code at 3bb4ae3#diff-0cd594dddd6a9f2e3e26afebbb92716434437d7001c2416252aa7531e7f2b8d4L45-L60 collapsed most non-PR refs to the event SHA, which made fragment-style contexts effectively pinned, while newer query-style contexts preserved symbolic refs likerefs/heads/*andrefs/tags/*together.