Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeError: Invalid time value #1267

Closed
coin-op opened this issue May 6, 2024 · 9 comments
Closed

RangeError: Invalid time value #1267

coin-op opened this issue May 6, 2024 · 9 comments

Comments

@coin-op
Copy link

coin-op commented May 6, 2024

When running commit lint a range error occurs with an invalid time value.

Using node 20.12.2

[2:03:18 PM] [semantic-release] › ✘  An error occurred while running semantic-release: RangeError: Invalid time value
    at committerDate (/home/vsts/work/1/s/node_modules/conventional-changelog-writer/index.js:80:30)
    at /home/vsts/work/1/s/node_modules/conventional-changelog-writer/lib/util.js:202:17
    at Array.forEach (<anonymous>)
    at processCommit (/home/vsts/work/1/s/node_modules/conventional-changelog-writer/lib/util.js:198:31)
    at /home/vsts/work/1/s/node_modules/conventional-changelog-writer/index.js:123:32 {
  pluginName: '@semantic-release/release-notes-generator'
}
RangeError: Invalid time value
    at committerDate (/home/vsts/work/1/s/node_modules/conventional-changelog-writer/index.js:80:30)
    at /home/vsts/work/1/s/node_modules/conventional-changelog-writer/lib/util.js:202:17
    at Array.forEach (<anonymous>)
    at processCommit (/home/vsts/work/1/s/node_modules/conventional-changelog-writer/lib/util.js:198:31)
    at /home/vsts/work/1/s/node_modules/conventional-changelog-writer/index.js:123:32 {
  pluginName: '@semantic-release/release-notes-generator'
}

Configuration

 {
                "plugins": [
                  [
                    "@semantic-release/commit-analyzer",
                    {
                        "preset": "conventionalcommits"
                    }
                  ],
                  [
                    "@semantic-release/release-notes-generator",
                    {
                      "preset": "conventionalcommits",
                      "presetConfig": {
                        "compareUrlFormat": "{{host}}/{{owner}}/{{repository}}/branchCompare?baseVersion=GT{{previousTag}}&targetVersion=GT{{currentTag}}&_a=commits"
                      }
                    }
                  ],
                  "@semantic-release/changelog",
                  [
                    "@semantic-release/exec",
                    {
                      "publishCmd": "git tag -a -f \${nextRelease.gitTag} -m '\${nextRelease.gitTag}\n\n See Wiki for more details'; git push --force origin \${nextRelease.gitTag}",
                      "successCmd": "echo \"\${nextRelease.gitTag}\" >> releaseVersion.txt; echo \"\${nextRelease.notes}\" >> releaseNotes.txt;"
                    }
                  ],
                  [
                    "@semantic-release/git",
                    {
                      "assets": ${{  convertToJson(parameters.ChoreCommitFileList)  }},
                      "message": "chore(release): \${nextRelease.version} [skip ci]\n\\n\${nextRelease.notes}"
                    }
                  ]
                ]
              }
@Falcowoski
Copy link

I have the same issue today and i needed to downgrade the package version from 8 to 7 😢

@dangreen
Copy link
Member

dangreen commented May 6, 2024

@coin-op @Falcowoski Hi guys. I'm sorry. It would be great if you can provide repo with minimal reproduction. Or you can fork this repo and create test file with reproduction.

@icco
Copy link

icco commented May 6, 2024

We're also seeing this, but not sure what's causing it.

@coin-op
Copy link
Author

coin-op commented May 7, 2024

@coin-op @Falcowoski Hi guys. I'm sorry. It would be great if you can provide repo with minimal reproduction. Or you can fork this repo and create test file with reproduction.

Hi @dangreen this fails when running npm run release locally https://github.com/coin-op/commitlint-test

Though this does look like an issue with semantic-release

semantic-release/release-notes-generator#633

@dangreen
Copy link
Member

dangreen commented May 7, 2024

@coin-op

commitlint-test(main)$ npm run release          

> commitlint-test@1.0.0 release
> semantic-release

