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

Seems like --yes stopped working #485

Closed
5 tasks done
noherczeg opened this issue Feb 20, 2023 · 4 comments · Fixed by #486
Closed
5 tasks done

Seems like --yes stopped working #485

noherczeg opened this issue Feb 20, 2023 · 4 comments · Fixed by #486
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@noherczeg
Copy link

Describe the bug

We are using the --yes option for publishing tasks, which worked in 1.13. but seems to be ignored in 1.15.x.

CI Job:

> new-publish:ci
> lerna publish --yes

lerna-lite notice cli v1.15.1
lerna-lite info ci enabled
lerna-lite info current project version 0.8.21
lerna-lite info Assuming all packages changed
? Select a new version (currently 0.8.21) (Use arrow keys)
❯ Patch (0.8.22) 
  Minor (0.9.0) 
  Major (1.0.0) 
  Prepatch (0.8.22-alpha.0) 
  Preminor (0.9.0-alpha.0) 
  Premajor (1.0.0-alpha.0) 
  Custom Prerelease 
  Custom Version 
Error: Process completed with exit code 130.

Corresponding npm script:

"new-publish:ci": "lerna publish --yes",

Expectation

--yes should work

Reproduction

Run lerna publish --yes in a CI environment, e.g.: Github Actions

Lerna config and logs

lerna.json

{
  "$schema": "node_modules/@lerna-lite/cli/schemas/lerna-schema.json",
  "packages": [
    "packages/@pandino/*"
  ],
  "npmClient": "npm",
  "version": "0.8.21",
  "ignoreChanges": [
    "**/__fixtures__/**",
    "**/__tests__/**",
    "**/helpers/**",
    "**/*.md"
  ]
}

lerna-debug.log

<!-- If you have a `lerna-debug.log` available, please paste it here -->
<!-- Otherwise, feel free to delete this <details> block -->

Environment Info

lerna-lite version:

"@lerna-lite/cli": "^1.15.1",
"@lerna-lite/run": "^1.15.1",

Used Package Manager

npm

Validations

@noherczeg
Copy link
Author

Found out that the command.version section in lerna.json is mandatory for --yes to work. This should either be fixed, or at least highlighted in the docs.

@ghiscoding
Copy link
Member

ghiscoding commented Feb 20, 2023

if you know how to fix then please submit a PR, because the option you describe comes from the original code and I didn't change its behavior. If you really think it stopped working then we need to pinpoint exactly which version and which commit caused the issue. Have you looked at your lerna error log? It's not very clear what error 130 which by the way is the real cause of your issue (--yes is not ignored, your problem is that you got an exit error)

@ghiscoding
Copy link
Member

ghiscoding commented Feb 20, 2023

Found out that the command.version section in lerna.json is mandatory for --yes to work. This should either be fixed, or at least highlighted in the docs.

There's maybe PR #431 that I replicated from Lerna recently, but you would have probably seen the error thrown and it's hard to confirm unless you look at your lerna-debug.log

you can maybe try in --dry-run mode to see if the error comes back, it could be helpful to troubleshoot the problem. lerna publish --yes --dry-run

ghiscoding added a commit that referenced this issue Feb 20, 2023
- highlight the fact that `version` is a required property to exist in the `lerna.json` config
- closes #485
@ghiscoding
Copy link
Member

ghiscoding commented Feb 20, 2023

I tried it locally and you're most certainly facing the new error thrown in PR #431 with the following error

image

I updated the error message and also highlighted the need for the version property, it should be more helpful with the following error message

image

Basically, the version was always a required config property but it wasn't as much highlighted before PR #431. Missing a version property could cause problems which is why it is now a required config property. I updated some of the README to better highlight this new requirement. In any case, you should have seen the error in your lerna-debug.log, also as described earlier, you can use --dry-run mode to test a version before releasing it (which is what I used to troubleshoot the error)

ghiscoding added a commit that referenced this issue Feb 20, 2023
- highlight the fact that `version` is a required property to exist in the `lerna.json` config
- closes #485
@ghiscoding ghiscoding added documentation Improvements or additions to documentation enhancement New feature or request and removed need more info PR Welcome labels Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants