[JIRA] [git-plugin] (JENKINS-23606) Git Polling Jobs with Included Regions being triggered unnecessarily with merge commits

3 views
Skip to first unread message

federicon@al.com.au (JIRA)

unread,
Sep 9, 2015, 4:24:04 AM9/9/15
to jenkinsc...@googlegroups.com
Federico Naum commented on Bug JENKINS-23606
 
Re: Git Polling Jobs with Included Regions being triggered unnecessarily with merge commits

Hi, I'm experiencing exactly the same issue. (and as Doron Shai mentioned it is a real problem)
This problem is quite exacerbated when people merge master to on old branch

At a first glance removing the `-m` on the `git log` line seems to return the results that I'll be expecting. But I'll try to use that PR that uses `git diff --name-only old...new`
.....
I'd had a look at the pull request and the comments with the reasoning it was not yet integrated.
If I can get this working I'll try to check why the JGit vs git behaviors are different.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

phil.johnson@infinitecampus.com (JIRA)

unread,
Sep 6, 2016, 3:08:04 PM9/6/16
to jenkinsc...@googlegroups.com

I can verify that this excluded/included region issue with "merge commits" is still an issue.

Jenkins ver. 1.642
git-scm plugin 2.4.2

This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

smith.daren.j@gmail.com (JIRA)

unread,
Sep 6, 2016, 3:16:06 PM9/6/16
to jenkinsc...@googlegroups.com

souciance.eqdam.rashti@gmail.com (JIRA)

unread,
Sep 15, 2016, 4:16:04 AM9/15/16
to jenkinsc...@googlegroups.com

We are seeing the same issue here.

We have set included and excluded regions but merge commits trigger all jobs which causes some jobs to fail and we have to manually trigger them.

souciance.eqdam.rashti@gmail.com (JIRA)

unread,
Sep 15, 2016, 4:19:01 AM9/15/16
to jenkinsc...@googlegroups.com
We are seeing the same issue here.

We have set included and excluded regions but merge commits trigger all jobs which causes some jobs to fail and we have to manually trigger them.


Our environment:
jenkins 1.642.4
git 2.4.4
git-client 1.19.6

rutger.saalmink@rabobank.nl (JIRA)

unread,
Sep 19, 2016, 8:01:05 AM9/19/16
to jenkinsc...@googlegroups.com

Same issue here, in a setting in which GitFlow is used. The Jenkins job is configured to poll the developer branch: Polling ignores commits in certain paths - 'Included Regions' - /sources/.*
Two feature branches are made:
1. commit to a file in /sources/
2. commit to a file in /documentation/
For both feature branches, when being merged back to developer, the job is triggered. This should only be one build trigger, i.e. only the commit+merge that affects files in the sources directory.

Git client plugin
1.21.0

Git plugin
2.5.3

Jenkins
1.651.1

kevin.reed@speakcreative.com (JIRA)

unread,
Jan 25, 2017, 12:26:04 PM1/25/17
to jenkinsc...@googlegroups.com

tomikmar@gmail.com (JIRA)

unread,
Jan 28, 2019, 9:37:09 AM1/28/19
to jenkinsc...@googlegroups.com
Tomasz M commented on Bug JENKINS-23606

We have the same problem. Our temporary workaround is to set "Merge strategies" to "Rebase and merge" on Bitbucket Server. After rebase current git log command seems to work properly.

 

Maybe, as a simple fix, you could allow to customize git log command in configuration?

 

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

kshultz@cloudbees.com (JIRA)

unread,
Apr 24, 2019, 10:15:05 AM4/24/19
to jenkinsc...@googlegroups.com

kshultz@cloudbees.com (JIRA)

unread,
May 3, 2019, 3:15:03 PM5/3/19
to jenkinsc...@googlegroups.com
Karl Shultz commented on Bug JENKINS-23606
 
Re: Git Polling Jobs with Included Regions being triggered unnecessarily with merge commits

Tomasz M (and others) - here's a question about the issues you're experiencing with included and excluded regions. Are you, by chance, starting your included regions with a leading /, as lledhub dell alluded to in this comment from September 9, 2016?

