Skip to content

fix!: depend only on debug at runtime and release 3.0.0 - #14

Merged
agoldis merged 6 commits into
masterfrom
agoldis/commit-info-3.0.0
Nov 4, 2026
Merged

agoldis merged 6 commits into
masterfrom
agoldis/commit-info-3.0.0

Conversation

@agoldis

@agoldis agoldis commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

@currents/commit-info now depends only on debug. An install goes from 25 packages to 3. Releases 3.0.0.

Breaking: the functions return a native Promise, not a Bluebird promise. .tap(), .spread() and the other Bluebird methods are gone. await and .then() work as before.

Changes:

  • bluebird, execa, lazy-ass and check-more-types are removed. git runs with child_process.spawn, without a shell, as it did with execa.
  • git errors keep the fields execa 1.0 set: code, stdout, stderr, timedOut and the "Command failed" message.
  • When Node exits, git commands that are still running are killed, as execa did.
  • debug is 4.4.3.
  • src/utils-e2e.js is no longer published. It is a mocha test.
  • package.json no longer declares engines. The code needs nothing newer than async/await and spawn. CI tests Node 22 and 24 instead of 16, and the README says so. The git 2.25 job still uses the Node of its container image.
  • The tests run with vitest 4.1.12 instead of mocha 6. vitest snapshots replace snap-shot-it with the same values, and vi.spyOn replaces sinon. Test files run one at a time, as with mocha. The script names are the same, so the workflows don't change.

Differences from execa 1.0, also listed in the CHANGELOG:

  • node_modules/.bin and the folder of the node binary are not added to PATH, so a git in node_modules/.bin is not used.
  • A SIGTERM sent to the Node process alone leaves running git commands running. Ctrl+C in a terminal still reaches git, because it goes to the whole process group.
  • Output over 10 MB fails with a plain Error (stdout maxBuffer exceeded), not a MaxBufferError.
  • On Windows, git must be git.exe in PATH. execa also ran git.cmd and git.bat.

Verification

  • npm test (lint, then vitest): 124 passing on Node 22.13.0 and 24.14.1, 3 runs each. The 124 test names are the same as under mocha. Lint changed no files.
  • 2.0.0 and this branch side by side, in a fresh process per run, on Node 20.0.0, 22.13.0 and 24.14.1: the results, stderr and exit codes are identical in all 38 scenarios. The scenarios cover:
    • GitHub Actions shallow PR checkouts
    • worktrees, submodules, bare repos and no repo
    • git missing, not executable, or killed by a signal
    • dubious ownership
    • output of exactly 10 MB and of 10 MB plus 1 character
    • 200 concurrent calls
  • Error objects compared field by field in 12 failure cases: identical, except the class of the over-10 MB error.
  • After process.exit() or an uncaught error, no git process keeps running, same as 2.0.0.
  • @currents/cmd uploading with this package, in 5 setups including a GitHub Actions shallow PR checkout: the commit and ci data are identical to 2.0.0.
  • @currents/playwright 2.7.0 with this package, on Node 20.18.1, 22.13.0 and 24.14.1:
    • Unit tests: 832/832 pass. Lint passes. Results are the same as with 2.0.0.
    • The commit and ci data from getGitInfo() and getCI() are identical to 2.0.0 in 26 scenarios, including GitHub Actions and GitLab. The only exception is a git in node_modules/.bin, listed above.
    • None of its calls use Bluebird methods or execa error fields.
    • Its install goes from 191 packages to 169.
  • Not tested: Windows, and dubious ownership from a real other file owner. The tests used a fake git for that case.

After merge: publish 3.0.0-beta.0 from a release branch, test the beta in cmd and the Playwright reporter, then publish 3.0.0.

🤖 Generated with Claude Code

https://claude.ai/code/session_011baD3hSBFPLp26um5JriwA

agoldis and others added 4 commits November 3, 2026 16:09
Remove bluebird, execa, lazy-ass and check-more-types. An install of the
package goes from 24 dependencies to 2 (debug and ms).

- git runs with child_process.spawn, without a shell. The errors keep the
  fields execa 1.0 set (code, stdout, stderr, timedOut, the
  "Command failed" message), and stdout loses only its last newline.
- Promise.props, Promise.try and .tap are replaced with native promises.
- The argument checks of lazy-ass become plain checks that throw the same
  errors for strings, numbers and booleans.
- debug is 4.4.3.
- src/utils-e2e.js is no longer published: it is a mocha test and needs
  lazy-ass, now a dev dependency.

