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

Jenkins triggers build on git SCM changes even if nothing matches Includes regions

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • git-plugin

      Hi!

      Our builds are set up to listen to changes on origin/master, and has "Included regions" configured. We are using Gitlab and makes heavy use of Merge Requests in Gitlab.

      When we do a merge, where the branch has pulled changed form master, the git-plugin says the following:

      Ignored commit 906b26b2029df2242edb4a591d8ba2e855594be8: No paths matched included region whitelist
      Done. Took 4.5 sec
      Changes found

      No paths matched included whitelist, but it still triggers a build. I believe that this is because there are paths matching the included region whitelist, but they are in the commits that were in the merge from master->currentBranch.

      The reproduction steps:

      • Create 2 Jenkins jobs with different "Included regions whitelist"
        • Job 1: src/a
        • Job 2: src/b
      • Create new branch (myBranch)
      • Commit changes in `src/a`
      • Switch to master branch
      • Commit changes in `src/b`
      • Push changes
      • Switch to myBranch
      • Pull changes from master (git pull origin master)
      • Push changes
      • Create a merge request from myBranch to master (via Gitlab)
      • Accept merge request

      This triggers both Job1 AND Job2, even if I've only committed to Job1's Included region whitelist in my branch. I believe that this is not desired behaviour.

          [JENKINS-36180] Jenkins triggers build on git SCM changes even if nothing matches Includes regions

          We are having the same problem. Any progress on this ticket? Do you know any workaround for this issue?

          Robin Kuivinen added a comment - We are having the same problem. Any progress on this ticket? Do you know any workaround for this issue?

          Zac Kwan added a comment -

          Our pipeline has this problem as well. Can anyone confirm if this is the intended behavior or something that needed to be fixed? Also, are they any workaround for the time being?

          Zac Kwan added a comment - Our pipeline has this problem as well. Can anyone confirm if this is the intended behavior or something that needed to be fixed? Also, are they any workaround for the time being?

          Anatoly Shirokov added a comment - - edited

          Anatoly Shirokov added a comment - - edited We have the same problem: https://issues.jenkins.io/browse/JENKINS-65932

          Anatoly Shirokov added a comment - - edited

          Anatoly Shirokov added a comment - - edited It seems to me here is fix https://github.com/jenkinsci/git-client-plugin/pull/750

            Unassigned Unassigned
            thorseye Jonas Thoursie
            Votes:
            11 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated: