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

feat(version): add user-defined build metadata to bumped packages #2880

Merged

Conversation

rrhodes
Copy link
Contributor

@rrhodes rrhodes commented Apr 19, 2021

Description

Adding support for SemVer build metadata to Lerna version and publish commands.

  • New --build-metadata string option added to Lerna version and publish commands.
  • Build metadata validated against SemVer specification and applied to new versions.
  • Build metadata is applicable to both independent and fixed versioning.
  • Metadata functionality added to core/conventional-commits
  • Only case where --build-metadata is not permitted is when --canary is also used in publish command.

Motivation and Context

This resolves issue #2545, which myself and others have expressed an interest in.

How Has This Been Tested?

Unit and integration testing provided in this PR. Tests should cover all new and altered logic. If that's not the case, let me know and I will be happy to fix that.

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.

@rrhodes
Copy link
Contributor Author

rrhodes commented Apr 19, 2021

Any feedback on this PR would be fully appreciated - this is my first contribution to Lerna.

Travis CI check failed, but it appears it has failed recently on all branches - including main.

@rrhodes rrhodes changed the title Feature/2545 add build metadata to version and publish commands feat(version): add user-defined build metadata to bumped packages Apr 20, 2021
@rrhodes
Copy link
Contributor Author

rrhodes commented Apr 22, 2021

Hello @evocateur, you're the most recently active member of the Lerna team I've found reviewing PRs. May you advise me who would be best to review this?

@rrhodes rrhodes force-pushed the feature/2545-apply-build-metadata-to-packages branch from b48d6c3 to 72ea3b3 Compare June 20, 2021 10:07
@rrhodes
Copy link
Contributor Author

rrhodes commented Jun 23, 2021

Hello @evocateur, may I be granted approval to run the repo workflows, please? Any feedback on this PR would be appreciated.

@rrhodes
Copy link
Contributor Author

rrhodes commented Nov 7, 2021

Hey @gigabo, @hzoo, @xtuc, and @ndelangen, sorry to ping you all out the blue. I see you also belong to the Lerna org. This PR's been lingering for a while now - any feedback would be appreciated, please.

@rrhodes
Copy link
Contributor Author

rrhodes commented Dec 10, 2021

Hi Lerna org members (@evocateur, @gigabo, @hzoo, @xtuc, and @ndelangen), anyone available to review this PR, please? Or alternatively is there anyone else I should request reviews this?

@molivertsla
Copy link

molivertsla commented May 11, 2022

@evocateur, @gigabo, @hzoo, @xtuc, and @ndelangen - also interested if we could get eyes on this please. If not, steps forward to add this functionality. Thank you!

@rrhodes rrhodes force-pushed the feature/2545-apply-build-metadata-to-packages branch from 74961fd to de3c002 Compare September 25, 2022 11:55
@rrhodes
Copy link
Contributor Author

rrhodes commented Sep 25, 2022

Hi @jeffbcross, this PR was opened a while ago, before a change of ownership for the Lerna project. I've resolved recent conflicts against the main branch and would love feedback on this work if you may recommend any reviewers, please?

@JamesHenry
Copy link
Member

Hi @rrhodes thanks so much for your patience, I'm sorry it sat in limbo for so long.

Please could we do the following:

  • squash all the work so far down into a single commit and rebase against the latest main (at that point I will start reviewing)
  • add proper e2e coverage via the relatively new approach (in this repo that is) of publishing the real lerna CLI to a locally running npm registry. You can see plenty of prior art in the relevant e2e/version project and you can see full instructions on running e2e tests in CONTRIBUTING.md

@JamesHenry
Copy link
Member

Please let me know if you have any questions regarding the e2e stuff once you have read those instructions

@rrhodes
Copy link
Contributor Author

rrhodes commented Dec 13, 2022

Hi @JamesHenry, no trouble, thanks for reviewing this. I may struggle to look into this in the coming weeks - currently in the process of moving house as well as all the usual Christmas fun at this time of year - but I can let you know when I've had an opportunity to review further.

@rrhodes rrhodes marked this pull request as draft January 3, 2023 17:36
@rrhodes rrhodes force-pushed the feature/2545-apply-build-metadata-to-packages branch 2 times, most recently from f805042 to 89781bd Compare January 3, 2023 17:53
@rrhodes rrhodes marked this pull request as ready for review January 3, 2023 17:53
@rrhodes
Copy link
Contributor Author

rrhodes commented Jan 3, 2023

Hi @JamesHenry, new E2E tests for the build metadata functionality added now.

@JamesHenry
Copy link
Member

@rrhodes Thank you, this is a great (re)starting point now!

Initial issue in CI:

  • The format check is failing.

Broader refactoring point:

Please could you not create a new package - the lerna codebase (we inherited) already has so, so many small packages, and we are looking to dramatically reduce that over the coming months, so we don't we to add more debt to that work.

I think core/conventional-commits would be the best existing place to house this new build metadata logic and share it with the version command as it already depends on that package.

Many thanks again!

@rrhodes rrhodes force-pushed the feature/2545-apply-build-metadata-to-packages branch 2 times, most recently from 650d4fa to 361d221 Compare January 6, 2023 19:50
@rrhodes
Copy link
Contributor Author

rrhodes commented Jan 6, 2023

Hey @JamesHenry, I agree, there are a lot of packages and I think it's great there's plans to reduce these. I've revised my PR now with your recommendation in mind to use core/conventional-commits.

@rrhodes rrhodes force-pushed the feature/2545-apply-build-metadata-to-packages branch from 361d221 to 2d3d9fc Compare January 6, 2023 20:09
@JamesHenry JamesHenry force-pushed the feature/2545-apply-build-metadata-to-packages branch from 2d3d9fc to 7e86eee Compare March 2, 2023 17:42
@JamesHenry
Copy link
Member

Thanks again @rrhodes - sorry, we needed to get the major codebase refactor over the line before addressing this one.

To save you having to try and figure it all out I have gone ahead and applied the rebase for you.

Once this is green we can get this merged!

@JamesHenry JamesHenry merged commit 0b0e2a6 into lerna:main Mar 2, 2023
@rrhodes
Copy link
Contributor Author

rrhodes commented Mar 3, 2023

Awesome, thanks @JamesHenry for your review and help toward this, great to see it release. 🚀

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

Successfully merging this pull request may close these issues.

Add build-metadata to lerna version / publish
3 participants