Skip to content

feat(version, publish): Added support for --dry-run option - #3401

Closed
meteabduraman wants to merge 5 commits into
lerna:mainfrom
meteabduraman:feat/dry-runs
Closed

meteabduraman wants to merge 5 commits into
lerna:mainfrom
meteabduraman:feat/dry-runs

Conversation

@meteabduraman

Copy link
Copy Markdown

Added support for --dry-run option in lerna version and lerna publish.

Description

Declared a new --dry-run option of type boolean.
Whenever this option is used with one of the above commands (either version or publish), the confirmations (confirmVersions() and confirmPublish() functions) automatically get rejected and an info log with Auto-rejected. This is a dry-run. appears in the console.

Motivation and Context

Folkes that would like to use lerna in CIs would enjoy this change (I would).
It will be nice to have a pipeline step that would preview the versions to be changed and add some sort of manual validation to really make sure we're publishing the right versions (that's actually a use case I want to implement in one of the pipelines I work on).

There has been an ongoing discussion since 2016 regarding this feature but not any concrete action from someone.
Maybe this PR turns things around a bit 🤓

closes #51
and maybe also a step closer to address #1094

How Has This Been Tested?

Added 2 unit tests for each command. They passed.
Locally tested with a locally published lerna version.

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)
  • Chore (change that has absolutely no effect on users)

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.

@JamesHenry

Copy link
Copy Markdown
Member

Hi @meteabduraman thanks a lot for taking the time to submit this PR!

We already have something a lot more comprehensive in the works for --dry-run (including previews of your changes before you make them etc), so this PR is not something we can go forward with.

I spoke about the upcoming changes to version and publish with --dry-run at my talk at Nx Conf a couple of weeks ago including giving a sneak peek on one of my slides, but essentially - watch this space!

Many thanks again

@JamesHenry JamesHenry closed this Nov 2, 2022
@legobeat

legobeat commented Aug 28, 2023 •

Copy link
Copy Markdown

@JamesHenry I see that #51 had the Lerna v7 milestone added in Nov 2022. Lerna v7 got released June 2023. #3695 added a --dryRun flag but only for lerna init, not for publish.

Was there any progress here, and/or would it be open for a new take?

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.

[Feature] lerna --dryrun

3 participants