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

Simplify PerformReleaseMojo #145

Closed
wants to merge 1 commit into from
Closed

Conversation

michael-o
Copy link
Member

@kwin @nielsbasjes Have a look whether this makes sense to you. I am not 100% certain about this. It feels awkward that this mojo does not extend from AbstractScmReleaseMojo, but still from AbstractReleaseMojo since other release mojos do so. If this isn't right a comment should be added to the code explaning why.

This affects #133 and #134.

@michael-o
Copy link
Member Author

@slavino Have a look also.

@michael-o michael-o requested a review from kwin August 21, 2022 18:31
@michael-o
Copy link
Member Author

@kwin @nielsbasjes @slavino I need a review to continue with other open issues.

@nielsbasjes
Copy link
Contributor

I had a look at this code and I agree that there is indeed some duplication that can be simplified this way.
As the entire build pipeline passes I think the code change is good.
The only "effect" is that you reduce the code duplication (good) and the PerformReleaseMojo will have more config settings available than needed.

Comment on lines -182 to -191
if ( username != null )
{
releaseDescriptor.setScmUsername( username );
}

if ( password != null )
{
releaseDescriptor.setScmPassword( password );
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure this should be removed?
Now the releaseDescriptor no longer has these values.
There is no scenario when during the perform release the username/password are needed?
If there is no such scenario: Why do you keep the scm source url? I the ScmSourceUrl is needed then I would suspect the username and password are also needed in some cases.

Copy link
Member

Choose a reason for hiding this comment

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

This is IMHO already part of AbstractScmReleaseMojo.createReleaseDescriptor()

Copy link
Contributor

Choose a reason for hiding this comment

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

@kwin You are right.

@kwin
Copy link
Member

kwin commented Aug 22, 2022

I agree with @nielsbasjes that a lot more parameters are now exposed for goal perform which are not useful. Maybe the AbstractScmReleaseMojo would need a split up between AbstractScmReadReleaseMojo and AbstractScmWriteReleaseMojo (inheriting from the former).

@edwardUL99
Copy link

I agree with @nielsbasjes that a lot more parameters are now exposed for goal perform which are not useful. Maybe the AbstractScmReleaseMojo would need a split up between AbstractScmReadReleaseMojo and AbstractScmWriteReleaseMojo (inheriting from the former).

As part of #149, this change could possibly be introduced? Unless @michael-o wishes to do that

@nielsbasjes
Copy link
Contributor

I'm wondering what the real downside (if any) is of having some properties available that are not used. Apparently (as shown in #149) some of those are actually missing and should be made available.

@kwin
Copy link
Member

kwin commented Sep 12, 2022

For me the 2 phase release process is already complicated enough. Exposing unused parameters for the perform goal in its documentation (https://maven.apache.org/maven-release/maven-release-plugin/perform-mojo.html) will make it even harder to grasp what is going on. Also I expect a lot of wrong reports due to the unused (but documented) parameters.

Copy link
Member

@kwin kwin left a comment

Choose a reason for hiding this comment

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

Please separate reading from SCM (perform) and writing to SCM (prepare) into two separate abstract classes.

@michael-o
Copy link
Member Author

I agree with @nielsbasjes that a lot more parameters are now exposed for goal perform which are not useful. Maybe the AbstractScmReleaseMojo would need a split up between AbstractScmReadReleaseMojo and AbstractScmWriteReleaseMojo (inheriting from the former).

This totally makes sense.

@michael-o michael-o closed this Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants