jenkinsci / jenkinsci/git-plugin

[JENKINS-42004] Git plugins triggers unwanted build with git flow

Open
#3,043 1 comment 0 reactions 0 assignees View on GitHub
component:git-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

Within Gitlab I have a git repository "Dummy" which follows the git flow. A Gitlab weebhook informs Jenkins about "Push Events" and "Merge Request Events".

The Jenkins project (also "Dummy") handles the complete build for that repository. The field "Branch Specifier (blank for 'any')" is filled with **.

The only build trigger is "Build when a change is pushed to GitLab": Jenkins detects the Gitlab config and should build at push and merge request events, but do never a rebuild.

The problem occours after merging the release branch into develop and master and pushing them together to Gitlab. Gitlab informs jenkins about the two merge commits and Jenkins starts a build for develop (build #5) and one for master (build #4), which is totally fine. Both builds show correctly the revision to build and the source branch (see screenshots).

But within the master build occurs following console lines:

Log

12:36:22 > git.exe fetch --tags --progress git@​GITLABHOST:dummy/dummy +refs/heads/:refs/remotes/origin/

12:36:23 skipping resolution of commit remotes/origin/master, since it originates from another repository

12:36:23 Seen branch in repository origin/develop

12:36:23 Seen branch in repository origin/master

12:36:23 Seen branch in repository origin/release/version-1.0.0

12:36:23 Seen 3 remote branches

12:36:23 Multiple candidate revisions

12:36:23 Scheduling another build to catch up with Dummy » Dummy

12:36:23 Checking out Revision a3843ad13e885f3d360be580f1d8fd37e244732b (origin/master)

This started build #6. The polling.log for #6 only contains this: "This build was triggered by build 4 because more than one build candidate was found.".

My expected behavior is that no build triggers another build. The problem is, that the jobs should create NuGet packages, but the additional build #6 would try to override the final package of #4 which is not allowed. So the regular Jenkins project would fail at this point.

---
Originally reported by esagawe, imported from: Git plugins triggers unwanted build with git flow


  • status: Open
  • priority: Major
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 4
  • imported: 2025-12-02

Raw content of original issue

Within Gitlab I have a git repository "Dummy" which follows the git flow. A Gitlab weebhook informs Jenkins about "Push Events" and "Merge Request Events".

The Jenkins project (also "Dummy") handles the complete build for that repository. The field "Branch Specifier (blank for 'any')" is filled with **.
The only build trigger is "Build when a change is pushed to GitLab": Jenkins detects the Gitlab config and should build at push and merge request events, but do never a rebuild.

The problem occours after merging the release branch into develop and master and pushing them together to Gitlab. Gitlab informs jenkins about the two merge commits and Jenkins starts a build for develop (build #5) and one for master (build #4), which is totally fine. Both builds show correctly the revision to build and the source branch (see screenshots).
But within the master build occurs following console lines:

Log

12:36:22 > git.exe fetch --tags --progress git@GITLABHOST:dummy/dummy +refs/heads/:refs/remotes/origin/
12:36:23 skipping resolution of commit remotes/origin/master, since it originates from another repository
12:36:23 Seen branch in repository origin/develop
12:36:23 Seen branch in repository origin/master
12:36:23 Seen branch in repository origin/release/version-1.0.0
12:36:23 Seen 3 remote branches
12:36:23 Multiple candidate revisions
12:36:23 Scheduling another build to catch up with Dummy » Dummy
12:36:23 Checking out Revision a3843ad13e885f3d360be580f1d8fd37e244732b (origin/master)


This started build #6. The polling.log for #6 only contains this: "This build was triggered by build 4 because more than one build candidate was found.".

My expected behavior is that no build triggers another build. The problem is, that the jobs should create NuGet packages, but the additional build #6 would try to override the final package of #4 which is not allowed. So the regular Jenkins project would fail at this point.

environment

```
Jenkins: 2.32.2

Git plugin: 3.0.5

Gitlab: 8.13.3
```

4 attachments

- [Build4.jpg](https://issues.jenkins.io/secure/attachment/35943/Build4.jpg)
> ![Build4.jpg](https://issues.jenkins.io/secure/attachment/35943/Build4.jpg)
- [Build5.jpg](https://issues.jenkins.io/secure/attachment/35942/Build5.jpg)
> ![Build5.jpg](https://issues.jenkins.io/secure/attachment/35942/Build5.jpg)
- [Build6.jpg](https://issues.jenkins.io/secure/attachment/35941/Build6.jpg)
> ![Build6.jpg](https://issues.jenkins.io/secure/attachment/35941/Build6.jpg)
- [gitlog.jpg](https://issues.jenkins.io/secure/attachment/35940/gitlog.jpg)
> ![gitlog.jpg](https://issues.jenkins.io/secure/attachment/35940/gitlog.jpg)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.