Create CLI applications to create minor branches#16
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new Micronaut/Picocli-based CLI tool (minor-branch-creator) intended to automate creation of the next Micronaut minor maintenance branch across repositories and optionally set it as the default branch.
Changes:
- Introduces a new CLI command that reads a platform
libs.versions.toml, derives the nextX.(Y+1).xbranch, creates it, and optionally updates the repo default branch (with--dry-runsupport). - Adds GitHub API client logic (refs, default branch updates, GitHub “contents” fetch for blob URLs) plus TOML parsing/version resolution.
- Adds tests for configuration binding and core CLI/branching behavior.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| minor-branch-creator/src/main/java/minor/branch/creator/MinorBranchCreatorCommand.java | Implements the CLI command, branching logic, GitHub API client, URL parsing, and TOML/version parsing helpers. |
| minor-branch-creator/src/main/java/minor/branch/creator/GitHubOrgConfiguration.java | Adds configuration binding for githuborg.repos with quote-stripping/sanitization. |
| minor-branch-creator/src/main/resources/application.properties | Provides default configured repository list for batch operation. |
| minor-branch-creator/src/main/resources/logback.xml | Configures console logging for the CLI. |
| minor-branch-creator/src/test/java/minor/branch/creator/MinorBranchCreatorCommandTest.java | Adds unit tests covering CLI execution paths, dry-run behavior, URL parsing, and TOML parsing. |
| minor-branch-creator/src/test/java/minor/branch/creator/GitHubOrgConfigurationTest.java | Adds Micronaut test validating repository configuration is loaded. |
| minor-branch-creator/build.gradle.kts | Defines Gradle build, dependencies, Java compatibility, and Dockerfile base image settings. |
| minor-branch-creator/settings.gradle.kts | Declares the Gradle project name. |
| minor-branch-creator/gradle.properties | Pins the Micronaut version used by the module. |
| minor-branch-creator/gradle/wrapper/gradle-wrapper.properties | Adds Gradle wrapper distribution configuration for the module. |
| minor-branch-creator/gradlew | Adds Gradle wrapper startup script (POSIX). |
| minor-branch-creator/gradlew.bat | Adds Gradle wrapper startup script (Windows). |
| minor-branch-creator/micronaut-cli.yml | Micronaut CLI scaffold metadata for the module. |
| minor-branch-creator/README.md | Adds usage documentation (currently includes template Micronaut docs content). |
| minor-branch-creator/.gitignore | Adds module-local ignore rules. |
Comments suppressed due to low confidence (1)
minor-branch-creator/src/main/resources/application.properties:72
githuborg.reposincludes multiple duplicates in the tail of the list (e.g.,micronaut-data,micronaut-security,micronaut-graphql,micronaut-spring,micronaut-kafka,micronaut-openapi). This will cause the CLI to process the same repo multiple times in one run. Please remove duplicates (or ensure the command de-duplicates configured repos before iterating).
githuborg.repos[63]='micronaut-test-resources'
githuborg.repos[64]='micronaut-control-panel'
githuborg.repos[65]='micronaut-data'
githuborg.repos[66]='micronaut-security'
githuborg.repos[67]='micronaut-graphql'
githuborg.repos[68]='micronaut-spring'
githuborg.repos[69]='micronaut-kafka'
githuborg.repos[70]='micronaut-openapi'
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| githuborg.repos[43]='micronaut-mqtt' | ||
| githuborg.repos[44]='micronaut-nats' | ||
| githuborg.repos[45]='micronaut-pulsar' | ||
| githuborg.repos[46]='micronaut-rabbitmq' | ||
| githuborg.repos[47]='micronaut-acme' |
| githuborg.repos[0]=micronaut-elasticsearch' | ||
| githuborg.repos[1]=micronaut-jmx' | ||
| githuborg.repos[2]=micronaut-micrometer' | ||
| githuborg.repos[3]='micronaut-opensearch' | ||
| githuborg.repos[4]='micronaut-graphql' | ||
| githuborg.repos[5]='micronaut-grpc' | ||
| githuborg.repos[6]='micronaut-guice' | ||
| githuborg.repos[7]='micronaut-jackson-xml' | ||
| githuborg.repos[8]='micronaut-jaxrs' | ||
| githuborg.repos[9]='micronaut-json-schema' | ||
| githuborg.repos[10]='micronaut-openapi' | ||
| githuborg.repos[11]='micronaut-serialization' | ||
| githuborg.repos[12]='micronaut-servlet' | ||
| githuborg.repos[13]='micronaut-spring' | ||
| githuborg.repos[14]='micronaut-aot' | ||
| githuborg.repos[15]='micronaut-sourcegen' | ||
| githuborg.repos[16]='micronaut-openrewrite' | ||
| githuborg.repos[17]='micronaut-aws' | ||
| githuborg.repos[18]='micronaut-azure' | ||
| githuborg.repos[19]='micronaut-object-storage' | ||
| githuborg.repos[20]='micronaut-discovery-client' | ||
| githuborg.repos[21]='micronaut-gcp' | ||
| githuborg.repos[22]='micronaut-kubernetes' | ||
| githuborg.repos[23]='micronaut-oracle-cloud' | ||
| githuborg.repos[24]='micronaut-pulsar' | ||
| githuborg.repos[25]='micronaut-tracing' | ||
| githuborg.repos[26]='micronaut-toml' | ||
| githuborg.repos[27]='micronaut-logging' | ||
| githuborg.repos[28]='micronaut-data' | ||
| githuborg.repos[29]='micronaut-cassandra' | ||
| githuborg.repos[30]='micronaut-coherence' | ||
| githuborg.repos[31]='micronaut-eclipsestore' | ||
| githuborg.repos[32]='micronaut-mongodb' | ||
| githuborg.repos[33]='micronaut-neo4j' | ||
| githuborg.repos[34]='micronaut-r2dbc' | ||
| githuborg.repos[35]='micronaut-redis' |
|
|
||
| graalvmNative { | ||
| binaries { | ||
| all { |
| ## Micronaut 5.0.0-RC1 Documentation | ||
|
|
||
| ## Usage | ||
|
|
| @@ -0,0 +1,76 @@ | |||
| micronaut.application.name=minor-branch-creator | |||
| githuborg.repos[0]=micronaut-elasticsearch' | |||
There was a problem hiding this comment.
why is this needed? this is another thing to maintain when a new repo is created
alvarosanchez
left a comment
There was a problem hiding this comment.
The idea is very useful, but parsing the TOML is a bit brute force.
Ideally, the way to use this should be to pass a version string, and then the CLI reads the corresponding BOM and uses a resolution API (eg Maven Resolver) to figure out versions.
In any case I expect this to be run from a manually triggered GitHub actions workflow
After a minor or major release of micronaut we should create new minor branches for every repository and set those as default branches. This PR adds a CLI that we can invoke to to that.
java -jar build/libs/minor-branch-creator-0.1-all.jar --github-token=xxxx --dry-run --url=https://github.com/micronaut-projects/micronaut-platform/blob/5.0.x/gradle/libs.versions.tomlThis will be an example of the output for dry-run