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

yargs update in semantic-release 19.0.4 is broken #2533

Closed
mscharley opened this issue Aug 23, 2022 · 10 comments · Fixed by #2534
Closed

yargs update in semantic-release 19.0.4 is broken #2533

mscharley opened this issue Aug 23, 2022 · 10 comments · Fixed by #2534
Labels

Comments

@mscharley
Copy link

Current behavior

Semantic release crashes without parsing arguments correctly.

Expected behavior

Run a release.

semantic-release version

19.0.4

CI environment

CircleCI

Plugins used

No response

semantic-release configuration

{
  "branches": ["main"],
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "@semantic-release/npm",
    "@semantic-release/github"
  ]
}

CI logs

$ semantic-release

Run automated package publishing

Usage:
semantic-release [options] [plugins]

Options
  -b, --branches        Git branches to release from                     [array]
  -r, --repository-url  Git repository URL                              [string]
  -t, --tag-format      Git tag format                                  [string]
  -p, --plugins         Plugins                                          [array]
  -e, --extends         Shareable configurations                         [array]
      --ci              Toggle CI verifications                        [boolean]
      --debug           Output debugging information                   [boolean]
  -d, --dry-run         Skip publishing                                [boolean]
  -h, --help            Show help                                      [boolean]
  -v, --version         Show version number                            [boolean]

Plugins
      --verify-conditions                                                [array]
      --analyze-commits                                                 [string]
      --verify-release                                                   [array]
      --generate-notes                                                   [array]
      --prepare                                                          [array]
      --publish                                                          [array]
      --success                                                          [array]
      --fail                                                             [array]

Cannot read properties of undefined (reading 'length')
(node:532) Warning: "version" is a reserved word.
Please do one of the following:
- Disable version with `yargs.version(false)` if using "version" as an option
- Use the built-in `yargs.version` method instead (if applicable)
- Use a different option key
https://yargs.js.org/docs/#api-reference-version
(Use `node --trace-warnings ...` to show where the warning was created)

Exited with code exit status 1
@Th3S4mur41
Copy link

Th3S4mur41 commented Aug 23, 2022

@Kampfmoehre
Copy link

Having the same issue since dependabot updated from 19.0.3 to 19.0.4, example action that failed: https://github.com/droidsolutions/semantic-release-nuget/runs/7970368200?check_suite_focus=true
On the other repo it runs without problems though:
https://github.com/droidsolutions/semantic-release-update-file/runs/7970326101?check_suite_focus=true

@github-actions
Copy link

🎉 This issue has been resolved in version 19.0.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@travi
Copy link
Member

travi commented Aug 23, 2022

Thank you for the reports and apologies for the problems. We'll have to investigate why our test suite did not catch the problem. Do any of you think you have anything unique about your release process that might be different from standard semantic-release usage in case the problem is not universal?

I've reverted the yargs upgrade in #2534, which resulted in publishing 19.0.5

@Kampfmoehre
Copy link

I don't think I'm using anything special, just npx semantic-release with default config extended by GitHub plugin and slightly modified branches config.

@mscharley
Copy link
Author

We're definitely not doing anything unusual either, my entire configuration is exactly as above, we're just swapping to use the main branch and a pretty standard set of basic plugins.

@travi
Copy link
Member

travi commented Aug 24, 2022

interestingly, i have found that some of my projects had successful releases with v19.0.4, including but not limited to (i have not seen evidence of failure across my projects):

these projects also simply use npx semantic-release from github actions and have no custom config. i'm curious what might be different that resulted in problems from multiple folks but not in a manner that it consistently fails in all cases.

@mscharley
Copy link
Author

The one variation I can find in my setup is that we us an npm script: npm run semantic-release where the npm script is just:

{
  "scripts": {
    "semantic-release": "semantic-release"
  }
}

Other than that, the configuration is in .releaserc with contents as per the original ticket.

@mscharley
Copy link
Author

The only other thing I can think of is that this is an ESM project with "type": "module" in my package.json. It feels irrelevant, but depending on what you're doing for eg. loading from package.json, then maybe not.

@Th3S4mur41
Copy link

Th3S4mur41 commented Aug 24, 2022

Maybe this could help. Those are very similar repository with identical release config and almost identical package.json. One failed while this other one was successful with just a warning:

(node:[17](https://github.com/ATOS-Actions/download-release-artifact/runs/7962445399?check_suite_focus=true#step:5:18)10) Warning: "version" is a reserved word.
Please do one of the following:
- Disable version with `yargs.version(false)` if using "version" as an option
- Use the built-in `yargs.version` method instead (if applicable)
- Use a different option key

Relevant difference was probably the node version.
In the failed case used node 16.16.0 / npm 8.11.0.
The successful one used node 16.17.0 / npm 8.15.0

Failed: https://github.com/ATOS-Actions/actions/runs/7962473374?check_suite_focus=true
Successs: https://github.com/ATOS-Actions/download-release-artifact/runs/7962445399?check_suite_focus=true

morey-tech pushed a commit to ratehub/semantic-release that referenced this issue Sep 12, 2022
adityahex27 pushed a commit to hextrust/semantic-release that referenced this issue Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants