feat(pre-commit-advisory): opt-in private-modules for Go module fetches - #49
Merged
Merged
Conversation
Repos that fetch private pinpredict Go modules (ppkit) instead of vendoring had to drop the pre-commit advisory job entirely — the go-mod-tidy-repo and golangci-lint hooks fail with 'could not read Username for github.com' on the private fetch (herald and covenant both omit the job for this reason; the understudy feeds plugin just hit it too). Add an opt-in private-modules input mirroring docker-release.yml's: mint a short-lived read-only pinpredict-argocd App token, install a git insteadOf rewrite for github.com/pinpredict/, and set GOPRIVATE before the hooks run. Callers pass private-modules: true + secrets: inherit. Default false — inert for every existing caller.
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
Repos that fetch private pinpredict Go modules (
ppkit) instead of vendoring can't run the pre-commit advisory job at all: thego-mod-tidy-repoandgolangci-lint(typecheck) hooks fail withfatal: could not read Username for 'https://github.com'on the private module download. herald and covenant both dropped the job for exactly this reason, losing the advisory diff-scoped hook run + sticky PR comment on those repos — and understudy just hit the same wall when its feeds plugin added a ppkit dependency (understudy#47).What
An opt-in
private-modulesboolean input, mirroring the onedocker-release.ymlgained in #26:BOOTSTRAP_APP_ID/BOOTSTRAP_APP_PRIVATE_KEYviasecrets: inherit), install a gitinsteadOfrewrite forgithub.com/pinpredict/, and exportGOPRIVATE=github.com/pinpredict/*before pre-commit runs.false— completely inert for every existing caller (all pin@main).Caller usage
First consumer will be understudy (restoring the advisory job its feeds-plugin PR had to drop); herald and covenant can then restore theirs too.