feat(deploy-artifacts): upload SHA alias .info for Go modules#218
Draft
byted wants to merge 1 commit into
Draft
Conversation
When the workflow VERSION input is a full 40-char Git SHA, upload an additional `<module>/@v/<sha>.info` alongside the canonical .info, reusing the same tmpfile so the alias content is byte-identical to the canonical pseudo-version metadata. This lets `go get <module>@<full-sha>` resolve through a JFrog-only GOPROXY without live VCS access. Abbreviated SHAs (e.g. 7- or 12-char) are intentionally not aliased -- pre-uploading every prefix length is wasteful, and 40-char is the form CI typically passes.
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.
Why
go get <module>@<full-sha>against a JFrog-only GOPROXY currently fails: the proxy has no live VCS access, so a SHA-named.infoquery has nothing to resolve against. Today we only upload the canonical pseudo-version.info, so consumers must already know the pseudo-version — defeating the point of pasting a SHA.This change makes the deploy stage upload an additional
<module>/@v/<sha>.infowhenever the workflowVERSIONinput is a full 40-char Git SHA. The alias reuses the canonical tmpfile, so its content is byte-identical to the pseudo-version.info. Once Go reads the alias, it switches to the canonical pseudo-version filenames for.mod/.zipand the rest of the flow is unchanged.Only the 40-char form is aliased. Matching proxy.golang.org's "any abbreviated SHA" behavior would require pre-uploading every prefix length (7..40) per commit, which is wasteful — and 40 is the form CI typically passes (
github.sha, etc.). Abbreviated SHAs and pseudo-versions are intentionally rejected byis_git_sha.