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

fix(publish): Ignore non-release tags when detecting from-git #1782

Merged
merged 1 commit into from
Nov 27, 2018

Conversation

haraldF
Copy link
Contributor

@haraldF haraldF commented Nov 15, 2018

Filter out tags that are not distribution tags generated by lerna when
running publish --from-git

Description

Our repository has an extra (unrelated) tag, and lerna fails with:

lerna notice cli v3.4.3
lerna info versioning independent
lerna info Verifying npm credentials
lerna http fetch GET 200 https://artifactory.in.here.com/artifactory/api/npm/verity-npm-sandbox/-/whoami 95ms
lerna ERR! TypeError: Cannot destructure property `pkg` of 'undefined' or 'null'.
lerna ERR!     at updates.map (/root/.npm/_npx/55/lib/node_modules/lerna/node_modules/@lerna/publish/index.js:219:43)
lerna ERR!     at Array.map (<anonymous>)
lerna ERR!     at chain.then.updates (/root/.npm/_npx/55/lib/node_modules/lerna/node_modules/@lerna/publish/index.js:219:39)
lerna ERR! lerna Cannot destructure property `pkg` of 'undefined' or 'null'.

reason is that taggedPackageNames contains an undefined value since no package matches the (unrelated) tag.

Motivation and Context

Fixes a crash in lerna

How Has This Been Tested?

Do a lerna version patch, then git tag foo, then try lerna publish from-git => crash.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link
Member

@evocateur evocateur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a test so we don't regress in the future.

Filter out tags that are not distribution tags generated by lerna when
running publish --from-git
@haraldF
Copy link
Contributor Author

haraldF commented Nov 25, 2018

@evocateur I've added a test.

@evocateur evocateur changed the title fix: Ignore non-distribution tags fix(publish): Ignore non-release tags when detecting from-git Nov 27, 2018
Copy link
Member

@evocateur evocateur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@lock
Copy link

lock bot commented Jan 26, 2019

This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants