test: Disable commit signing in tests#582
Open
erezrokah wants to merge 1 commit intoentireio:mainfrom
Open
Conversation
74b29c0 to
02107a1
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes unit tests resilient to developers who have global Git commit signing enabled by explicitly disabling commit.gpgsign inside the temporary repositories created by the tests.
Changes:
- Set
git config commit.gpgsign falseininitBareWithMetadataBranchto prevent signed commits during strategy tests. - Disable commit signing in
hook_registry_test.gobefore creating initial commits in two hook-related tests. - Disable commit signing in
explain_test.go’s temporary repo setup to keep the test’s empty commit creation working.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| cmd/entire/cli/strategy/common_test.go | Disables commit signing in the helper that creates commits for metadata-branch tests. |
| cmd/entire/cli/hook_registry_test.go | Disables commit signing in two tests that create an initial commit as part of repo setup. |
| cmd/entire/cli/explain_test.go | Disables commit signing in the temp repo initialization used by the explain routing test. |
toothbrush
requested changes
Mar 2, 2026
Contributor
toothbrush
left a comment
There was a problem hiding this comment.
Hey @erezrokah, thanks for raising a PR to improve the CLI!
Rather than poking at a specific config flag that breaks tests in this particular situation, i think a better approach would be to ensure Git uses a "clean" config by ignoring any user-configured flags on the system, something like this:
What do you think?
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.
Going through the contributing guide and noticed that if you have commit signing enabled (I do) the tests fail.
This PR fixes the issue by disabling it for the relevant tests.
I could also move the logic to a centralized place but that seems premature