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

Issue with release-start goal creating multiple release branches #399

Open
jelingi opened this issue Dec 14, 2023 · 1 comment
Open

Issue with release-start goal creating multiple release branches #399

jelingi opened this issue Dec 14, 2023 · 1 comment

Comments

@jelingi
Copy link

jelingi commented Dec 14, 2023

When executing the release-start goal of the Gitflow Maven Plugin in Jenkins, it appears that the remote check is not executed correctly. Even if there is already an existing release branch, running the release-start goal again results in the creation of a new release branch, instead of thowing the error "Release branch already exists. Cannot start release."

GitFlowReleaseStartMojo.java:153-157
final String releaseBranch = gitFindBranches(gitFlowConfig.getReleaseBranchPrefix(), true); if (StringUtils.isNotBlank(releaseBranch)) { throw new MojoFailureException("Release branch already exists. Cannot start release."); }

Plugin Version: 1.20
Jenkins Log:

  • mvn com.amashchenko.maven.plugin:gitflow-maven-plugin:1.20.0:release-start -DpushRemote=true -DcommitDevelopmentVersionAtStart=true -DallowSnapshots=false -DbranchName=19.0.x -DuseSnapshotInRelease=false -DversionDigitToIncrement=0
    Picked up JAVA_TOOL_OPTIONS: -Dmaven.ext.class.path="/opt/webapp.dist.lin/base/jenkins/workspace/workspace/Architektur/maven-gitfllow/release/start_release@tmp/withMavenf4e61d67/pipeline-maven-spy.jar" -Dorg.jenkinsci.plugins.pipeline.maven.reportsFolder="/opt/webapp.dist.lin/base/jenkins/workspace/workspace/Architektur/maven-gitfllow/release/start_release@tmp/withMavenf4e61d67"
    Failed to load native library:jansi-2.4.0-2822e37509ba08b3-libjansi.so. The native library file at /tmp/jansi-2.4.0-2822e37509ba08b3-libjansi.so is not executable, make sure that the directory is mounted on a partition without the noexec flag, or set the jansi.tmpdir system property to point to a proper location. osinfo: Linux/x86_64
    java.lang.UnsatisfiedLinkError: /tmp/jansi-2.4.0-2822e37509ba08b3-libjansi.so: /tmp/jansi-2.4.0-2822e37509ba08b3-libjansi.so: failed to map segment from shared object
    [INFO] [jenkins-event-spy] Generate /opt/webapp.dist.lin/base/jenkins/workspace/workspace/Architektur/maven-gitfllow/release/start_release@tmp/withMavenf4e61d67/maven-spy-20231214-120605-3782459818337976087453.log.tmp ...
    [INFO] Scanning for projects...
    [INFO]
    [INFO] -------------------< de.gw:maven-gitflow-sample >-------------------
    [INFO] Building de.gw:maven-gitflow-sample 19.0.0-SNAPSHOT
    [INFO] --------------------------------[ jar ]---------------------------------
    [INFO]
    [INFO] --- gitflow-maven-plugin:1.20.0:release-start (default-cli) @ maven-gitflow-sample ---
    [INFO] Checking for uncommitted changes.
    [INFO] Fetching remote from 'origin'.
    [INFO] Local branch 'develop' doesn't exist. Trying check it out from 'origin'.
    [INFO] Creating a new branch 'develop' from 'origin/develop' and checking it out.
    [INFO] Checking out 'develop' branch.
    [INFO] Checking for SNAPSHOT versions in dependencies.
    [INFO] Version is blank. Using default version.
    [INFO] Updating version(s) to '19.0.0'.
    [INFO] Committing changes.
    [INFO] Creating a new branch 'release/19.0.x' from 'develop'.
    [INFO] Updating version(s) to '20.0.0-SNAPSHOT'.
    [INFO] Committing changes.
    [INFO] Checking out 'release/19.0.x' branch.
    [INFO] Pushing 'develop' branch to 'origin'.
    [INFO] Pushing 'release/19.0.x' branch to 'origin'.
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 7.550 s
    [INFO] Finished at: 2023-12-14T12:06:13+01:00
    [INFO] ------------------------------------------------------------------------

If I execute the command in the Pipeline :
sh "git for-each-ref '--format=%(refname:short)' refs/heads/release/** refs/remotes/origin/release/**"

All the refs are shown correctly:

  • git for-each-ref '--format=%(refname:short)' 'refs/heads/release/' 'refs/remotes/origin/release/'
    origin/release/17.8.x
    origin/release/18.0.x
    origin/release/19.0.x

Do you have any ideas why the check for existing remote branches isnt working correclty in the plugin ?

Kind regards
Jelin

@jelingi jelingi closed this as completed Dec 14, 2023
@jelingi jelingi reopened this Dec 14, 2023
@jelingi
Copy link
Author

jelingi commented Dec 14, 2023

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant