auto: Release fails with `Error: fatal: ' 9007199254740991': not an integer`

Describe the bug

As of today, but not last Friday (2/16), our canary (PR) releases are failing on the shipit command, with the following error:

Error: fatal: ' 9007199254740991': not an integer

More detailed output using -vv option:

ℹ  info      Using command: 'shipit'
d8bc8a1c58153a82f743f9374e6233f8d24eed64
ℹ  info      Getting commits from HEAD^ to HEAD
7ec96633f5ae531094d20d2d2452924354eabc40
d8bc8a1c58153a82f743f9374e6233f8d24eed64
d8bc8a1c58153a82f743f9374e6233f8d24eed64
Error: fatal: ' 9007199254740991': not an integer
    at /home/runner/work/Storybook-Components/Storybook-Components/node_modules/gitlog/src/index.ts:384:13
    at ChildProcess.exithandler (node:child_process:430:5)
    at ChildProcess.emit (node:events:517:28)
    at ChildProcess.emit (node:domain:489:12)
    at maybeClose (node:internal/child_process:1098:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:303:5)
TypeError: error.match is not a function
    at Git.getGitLog (/home/runner/work/Storybook-Components/Storybook-Components/node_modules/@auto-it/core/src/git.ts:406:25)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Release.getCommits (/home/runner/work/Storybook-Components/Storybook-Components/node_modules/@auto-it/core/src/release.ts:284:20)
    at async Release.getCommitsInRelease (/home/runner/work/Storybook-Components/Storybook-Components/node_modules/@auto-it/core/src/release.ts:119:24)
    at async Auto.shipit (/home/runner/work/Storybook-Components/Storybook-Components/node_modules/@auto-it/core/src/auto.ts:1604:18)
    at async execute (/home/runner/work/Storybook-Components/Storybook-Components/node_modules/auto/src/run.ts:88:9)
    at async Object.runCli (/home/runner/work/Storybook-Components/Storybook-Components/node_modules/auto/src/run.ts:146:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 1.

To Reproduce

Run auto shipit

Expected behavior

Expected that the release finishes successfully, which was working as of last Friday (2/16).

Screenshots

Environment information:

Running npx auto info gives me an error saying environment variables are missing. I think they are only set in the build process, not locally.

PS C:\Dev\Alterra\Storybook-Components> npx auto info
‼  warning   protected-branch: No "PROTECTED_BRANCH_REVIEWER_TOKEN" found in environment
×  error     No GitHub was found. Make sure it is available on process.env.GH_TOKEN.
Error: GitHub token not found!
    at Auto.loadConfig (C:\Dev\Alterra\Storybook-Components\node_modules\@auto-it\core\src\auto.ts:657:13)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async execute (C:\Dev\Alterra\Storybook-Components\node_modules\auto\src\run.ts:36:5)
    at async Object.runCli (C:\Dev\Alterra\Storybook-Components\node_modules\auto\src\run.ts:146:3)

However, the build does show the following information:

Environment Information:
"auto" version: v10.46.0
"git"  version: v2.43.2
"node" version: v18.19.1
Project Information:
✔ Repository:      Alterra-Mountain-Company/Storybook-Components (​[https://github.com/Alterra-Mountain-Company/Storybook-Components​)](https://github.com/Alterra-Mountain-Company/Storybook-Components%E2%80%8B))
✔ Author Name:     Alterra Mountain Company
✔ Author Email:    shubert@alterramtnco.com
✔ Current Version: v18.4.7
✔ Latest Release:  v18.4.7 (​[https://github.com/Alterra-Mountain-Company/Storybook-Components/releases/tag/v18.4.7​)](https://github.com/Alterra-Mountain-Company/Storybook-Components/releases/tag/v18.4.7%E2%80%8B))
✖ Labels configured on GitHub project (Try running "auto create-labels")
GitHub Token Information:
✔ Token:            [Token starting with ghp_]
✔ Repo Permission:  write
✔ User:             resortinfra-alterra
✔ API:              undefined (​undefined​)
✔ Enabled Scopes:   repo, workflow
✔ Rate Limit:       4996/5000

Additional context

9007199254740991 is the value of Number.MAX_SAFE_INTEGER, which I noticed is referenced in the getGitLog method of @auto-it/core/dist/git.js. I am just not sure why, or where, Auto is converting it to a string.

About this issue

  • Original URL
  • State: closed
  • Created 4 months ago
  • Reactions: 23
  • Comments: 21 (9 by maintainers)

Commits related to this issue

Most upvoted comments

We’re getting the fix out!

PR opened : #2426

If anyone is running into this on Github Actions ubuntu runner, I have the worst temporary workaround ever:

- name: Install specific git version
  run: |
    sudo apt-get update
    sudo add-apt-repository ppa:git-core/ppa 
    sudo apt install git=1:2.34.1-1ubuntu1.10 git-man=1:2.34.1-1ubuntu1.10 -y --allow-downgrades

don’t judge me, it works.

11.0.5 fixes the issue for me. Thank you for the quick turnaround!

@ecstaticrainbow here

index a28a5eb2565d237bd0eff65e6222511287424b5a..464a642e71538ed8e79291b41bae821512eaa950 100644
--- a/dist/git.js
+++ b/dist/git.js
@@ -240,9 +240,11 @@ class Git {
             const startSha = (await this.shaExists(start))
                 ? await exec_promise_1.default("git", ["rev-parse", start])
                 : "";
+            const maxNumber = 2147483647;
             const log = await gitlog_1.gitlogPromise({
                 repo: process.cwd(),
-                number: Number.MAX_SAFE_INTEGER,
+                number: maxNumber,
                 fields: ["hash", "authorName", "authorEmail", "rawBody"],
                 // If start === firstCommit then we want to include that commit in the changelog
                 // Otherwise it was that last release and should not be included in the release.

If any contributors want to help maintain auto I’m open to the idea! auto def hasn’t been on my mind since moving to a more product focused role but I still use the project outside work a lot. I’ve now moved back to a platform team so I’ll be more active.

(If anyone want to just that platform team we’re hiring descript.com)

This will fail once that version of git is not published in the git-core ppa anymore

Yup, very excited for that 😄

Git v2.43.2 seems to be the issue, v2.42.0 still works:

> git log -n 9007199254740991
fatal: '9007199254740991': not an integer