I've written eight new tests that look at included/excluded areas specifically with merge commits. It took me a really, really long time to see it, but eventually I realized that the last failing test was failing because it had committed directory/filename to the git repository, but the included/excluded region pattern was looking for /directory/filename. The difference was that leading slash.

kshultz@cloudbees.com (JIRA)

unread,
May 6, 2019, 11:40:02 AM5/6/19
to jenkinsc...@googlegroups.com

The eight new tests have been [merged to master](https://github.com/jenkinsci/git-plugin/pull/716). They include, in the form of "top level directory of the repo" and "inside a subdirectory" test, the following:

  • Merge commits inside of excluded regions get ignored (file, directory)
  • Merge commits inside of included regions get processed as new changes (file, directory
  • Merge commits outside of included regions get ignored file, directory
  • Merge commits outside of excluded regions get processed file, directory

kshultz@cloudbees.com (JIRA)

unread,
May 6, 2019, 11:41:05 AM5/6/19
to jenkinsc...@googlegroups.com
Karl Shultz edited a comment on Bug JENKINS-23606
The [eight new tests|https://github.com/jenkinsci/git-plugin/blob/master/src/test/java/hudson/plugins/git/GitSCMTest.java#L358-L654] have been [merged to master](https://github.com/jenkinsci/git-plugin/pull/716). They include, in the form of "top level directory of the repo" and "inside a subdirectory" test, the following:

* Merge commits inside of excluded regions get ignored ([file|https://github.com/jenkinsci/git-plugin/blob/0d7b5ab0fbd23aec73570f7b0693424360295993/src/test/java/hudson/plugins/git/GitSCMTest.java#L368], [directory|https://github.com/jenkinsci/git-plugin/blob/0d7b5ab0fbd23aec73570f7b0693424360295993/src/test/java/hudson/plugins/git/GitSCMTest.java#L404])
* Merge commits inside of included regions get processed as new changes ([file|https://github.com/jenkinsci/git-plugin/blob/0d7b5ab0fbd23aec73570f7b0693424360295993/src/test/java/hudson/plugins/git/GitSCMTest.java#L440], [directory|https://github.com/jenkinsci/git-plugin/blob/0d7b5ab0fbd23aec73570f7b0693424360295993/src/test/java/hudson/plugins/git/GitSCMTest.java#L477]
)
* Merge commits outside of included regions get ignored
( [file|https://github.com/jenkinsci/git-plugin/blob/0d7b5ab0fbd23aec73570f7b0693424360295993/src/test/java/hudson/plugins/git/GitSCMTest.java#L515], [directory|https://github.com/jenkinsci/git-plugin/blob/0d7b5ab0fbd23aec73570f7b0693424360295993/src/test/java/hudson/plugins/git/GitSCMTest.java#L552] )
* Merge commits outside of excluded regions get processed
( [file|https://github.com/jenkinsci/git-plugin/blob/0d7b5ab0fbd23aec73570f7b0693424360295993/src/test/java/hudson/plugins/git/GitSCMTest.java#L590], [directory|https://github.com/jenkinsci/git-plugin/blob/0d7b5ab0fbd23aec73570f7b0693424360295993/src/test/java/hudson/plugins/git/GitSCMTest.java#L628] )

kshultz@cloudbees.com (JIRA)

unread,
May 6, 2019, 11:41:05 AM5/6/19
to jenkinsc...@googlegroups.com
Karl Shultz edited a comment on Bug JENKINS-23606
The [eight new tests|https://github.com/jenkinsci/git-plugin/blob/master/src/test/java/hudson/plugins/git/GitSCMTest.java#L358-L654] have been [merged to master ]( | https://github.com/jenkinsci/git-plugin/pull/716 ) ] . They include, in the form of "top level directory of the repo" and "inside a subdirectory" test tests , the following:

tomikmar@gmail.com (JIRA)

unread,
Jul 1, 2019, 6:32:04 AM7/1/19
to jenkinsc...@googlegroups.com
Tomasz M commented on Bug JENKINS-23606

Karl Shultz - here are the settings we use:

Branch Specifier (blank for 'any') :origin/develop
Included Regions ^report-service/.*
Excluded Regions [empty]  
Reply all
Reply to author
Forward
0 new messages