Re: Conventional Commits with the maven-release-plugin

2022-02-16 Thread Niels Basjes
Yes ofcourse.

I have created the appropriate tickets and pull requests:

https://issues.apache.org/jira/browse/SCM-977
https://github.com/apache/maven-scm/pull/135

and

https://issues.apache.org/jira/browse/MRELEASE-1078
https://github.com/apache/maven-release/pull/104

This second pull request still has some rough edges:
- The config is not as clean as I would have liked it to be. I would have
liked to extend the XML schema for the configuration but because this is
really a plugin for a maven plugin I have not yet been able to figure out
how to do this.
- Some of the IT tests fail at this point.
- I would like to provide documentation for the web site.

The custom config allows you to have
- a custom format of the SCM tag and the system can still find and parse it.
- a custom set of patterns to look for in the commit messages to determine
if a patch/minor/major update is needed. The default rules assume the tag
to be just the version (i.e. "1.2.3") and the patterns to follow my
understanding of https://www.conventionalcommits.org/en/v1.0.0/

A "full" example (copied from the IT test I created):


  org.apache.maven.plugins
  maven-release-plugin
  @project.version@
  
true
true

false
false

ci(Release): 
ci(Release): Version
@{releaseLabel}
v@{project.version}
CCSemVerVersionPolicy










  


  
  

  org.apache.maven.its.release
  maven-scm-provider-dummy
  1.0


  org.apache.maven.release
  maven-release-ccsemver-policy
  @project.version@

  






I'm looking forward to your feedback.

Niels

On Tue, Feb 15, 2022 at 10:00 PM Olivier Lamy  wrote:

> sounds an interesting idea.
> would you mind having this as PRs to ease code review?
>
> On Tue, 15 Feb 2022 at 03:00, Niels Basjes  wrote:
>
> > Hi,
> >
> > I would like to use the ideas from the Conventional Commits to
> > automatically determine the next version for my release when releasing
> with
> > the maven-release-plugin.
> >
> > Since this is not yet a part of the current version of the release
> plugin I
> > decided to give it a go myself.
> >
> > So far I have succeeded in creating a new VersionPolicy that does this
> and
> > I'm wondering if the committers would consider including this idea or
> not.
> > I expect my code will need some more cleanups and changes on my end
> before
> > it can be included.
> >
> > Summary of what I had to change to make this work:
> > In maven-scm (
> > https://github.com/nielsbasjes/maven-scm/tree/SCM-xxx-ChangelogTags )
> > - I had to add the functionality that a ChangeSet could contain the tags
> > present on the commits as well.
> >   It is generic and I've added this functionality for gitexe and jgit.
> >   For gitexe I had to change the command used by the changelog command to
> > get the tags.
> >
> > In maven-release (
> > https://github.com/nielsbasjes/maven-release/tree/MRELEASE-xxx-CCSEMVER
> )
> > - I extended the VersionPolicyRequest to include the connection to the
> SCM
> > and a config parameter (right now a String) to configure the patterns to
> > look for in the pom.xml of the project that is to be released.
> > - I created a new VersionPolicy that examines the tags and commit
> messages
> > and from this computes if a patch, minor or major version update is
> needed.
> >
> > To check it actually works I created a dummy test project that has this
> > plugin:
> > https://github.com/nielsbasjes/releasetester/blob/main/pom.xml#L94
> >
> > So simply put: Should I file two jira tickets and put up the pull
> requests
> > so you can review my ideas ?
> >
> > --
> > Best regards / Met vriendelijke groeten,
> >
> > Niels Basjes
> >
>


-- 
Best regards / Met vriendelijke groeten,

Niels Basjes


Re: Conventional Commits with the maven-release-plugin

2022-02-15 Thread Olivier Lamy
sounds an interesting idea.
would you mind having this as PRs to ease code review?

On Tue, 15 Feb 2022 at 03:00, Niels Basjes  wrote:

> Hi,
>
> I would like to use the ideas from the Conventional Commits to
> automatically determine the next version for my release when releasing with
> the maven-release-plugin.
>
> Since this is not yet a part of the current version of the release plugin I
> decided to give it a go myself.
>
> So far I have succeeded in creating a new VersionPolicy that does this and
> I'm wondering if the committers would consider including this idea or not.
> I expect my code will need some more cleanups and changes on my end before
> it can be included.
>
> Summary of what I had to change to make this work:
> In maven-scm (
> https://github.com/nielsbasjes/maven-scm/tree/SCM-xxx-ChangelogTags )
> - I had to add the functionality that a ChangeSet could contain the tags
> present on the commits as well.
>   It is generic and I've added this functionality for gitexe and jgit.
>   For gitexe I had to change the command used by the changelog command to
> get the tags.
>
> In maven-release (
> https://github.com/nielsbasjes/maven-release/tree/MRELEASE-xxx-CCSEMVER )
> - I extended the VersionPolicyRequest to include the connection to the SCM
> and a config parameter (right now a String) to configure the patterns to
> look for in the pom.xml of the project that is to be released.
> - I created a new VersionPolicy that examines the tags and commit messages
> and from this computes if a patch, minor or major version update is needed.
>
> To check it actually works I created a dummy test project that has this
> plugin:
> https://github.com/nielsbasjes/releasetester/blob/main/pom.xml#L94
>
> So simply put: Should I file two jira tickets and put up the pull requests
> so you can review my ideas ?
>
> --
> Best regards / Met vriendelijke groeten,
>
> Niels Basjes
>


Conventional Commits with the maven-release-plugin

2022-02-14 Thread Niels Basjes
Hi,

I would like to use the ideas from the Conventional Commits to
automatically determine the next version for my release when releasing with
the maven-release-plugin.

Since this is not yet a part of the current version of the release plugin I
decided to give it a go myself.

So far I have succeeded in creating a new VersionPolicy that does this and
I'm wondering if the committers would consider including this idea or not.
I expect my code will need some more cleanups and changes on my end before
it can be included.

Summary of what I had to change to make this work:
In maven-scm (
https://github.com/nielsbasjes/maven-scm/tree/SCM-xxx-ChangelogTags )
- I had to add the functionality that a ChangeSet could contain the tags
present on the commits as well.
  It is generic and I've added this functionality for gitexe and jgit.
  For gitexe I had to change the command used by the changelog command to
get the tags.

In maven-release (
https://github.com/nielsbasjes/maven-release/tree/MRELEASE-xxx-CCSEMVER )
- I extended the VersionPolicyRequest to include the connection to the SCM
and a config parameter (right now a String) to configure the patterns to
look for in the pom.xml of the project that is to be released.
- I created a new VersionPolicy that examines the tags and commit messages
and from this computes if a patch, minor or major version update is needed.

To check it actually works I created a dummy test project that has this
plugin:  https://github.com/nielsbasjes/releasetester/blob/main/pom.xml#L94

So simply put: Should I file two jira tickets and put up the pull requests
so you can review my ideas ?

-- 
Best regards / Met vriendelijke groeten,

Niels Basjes