Simple Maven test project for testing Renovate issue #40690
The configuration of
{
"baseBranches": [ "main/integration", "1000XX/integration" ],
"branchPrefix": "",
"additionalBranchPrefix": "{{lookup (split baseBranch '/') 0}}/update/renovate-",
"useBaseBranchConfig": "merge",
...
Is creating the following wrong branch names:
- 1000XX/integration-1000XX/update/renovate-major-maven-versions
- 1000XX/integration-1000XX/update/renovate-maven-versions
- main/integration-main/update/renovate-major-maven-versions
- main/integration-main/update/renovate-maven-versions
The template in additionalBranchPrefix should exract from the given baseBranches names the parts "main" and "1000XX" respectively and create branch names as:
- 1000XX/update/renovate-major-maven-versions
- 1000XX/update/renovate-maven-versions
- main/update/renovate-major-maven-versions
- main/update/renovate-maven-versions
See discussion here: renovatebot/renovate#40690
This project is designed to test the branch naming behavior when using additionalBranchPrefix in Renovate configuration with template expressions involving baseBranch.
This is a simple Maven project with:
-
3 dependencies to be updated by Renovate:
- JUnit 5 (version 5.9.3)
- Log4j 2 (version 2.20.0)
- Mockito (version 5.3.1)
-
Simple Java classes:
Calculator.java- A basic calculator class using Log4j for loggingCalculatorTest.java- JUnit 5 tests using Mockito extension
The issue relates to branch naming when using additionalBranchPrefix with template expressions like:
"additionalBranchPrefix": "{{lookup (split baseBranch '/') 0}}/update/renovate-"The expected behavior is to extract the first part of the base branch name and use it as a prefix. However, the reported issue shows that the full base branch name is being concatenated incorrectly.
The renovate.json file contains the configuration that tests the issue with:
baseBranches: ["main"]branchPrefix: ""additionalBranchPrefix: "{{lookup (split baseBranch '/') 0}}/update/renovate-"
The .github/workflows/renovate.yml file provides a manually triggered workflow to run Renovate bot with options for dry-run mode.
mvn clean compile testManually trigger the "Renovate" workflow from the GitHub Actions tab to test the branch naming behavior.