Conversation
preen had a release workflow and nothing that ran the twenty-five test files it already carries, so a tool whose pitch is that it provably does not lose your work shipped no visible evidence that anything was checked. Build, vet, test and a gofmt check, with git given an identity because the tests drive a real one. The run package now clears GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM for itself. Its harness already did that for the commands it runs, but the engine spawns git of its own and those children read the process environment, so anyone with core.hooksPath set globally watched three hook tests fail against hooks they never wrote. The suite was red on my machine and green everywhere else, which is the wrong way round.
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.
preen had
release.ymland nothing else. Twenty-five test files, none of them runby anything. For a tool whose central claim is that it rewrites history and
provably does not lose a byte, shipping no visible evidence that the tests pass is
the wrong gap to have.
The workflow
Build, vet, test, and a gofmt check, on push to main and on every pull request.
Go version comes from
go.modrather than being pinned separately, so it cannotdrift from what the module declares. Git is given an identity and a default branch
name, because the tests drive a real git rather than a fake.
A test isolation bug found while wiring it up
The suite did not pass on my own machine. Three hook tests failed:
Not a real failure, and not a CI problem either, which is the interesting part. I
have
core.hooksPathset in my global git config, which is the ordinary way toinstall shared hooks. While it is set, git ignores repository-local hooks, so the
hook each test installs never runs and the test is left asserting against nothing.
newHarnessalready passedGIT_CONFIG_GLOBALandGIT_CONFIG_SYSTEMto the gitcommands it runs itself. The engine under test spawns git on its own, and those
children inherit the process environment rather than the harness's, so the
isolation stopped at the boundary that mattered. The
runpackage now sets bothin
TestMain, which covers every git the package causes to run.This would have passed CI either way, on a clean runner with no global config.
Which is the worst version of the problem: green in CI and red for anyone who
installs hooks the normal way, including me. The full suite is now green locally
with my real configuration in place.