Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-20389

Merge commits trigger uneccessary builds when Include/Exclude regions are defined

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • git-plugin
    • None
    • Jenkins 1.537, Jenkins GIT plugin 2.0, Jenkins GIT client plugin 1.4.6, Windows Server 2012 Standard, msysgit 1.8.4

      The "Included Regions" patterns seem to be matched against the file diff list of both parents of a merge commit instead of just the files being modified by the commits being merged in to the branch being monitored. This results in builds being triggered by every merge into the monitored branch from any branches that stem from before a commit on the monitored branch that modifies something in the "Included Regions".

      I have included a screenshot of a Git history that will hopefully help support or clarify the described situation. The order of events that occurred for this history view:

      • Jenkins job A configured to build when the autobuild/test.txt file is modified in the branch Jenkins_Testing ("Included Regions" value set to "autobuild/test\.txt")
      • branch Jenkins_Testing starts at commit 746d3
      • branch j_defect_01 is created at commit 746d3
      • branch j_defect_02 is created at commit 746d3
      • autobuild/test.txt file is modified in commit 6220e in j_defect_01
      • j_defect_01 merged into jenkins_testing (this creates FF merge of jenkins_testing and triggers a build of job A as expected)
      • autobuild/test.log file is modified in commit f7cb6 in j_defect_02
      • j_defect_02 is merged into jenkins_testing creating merge commit 91a02 with the two parent commits of f7cb6 and 6220e (this results in another build of job A being triggered even though commit f7cb6 being merged into jenkins_testing doesn't actually modify autobuild/test.txt and a build for the autobuild/test.txt changes in commit 6220e has already been run)

      It is quite possible that I don't have a good understanding of what is occurring here and am expecting behaviour other than what is actually intended, but with that being said I cannot figure out how to only have the build triggered the first time file modifications are introduced by a commit that affect files in the "Included Regions" configured for a monitored branch.

            Unassigned Unassigned
            mlong072 Mike Long
            Votes:
            23 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated: