Skip to content

Add dry run flag #121

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add dry run flag #121

wants to merge 1 commit into from

Conversation

mtivi
Copy link
Contributor

@mtivi mtivi commented Jan 23, 2022

Support dry run install. Intended to enable better CI/CD pipelines.

The releaser:next goal does not the release goals.

This PR will require:

  • A Test case
  • Documentation

Before doing the additional work, I'd like to know if this will be approved / merged.

Open to other options; e.g. branch filter to create tags & deploy.

@danielflower

@danielflower
Copy link
Owner

Hi, I think "dry run" is a bit misleading because it all this doesn't do is push the tags, right? A user may have a deploy step which would still be called by this, but may expect it not to be called in a "dry run".

There is an option already to not push tags: https://danielflower.github.io/multi-module-maven-release-plugin/release-mojo.html#pushTags

@mtivi
Copy link
Contributor Author

mtivi commented Feb 3, 2022

Hi, I think "dry run" is a bit misleading because it all this doesn't do is push the tags, right? A user may have a deploy step which would still be called by this, but may expect it not to be called in a "dry run".

There is an option already to not push tags: https://danielflower.github.io/multi-module-maven-release-plugin/release-mojo.html#pushTags

The intention was to prevent tags from being created at all. An alternative solution could be running tests, and non deploy goals from the next goal (vs simply printing what would be built).

My team's use of the plugin is creating multiple build profiles for main/ non-main branches. The non main branch doesn't push tags.

By creating, and not pushing tags, there is a risk of developers accidently pushing tags from their local machines later on.

@danielflower
Copy link
Owner

So it seems like this is another tag option? Maybe pushTags should be deprecated and a new property called tagAction or something with values NoTags, Create and CreateAndPush (the default).

@mtivi
Copy link
Contributor Author

mtivi commented Feb 3, 2022

Yeah that sounds a lot cleaner. When I get an opportunity, I'll give that a go.

It is not the two line change I was hoping for, but it does leave the plugin in a much cleaner state.

Perhaps something along the lines of

public enum TagOption {
  ...,
  NOOP(false,false);

  private final boolean createTags:
  private final boolean pushTags;

  public TagOption(boolean createTags, boolean pushTags){
      this.createTags = createTags;
      This.pushTags = pushTags;
   }
}

?

@paul-hammant
Copy link

I would think -Ddryrun would mean make no tags in Git and don't actually push to Nexus (etc). Ideally Nexus would also have a dry-run capability.

Output (ideally) would be "Nexus reports that it would have accepted G:A:V for publication were you to do this same command without -Ddryrun"

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.

3 participants