Default git commit verification to strict in v4 - #4145
Draft
jamiemonserrate wants to merge 1 commit into
Draft
Conversation
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.
Description
Make Git commit verification a secure default in agent v4.
The agent now uses
strictwhengit-commit-verificationis not configured. Operators can explicitly selectwarnto continue jobs after a definitive branch/commit mismatch. Empty and unsupported values are rejected instead of disabling verification.Verification that cannot be completed because of an infrastructure problem remains warning-only, preserving the existing availability behavior.
Context
Changes
--git-commit-verificationtostrict.strictandwarnfrom flags, environment variables, and config files.warnas the only mode that downgrades a definitive mismatch to a warning.warnoverride.Testing
go test ./...). Buildkite employees may check this if the pipeline has run automatically.go tool gofumpt -extra -w .)The affected packages pass in isolation:
GIT_CONFIG_GLOBAL=/dev/null go test ./clicommand -count=1GIT_CONFIG_GLOBAL=/dev/null go test ./internal/jobGIT_CONFIG_GLOBAL=/dev/null go test ./envGIT_CONFIG_GLOBAL=/dev/null go test ./internal/job/integration -count=1The full parallel suite was also attempted locally. Unrelated tests intermittently failed with macOS temporary-file
bad file descriptorerrors, and the user's global Git tag-signing configuration affected a tag fixture. The affected suites pass when run in isolation with the user-level Git configuration disabled.Deployment
This is an intentional v4 behavior change. Operators that need warning-only behavior must set
git-commit-verification="warn"orBUILDKITE_GIT_COMMIT_VERIFICATION=warn. There are no data migrations.Rollback
Revert this commit to restore the previous empty default and disabled state.
Affiliation (optional, external contributors)
Buildkite.
Disclosures / Credits
OpenAI Codex implemented the change and tests under Jamie Monserrate's direction.