BREAKING CHANGE: the functions return native promises, not Bluebird
promises, so Bluebird methods such as .tap() are not on the result. Also,
execa put node_modules/.bin and the folder of the node binary first in
PATH; git now runs from the PATH as it is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011baD3hSBFPLp26um5JriwA
execa 1.0 killed the git commands that still ran when Node exited. The
spawn-based runner left them running after process.exit() or an uncaught
error. The runner now keeps the running git processes in a set and kills
them from an 'exit' listener. The listener is added when the first git
command starts and removed when the last one ends.

There are no signal handlers, so Node's signal behavior does not change. A
SIGTERM sent to Node alone still leaves git running, unlike execa, which
used signal-exit. The CHANGELOG lists this and the plain Error for output
over 10 MB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011baD3hSBFPLp26um5JriwA
The code needs nothing newer than async/await and child_process.spawn.
Instead of an engines range that no CI job tests, package.json declares
none, and the README names the versions CI runs: 22 and 24, instead of 16.
The git 2.25 job still uses the Node.js of its container image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011baD3hSBFPLp26um5JriwA
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011baD3hSBFPLp26um5JriwA
@baz-reviewer

baz-reviewer Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Review this PR on Baz

Baz Summary

Replace the runtime execa and Bluebird stack with native child_process.spawn and Promises while preserving Git output, error fields, retries, and process cleanup. Release @currents/commit-info 3.0.0 with only debug at runtime, update supported Node versions and documentation, and migrate the test suite to Vitest.

Topics

TopicDetails
Git execution API Replace execa with spawnGit to execute Git without a shell, retain compatible errors and output limits, clean up child processes on exit, and return native Promises as the commitInfo and Git APIs collect repository data.
Modified files (7)
  • CHANGELOG.md
  • README.md
  • src/git-api-spec.js
  • src/git-api.js
  • src/index.js
  • src/run-git-spec.js
  • src/run-git.js
Latest Contributors(2)
UserCommitDate
agoldis@gmail.comtest: run the tests wi...November 04, 2026
emilyrohrbough@yahoo.comchore: update readme &...April 03, 2023
Release and testing Reduce production dependencies to debug, publish version 3.0.0, migrate tests from Mocha to Vitest with updated snapshots and spies, and test supported Node.js 22 and 24 environments.
Modified files (15)
  • .github/workflows/main.yml
  • .github/workflows/pull-request.yml
  • __snapshots__/git-api-spec.js
  • package-lock.json
  • package.json
  • src/__snapshots__/commit-info-spec.js.snap
  • src/__snapshots__/git-api-spec.js.snap
  • src/ci-spec.js
  • src/commit-info-repos-spec.js
  • src/commit-info-spec.js
  • src/pull-request-head-spec.js
  • src/remove-credentials-spec.js
  • src/utils-e2e.js
  • src/utils-spec.js
  • vitest.config.mjs
Latest Contributors(2)
UserCommitDate
agoldis@gmail.comtest: run the tests wi...November 04, 2026
miguelangarano@gmail.comchore(ci): remove logJanuary 05, 2024

Merger   ✅ Ready to Merge

No discussion blockers are present, CI ran successfully, and the diff implements the stated runtime dependency and native Promise changes.



Skills  Activate Skill Maintainer to keep your skills up to date

Planner  This PR would have been improved with Baz Planner - Try it now

baz-app[bot]
baz-app Bot previously approved these changes Nov 4, 2026
- vitest 4.1.12 replaces mocha 6; `npm run unit` and `npm run gha-e2e`
  run the vitest projects "unit" and "e2e"
- vitest snapshots in src/__snapshots__ replace snap-shot-it; the values
  are the same
- vi.spyOn replaces the sinon stub of fs.readFileSync
- the specs stay CommonJS and use the vitest globals
- test files run one at a time, as with mocha: the git fetches in
  pull-request-head.js time out after 3 s, which parallel files exceeded
- the "execGit output and errors" tests wait for git to exit after the
  maxBuffer error; mocha gave it time between tests, vitest does not

The lockfile only has packages published before 2026-10-20.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011baD3hSBFPLp26um5JriwA
@baz-app
baz-app Bot dismissed their stale review November 4, 2026 07:02

Baz withdrew its approval because this pull request is no longer ready to merge.

vite declares yaml ^2.4.2 as an optional peer dependency. The yaml at
the top of node_modules is 1.10.0, which another dev dependency uses. npm
11 accepts the lockfile without a yaml 2, but `npm ci` with npm 10, the
version that comes with Node.js 22, fails with "Missing: yaml@2.9.1 from
lock file". The lockfile now has yaml 2.9.1 under vitest, as npm 10
places it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011baD3hSBFPLp26um5JriwA
@agoldis
agoldis merged commit b8f3326 into master Nov 4, 2026
8 checks passed
@agoldis
agoldis deleted the agoldis/commit-info-3.0.0 branch November 4, 2026 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant