danielflower / multi-module-maven-release-plugin

A maven release plugin that is fast, does not add extra commits, and works well with single or multiple modules
http://danielflower.github.io/multi-module-maven-release-plugin/index.html
MIT License
125 stars 64 forks source link

Introduced new configuration for generating released/all modules versions #112

Closed kobynet closed 2 years ago

kobynet commented 3 years ago

This PR adds a new configuration for generating reports of released/all modules, this is useful for CI/CD flows where for example we have mono-repo and we want to understand which versions were released, so we can update other things like helm charts or other tasks.

kobynet commented 3 years ago

@danielflower Can't add you as a reviewer (probably no permission). Please review when you find some time :)

danielflower commented 3 years ago

Hi, can you show examples of what the reports look like?

kobynet commented 3 years ago

You can look in the test how a FLAT text file looks like here https://github.com/danielflower/multi-module-maven-release-plugin/pull/112/files#diff-185ed865285a55ed2607594c7a0107fec38d19135f269d9e734145da130f4051R33

basically, it's line separated for each module, where each line is of the form module-name:module-version

kobynet commented 3 years ago

@danielflower any chance of getting this merged?

danielflower commented 3 years ago

Sure, but I wanted to see what the reports looked like first. I didn't see it that clearly from the PR, at least not the JSON one.

kobynet commented 3 years ago

The JSON format is of the form { "<moduleA>":"<ModuleA version>", "<moduleB>":"<ModuleB version>", ... }

The FLAT format is a simple text file of the form

<moduleA>:<moduleA version> <moduleB>:<moduleB version> ...

I found those 2 formats as the most basic common formats which are easy to read by a shell script, for example, anyone is welcome to add more formats.

danielflower commented 3 years ago

Ok, thanks. For the JSON version, my concern is that it's not very extensible. For example, if we wanted to add more meta-data about the build in the future (e.g. the tags added during the build, the start and end dates etc) we wouldn't be able to. A more verbose version would let you, e.g.

{
    "modules": [
        { "name": "module-1", "version": "1.0.0" },
        { "name": "module-2", "version": "2.1.0" }
    ]
}

...which may later become something like:

{
    "buildStartDate": "2021-05-22T15:17:43.969Z",
    "buildEndDate": "2021-05-22T15:18:41.315Z",
    "modules": [
        { "name": "module-1", "version": "1.0.0" },
        { "name": "module-2", "version": "2.1.3", "previousVersion": "2.1.2" }
    ]
}

And adding that extra stuff would not be a breaking change to users of the plugin. So, feel free to switch to the modules/name/version style above, or remove the JSON stuff and just get the plaintext version merged first, or propose something else.

kobynet commented 3 years ago

@danielflower I've changed the json format to a more generic format as your example suggested.

kobynet commented 3 years ago

@danielflower kind reminder :) Changed the format to the format you suggested.

kobynet commented 2 years ago

@danielflower Any chance reviewing this and get this merged ?

danielflower commented 2 years ago

Hi, I've released this in 3.5.11 but if you look at https://danielflower.github.io/multi-module-maven-release-plugin/release-mojo.html#versionreports it's not clear how to use this. I don't know if there is special things you can do to make this auto generated doc more descriptive, but if not could you add a section in src/site/markdown/usage.md.vm showing how to generate a JSON report?

kobynet commented 2 years ago

Done in https://github.com/danielflower/multi-module-maven-release-plugin/pull/124

danielflower commented 2 years ago

Looks good, thanks for that.

The goal doc: https://danielflower.github.io/multi-module-maven-release-plugin/release-mojo.html#versionreports

The usage: https://danielflower.github.io/multi-module-maven-release-plugin/usage.html#version-reports