Conversation
CI has been red on main since a3fe211. Three createProject tests in test/lib/project.test.js assert the initial commit lands, and a GitHub runner has no global git identity. The GIT_AUTHOR_*/GIT_COMMITTER_* vars the tests set never reach the git child process, because a Jest ESM test module mutates a copy of process.env (noted in the file's own comment at line ~150). Locally the commit falls back to the developer's global config, so the suite passes everywhere except CI. Configuring an identity in the workflow fixes it: 3 failed / 10 passed becomes 13 passed.
This case runs ~5.05s against Jest's 5000ms default on every Node version tested (measured on both 18 and 22 locally), so it sits right on the line and which CI leg fails is effectively a coin flip. Node 18 lost it on PR #13. The assertion is instant; the time goes on the HTTP round trip and server teardown. An explicit 20s budget makes the outcome deterministic rather than marginal.
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.
What this does
Makes CI green again.
mainhas been failing since a3fe211 (runs #50 and #51), on all three matrix legs.The failure is not in the product code — all 1208 tests pass locally, lint is clean, and
npm ciresolves fine. It is three assertions intest/lib/project.test.jsthat requirecreateProject's initialgit committo succeed:returns the facts a caller needs instead of printing them(L66)makes the initial commit(L84)reports the commit outcome as fields rather than as output(L158)git commitneeds an identity. A GitHub runner has no global git config, and theGIT_AUTHOR_*/GIT_COMMITTER_*vars the test sets inbeforeEachnever reach the child process — a Jest ESM test module mutates a copy ofprocess.env, which the file's own comment above L150 already documents. On a developer machinegitfalls back to the global config and the commit lands, so the suite passes everywhere except a bare runner.This adds a
Configure git identitystep to the workflow beforeTest.Verification
Reproduced and confirmed by neutralising the global git config:
GIT_CONFIG_GLOBAL=/dev/null(what CI has today)Same three tests, same line numbers as the CI annotations.
Note on the alternative
The narrower fix is to have
lib/project.jspass an explicitenvtoexecSync, but that would paper over a real behaviour: on a machine with no identity,bobby newgenuinely cannot commit, and the code already reports that correctly viacommitted: false/commitError. The tests are asserting the happy path, so the environment is what should supply the identity.Checklist
npm testpassesnpm run lintpasses (0 errors, 37 pre-existing warnings)CHANGELOG.mdnot updated — happy to add aFixedentry under[Unreleased]if you want build-infra changes logged there.