[18:49:08] [semantic-release] › ℹ  Running semantic-release version 23.0.8
[18:49:08] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/changelog"
[18:49:08] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/exec"
[18:49:08] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/git"
[18:49:08] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
[18:49:08] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/exec"
[18:49:08] [semantic-release] › ✔  Loaded plugin "verifyRelease" from "@semantic-release/exec"
[18:49:08] [semantic-release] › ✔  Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
[18:49:08] [semantic-release] › ✔  Loaded plugin "generateNotes" from "@semantic-release/exec"
[18:49:08] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/changelog"
[18:49:08] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/exec"
[18:49:08] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/git"
[18:49:08] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/exec"
[18:49:08] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/exec"
[18:49:08] [semantic-release] › ✔  Loaded plugin "success" from "@semantic-release/exec"
[18:49:08] [semantic-release] › ✔  Loaded plugin "fail" from "@semantic-release/exec"
[18:49:08] [semantic-release] › ⚠  This run was not triggered in a known CI environment, running in dry-run mode.
[18:49:16] [semantic-release] › ⚠  Run automated release from branch main on repository git@github.com:coin-op/commitlint-test.git in dry-run mode
[18:49:20] [semantic-release] › ✘  The command "git push --dry-run --no-verify git@github.com:coin-op/commitlint-test.git HEAD:main" failed with the error message ERROR: Permission to coin-op/commitlint-test.git denied to dangreen.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists..
[18:49:20] [semantic-release] › ⚠  Skip step "fail" of plugin "@semantic-release/exec" in dry-run mode
[18:49:20] [semantic-release] › ✘  EGITNOPERMISSION Cannot push to the Git repository.
semantic-release cannot push the version tag to the branch main on the remote Git repository with URL git@github.com:coin-op/commitlint-test.git.

This can be caused by:

    * a misconfiguration of the repositoryUrl option
    * the repository being unavailable
    * or missing push permission for the user configured via the Git credentials on your CI environment

SemanticReleaseError: Cannot push to the Git repository.
    at default (file:///Users/dangreen/github/commitlint-test/node_modules/semantic-release/lib/get-error.js:6:10)
    at run (file:///Users/dangreen/github/commitlint-test/node_modules/semantic-release/index.js:101:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Module.default (file:///Users/dangreen/github/commitlint-test/node_modules/semantic-release/index.js:278:22)
    at async default (file:///Users/dangreen/github/commitlint-test/node_modules/semantic-release/cli.js:55:5) {
  code: 'EGITNOPERMISSION',
  details: '**semantic-release** cannot push the version tag to the branch `main` on the remote Git repository with URL `git@github.com:coin-op/commitlint-test.git`.\n' +
    '\n' +
    'This can be caused by:\n' +
    ' - a misconfiguration of the [repositoryUrl](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#repositoryurl) option\n' +
    ' - the repository being unavailable\n' +
    ' - or missing push permission for the user configured via the [Git credentials on your CI environment](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/ci-configuration.md#authentication)',
  semanticRelease: true
}%                                                                                          

@dangreen
Copy link
Member

dangreen commented May 7, 2024

As I see semantic-release uses old version of conventional-changelog-* packages. Latest version of conventional-changelog-conventionalcommits compatible only with latest conventional-changelog-* packages. So please ask semantic-release maintainers to update that packages.

@pksorensen
Copy link

@dangreen - Thanks for your efforts. I been over the code and tried to figure out what goes wrong, but we also hits this issue, commitdate is just {} when printing the commits (console.log edits in the code after npm install). Works on 7, but not 8.

I just install 'npm install conventional-changelog-conventionalcommits' and then 'npx semantic-release --dry-run --debug' and then it fails.

however works with 'npm install conventional-changelog-conventionalcommits@7.0.1'.

I am unsure what package you reference that is wrong in semantic release?

@dangreen
Copy link
Member

dangreen commented May 9, 2024

@pksorensen Hi. I don't know how semantic-release works, but I see that it depends on 4 conventional-changelog packages with previous major versions.

Also major updates of conventional-changelog presets contains breaking changes, so semantic-release should add support of it

@travi
Copy link

travi commented May 10, 2024

semantic-release maintainer here 👋🏼

we havent had a chance to work through the breaking changes with the latest release of conventional-changelog packages, but will release a version with support for latest versions once we've worked through those details.

in the meantime, our recommendation is always to pin the major version of the conventional-changelog packages that semantic-release users are installing alongside semantic-release when not using our default configuration. the problems that folks are facing occur when blindly installing latest versions of these alternate packages.

we are trying to consolidate conversations into semantic-release/release-notes-generator#633, so please comment there if you have additional thoughts beyond what has been shared in that conversation or would like to help us investigate the details around getting updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants