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

Included Regions do not work when monitoring all branches

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • Jenkins 1.608, Git plugin 2.3.5

      Set up a job to monitor all branches ('**' in 'Branches to build') but restrict it to one folder ('Project1/.*' in 'Included Regions').

      As long as you make submissions to one branch, the included regions works fine.
      However, when you make a change on a different branch, the first job that triggers will ignore included regions and pick up changes from any location. After that the next jobs on the same branch will follow the restrictions correctly until a change on another branch is made.

      Here's part of my config.xml:

      <scm class="hudson.plugins.git.GitSCM" plugin="git@2.3.5">
      <configVersion>2</configVersion>
      <userRemoteConfigs>
      <hudson.plugins.git.UserRemoteConfig>
      <url>git@github.com:SomeAccount/1.git</url>
      <credentialsId>ff33d8db-ec3a-48d2-83cd-6d5cbd8f51a4</credentialsId>
      </hudson.plugins.git.UserRemoteConfig>
      </userRemoteConfigs>
      <branches>
      <hudson.plugins.git.BranchSpec>
      <name>**</name>
      </hudson.plugins.git.BranchSpec>
      </branches>
      <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
      <submoduleCfg class="list"/>
      <extensions>
      <hudson.plugins.git.extensions.impl.PathRestriction>
      <includedRegions>Project1/.*</includedRegions>
      <excludedRegions></excludedRegions>
      </hudson.plugins.git.extensions.impl.PathRestriction>
      </extensions>
      </scm>

      Here's a part of the 'GitHub Hook log':
      Seen 51 remote branches
      > /usr/bin/git log --full-history --no-abbrev --format=raw -M -m --raw [edited change A] ..[edited change B] # timeout=10
      Ignored commit [edited change B]: Found only excluded paths:
      Done. Took 1.2 sec
      Changes found

          [JENKINS-28032] Included Regions do not work when monitoring all branches

          Jacek Sniecikowski created issue -
          Jacek Sniecikowski made changes -
          Description Original: Set up a job to monitor all branches ('**' in 'Branches to build') but restrict it to one folder ('Project1/.*' in 'Included Regions').

          As long as you make submissions to one branch, the included regions works fine.
          However, when you make a change on a different branch, the first job that triggers will ignore included regions and pick up changes from any location. After that the next jobs on the same branch will follow the restrictions correctly until a change on another branch is made.

          Here's part of my config.xml:

          <scm class="hudson.plugins.git.GitSCM" plugin="git@2.3.5">
            <configVersion>2</configVersion>
            <userRemoteConfigs>
              <hudson.plugins.git.UserRemoteConfig>
                <url>git@github.com:SomeAccount/1.git</url>
                <credentialsId>ff33d8db-ec3a-48d2-83cd-6d5cbd8f51a4</credentialsId>
              </hudson.plugins.git.UserRemoteConfig>
            </userRemoteConfigs>
            <branches>
              <hudson.plugins.git.BranchSpec>
                <name>**</name>
              </hudson.plugins.git.BranchSpec>
            </branches>
            <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
            <submoduleCfg class="list"/>
            <extensions>
              <hudson.plugins.git.extensions.impl.PathRestriction>
                <includedRegions>Project1/.*</includedRegions>
                <excludedRegions></excludedRegions>
              </hudson.plugins.git.extensions.impl.PathRestriction>
            </extensions>
          </scm>
          New: Set up a job to monitor all branches ('/**' in 'Branches to build') but restrict it to one folder ('Project1/.*' in 'Included Regions').

          As long as you make submissions to one branch, the included regions works fine.
          However, when you make a change on a different branch, the first job that triggers will ignore included regions and pick up changes from any location. After that the next jobs on the same branch will follow the restrictions correctly until a change on another branch is made.

          Here's part of my config.xml:

          <scm class="hudson.plugins.git.GitSCM" plugin="git@2.3.5">
            <configVersion>2</configVersion>
            <userRemoteConfigs>
              <hudson.plugins.git.UserRemoteConfig>
                <url>git@github.com:SomeAccount/1.git</url>
                <credentialsId>ff33d8db-ec3a-48d2-83cd-6d5cbd8f51a4</credentialsId>
              </hudson.plugins.git.UserRemoteConfig>
            </userRemoteConfigs>
            <branches>
              <hudson.plugins.git.BranchSpec>
                <name>**</name>
              </hudson.plugins.git.BranchSpec>
            </branches>
            <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
            <submoduleCfg class="list"/>
            <extensions>
              <hudson.plugins.git.extensions.impl.PathRestriction>
                <includedRegions>Project1/.*</includedRegions>
                <excludedRegions></excludedRegions>
              </hudson.plugins.git.extensions.impl.PathRestriction>
            </extensions>
          </scm>
          Jacek Sniecikowski made changes -
          Description Original: Set up a job to monitor all branches ('/**' in 'Branches to build') but restrict it to one folder ('Project1/.*' in 'Included Regions').

          As long as you make submissions to one branch, the included regions works fine.
          However, when you make a change on a different branch, the first job that triggers will ignore included regions and pick up changes from any location. After that the next jobs on the same branch will follow the restrictions correctly until a change on another branch is made.

          Here's part of my config.xml:

          <scm class="hudson.plugins.git.GitSCM" plugin="git@2.3.5">
            <configVersion>2</configVersion>
            <userRemoteConfigs>
              <hudson.plugins.git.UserRemoteConfig>
                <url>git@github.com:SomeAccount/1.git</url>
                <credentialsId>ff33d8db-ec3a-48d2-83cd-6d5cbd8f51a4</credentialsId>
              </hudson.plugins.git.UserRemoteConfig>
            </userRemoteConfigs>
            <branches>
              <hudson.plugins.git.BranchSpec>
                <name>**</name>
              </hudson.plugins.git.BranchSpec>
            </branches>
            <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
            <submoduleCfg class="list"/>
            <extensions>
              <hudson.plugins.git.extensions.impl.PathRestriction>
                <includedRegions>Project1/.*</includedRegions>
                <excludedRegions></excludedRegions>
              </hudson.plugins.git.extensions.impl.PathRestriction>
            </extensions>
          </scm>
          New: Set up a job to monitor all branches ('\**' in 'Branches to build') but restrict it to one folder ('Project1/.*' in 'Included Regions').

          As long as you make submissions to one branch, the included regions works fine.
          However, when you make a change on a different branch, the first job that triggers will ignore included regions and pick up changes from any location. After that the next jobs on the same branch will follow the restrictions correctly until a change on another branch is made.

          Here's part of my config.xml:

          <scm class="hudson.plugins.git.GitSCM" plugin="git@2.3.5">
            <configVersion>2</configVersion>
            <userRemoteConfigs>
              <hudson.plugins.git.UserRemoteConfig>
                <url>git@github.com:SomeAccount/1.git</url>
                <credentialsId>ff33d8db-ec3a-48d2-83cd-6d5cbd8f51a4</credentialsId>
              </hudson.plugins.git.UserRemoteConfig>
            </userRemoteConfigs>
            <branches>
              <hudson.plugins.git.BranchSpec>
                <name>**</name>
              </hudson.plugins.git.BranchSpec>
            </branches>
            <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
            <submoduleCfg class="list"/>
            <extensions>
              <hudson.plugins.git.extensions.impl.PathRestriction>
                <includedRegions>Project1/.*</includedRegions>
                <excludedRegions></excludedRegions>
              </hudson.plugins.git.extensions.impl.PathRestriction>
            </extensions>
          </scm>
          Jacek Sniecikowski made changes -
          Description Original: Set up a job to monitor all branches ('\**' in 'Branches to build') but restrict it to one folder ('Project1/.*' in 'Included Regions').

          As long as you make submissions to one branch, the included regions works fine.
          However, when you make a change on a different branch, the first job that triggers will ignore included regions and pick up changes from any location. After that the next jobs on the same branch will follow the restrictions correctly until a change on another branch is made.

          Here's part of my config.xml:

          <scm class="hudson.plugins.git.GitSCM" plugin="git@2.3.5">
            <configVersion>2</configVersion>
            <userRemoteConfigs>
              <hudson.plugins.git.UserRemoteConfig>
                <url>git@github.com:SomeAccount/1.git</url>
                <credentialsId>ff33d8db-ec3a-48d2-83cd-6d5cbd8f51a4</credentialsId>
              </hudson.plugins.git.UserRemoteConfig>
            </userRemoteConfigs>
            <branches>
              <hudson.plugins.git.BranchSpec>
                <name>**</name>
              </hudson.plugins.git.BranchSpec>
            </branches>
            <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
            <submoduleCfg class="list"/>
            <extensions>
              <hudson.plugins.git.extensions.impl.PathRestriction>
                <includedRegions>Project1/.*</includedRegions>
                <excludedRegions></excludedRegions>
              </hudson.plugins.git.extensions.impl.PathRestriction>
            </extensions>
          </scm>
          New: Set up a job to monitor all branches ('\*\*' in 'Branches to build') but restrict it to one folder ('Project1/.*' in 'Included Regions').

          As long as you make submissions to one branch, the included regions works fine.
          However, when you make a change on a different branch, the first job that triggers will ignore included regions and pick up changes from any location. After that the next jobs on the same branch will follow the restrictions correctly until a change on another branch is made.

          Here's part of my config.xml:

          <scm class="hudson.plugins.git.GitSCM" plugin="git@2.3.5">
            <configVersion>2</configVersion>
            <userRemoteConfigs>
              <hudson.plugins.git.UserRemoteConfig>
                <url>git@github.com:SomeAccount/1.git</url>
                <credentialsId>ff33d8db-ec3a-48d2-83cd-6d5cbd8f51a4</credentialsId>
              </hudson.plugins.git.UserRemoteConfig>
            </userRemoteConfigs>
            <branches>
              <hudson.plugins.git.BranchSpec>
                <name>**</name>
              </hudson.plugins.git.BranchSpec>
            </branches>
            <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
            <submoduleCfg class="list"/>
            <extensions>
              <hudson.plugins.git.extensions.impl.PathRestriction>
                <includedRegions>Project1/.*</includedRegions>
                <excludedRegions></excludedRegions>
              </hudson.plugins.git.extensions.impl.PathRestriction>
            </extensions>
          </scm>
          Jacek Sniecikowski made changes -
          Description Original: Set up a job to monitor all branches ('\*\*' in 'Branches to build') but restrict it to one folder ('Project1/.*' in 'Included Regions').

          As long as you make submissions to one branch, the included regions works fine.
          However, when you make a change on a different branch, the first job that triggers will ignore included regions and pick up changes from any location. After that the next jobs on the same branch will follow the restrictions correctly until a change on another branch is made.

          Here's part of my config.xml:

          <scm class="hudson.plugins.git.GitSCM" plugin="git@2.3.5">
            <configVersion>2</configVersion>
            <userRemoteConfigs>
              <hudson.plugins.git.UserRemoteConfig>
                <url>git@github.com:SomeAccount/1.git</url>
                <credentialsId>ff33d8db-ec3a-48d2-83cd-6d5cbd8f51a4</credentialsId>
              </hudson.plugins.git.UserRemoteConfig>
            </userRemoteConfigs>
            <branches>
              <hudson.plugins.git.BranchSpec>
                <name>**</name>
              </hudson.plugins.git.BranchSpec>
            </branches>
            <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
            <submoduleCfg class="list"/>
            <extensions>
              <hudson.plugins.git.extensions.impl.PathRestriction>
                <includedRegions>Project1/.*</includedRegions>
                <excludedRegions></excludedRegions>
              </hudson.plugins.git.extensions.impl.PathRestriction>
            </extensions>
          </scm>
          New: Set up a job to monitor all branches ('\*\*' in 'Branches to build') but restrict it to one folder ('Project1/.*' in 'Included Regions').

          As long as you make submissions to one branch, the included regions works fine.
          However, when you make a change on a different branch, the first job that triggers will ignore included regions and pick up changes from any location. After that the next jobs on the same branch will follow the restrictions correctly until a change on another branch is made.

          Here's part of my config.xml:

          <scm class="hudson.plugins.git.GitSCM" plugin="git@2.3.5">
            <configVersion>2</configVersion>
            <userRemoteConfigs>
              <hudson.plugins.git.UserRemoteConfig>
                <url>git@github.com:SomeAccount/1.git</url>
                <credentialsId>ff33d8db-ec3a-48d2-83cd-6d5cbd8f51a4</credentialsId>
              </hudson.plugins.git.UserRemoteConfig>
            </userRemoteConfigs>
            <branches>
              <hudson.plugins.git.BranchSpec>
                <name>**</name>
              </hudson.plugins.git.BranchSpec>
            </branches>
            <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
            <submoduleCfg class="list"/>
            <extensions>
              <hudson.plugins.git.extensions.impl.PathRestriction>
                <includedRegions>Project1/.*</includedRegions>
                <excludedRegions></excludedRegions>
              </hudson.plugins.git.extensions.impl.PathRestriction>
            </extensions>
          </scm>

          Here's a part of the 'GitHub Hook log':
          Seen 51 remote branches
           > /usr/bin/git log --full-history --no-abbrev --format=raw -M -m --raw [edited change A] ..[edited change B] # timeout=10
          Ignored commit [edited change B]: Found only excluded paths:
          Done. Took 1.2 sec
          Changes found
          Mark Waite made changes -
          Link New: This issue is related to JENKINS-28149 [ JENKINS-28149 ]
          Jacek Sniecikowski made changes -
          Assignee Original: Nicolas De Loof [ ndeloof ] New: Jacek Sniecikowski [ jsniecikowski ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 162634 ] New: JNJira + In-Review [ 181000 ]
          Mark Waite made changes -
          Assignee Original: Jacek Sniecikowski [ jsniecikowski ]

            Unassigned Unassigned
            jsniecikowski Jacek Sniecikowski
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: