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

Equivalent to polling commit exclusions for branch indexing

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major Major
    • branch-api-plugin
    • None
    • Windows

      I have an organizational project configured which scans repositories for jenkinsfile. One of the repository (https://github.com/VirtoCommerce/vc-module-jenkinssample) has a following Jenkinsfile defined:

          node 
          {
          	stage 'Checkout'
                  checkout([
                      $class: 'GitSCM', 
                      branches: [[name: '*/master']], 
                      extensions: [[
          			    $class: 'PathRestriction', 
          			    excludedRegions: 'CommonAssemblyInfo\\.cs', 
          			    includedRegions: ''
          		    ]], 
                      userRemoteConfigs: [[
                          url: 'git@github.com:VirtoCommerce/vc-module-jenkinssample.git']]])
          }
      

      As you might see I have an excluded region defined, so changes made to CommonAssemblyInfo.cs don't trigger any builds. However "Branch Indexing" still forces the job to build when I commit changes to "CommonAssemblyInfo.cs". How can I prevent this?

      Btw, the above script works fine in a separate/individual Pipeline Job.

        1. screenshot-2.png
          screenshot-2.png
          95 kB
        2. screenshot-1.png
          screenshot-1.png
          2 kB
        3. multibranch_indexing_options.png
          multibranch_indexing_options.png
          182 kB
        4. non_multibranch_pipeline_filters.png
          non_multibranch_pipeline_filters.png
          147 kB
        5. workaround.txt
          0.9 kB

          [JENKINS-35988] Equivalent to polling commit exclusions for branch indexing

          Alexander Siniouguine created issue -
          Alexander Siniouguine made changes -
          Description Original: I have an organizational project configured which scans repositories for jenkinsfile. One of the repository (https://github.com/VirtoCommerce/vc-module-jenkinssample) has a following Jenkinsfile defined:

              node
              {
               stage 'Checkout'
                      checkout([
                          $class: 'GitSCM',
                          branches: [[name: '*/master']],
                          extensions: [[
               $class: 'PathRestriction',
               excludedRegions: 'CommonAssemblyInfo\\.cs',
               includedRegions: ''
               ]],
                          userRemoteConfigs: [[
                              url: 'git@github.com:VirtoCommerce/vc-module-jenkinssample.git']]])
              }

          As you might see I have an excluded region defined, so changes made to CommonAssemblyInfo.cs don't trigger any builds. However "Branch Indexing" still forces the job to build when I commit changes to "CommonAssemblyInfo.cs". How can I prevent this?

          Btw, the above script works fine in a separate/individual Pipeline Job.
          New: I have an organizational project configured which scans repositories for jenkinsfile. One of the repository (https://github.com/VirtoCommerce/vc-module-jenkinssample) has a following Jenkinsfile defined:

          {{
              node
              {
               stage 'Checkout'
                      checkout([
                          $class: 'GitSCM',
                          branches: [[name: '*/master']],
                          extensions: [[
               $class: 'PathRestriction',
               excludedRegions: 'CommonAssemblyInfo\\.cs',
               includedRegions: ''
               ]],
                          userRemoteConfigs: [[
                              url: 'git@github.com:VirtoCommerce/vc-module-jenkinssample.git']]])
              }
          }}
          As you might see I have an excluded region defined, so changes made to CommonAssemblyInfo.cs don't trigger any builds. However "Branch Indexing" still forces the job to build when I commit changes to "CommonAssemblyInfo.cs". How can I prevent this?

          Btw, the above script works fine in a separate/individual Pipeline Job.
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Alexander Siniouguine made changes -
          Component/s New: github-organization-folder-plugin [ 21427 ]
          Component/s Original: git-plugin [ 15543 ]
          Alexander Siniouguine made changes -
          Component/s Original: workflow-multibranch-plugin [ 21465 ]
          Alexander Siniouguine made changes -
          Component/s New: workflow-multibranch-plugin [ 21465 ]
          Darth Vader made changes -
          Link New: This issue is related to JENKINS-36195 [ JENKINS-36195 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 172625 ] New: JNJira + In-Review [ 184698 ]
          Jesse Glick made changes -
          Description Original: I have an organizational project configured which scans repositories for jenkinsfile. One of the repository (https://github.com/VirtoCommerce/vc-module-jenkinssample) has a following Jenkinsfile defined:

          {{
              node
              {
               stage 'Checkout'
                      checkout([
                          $class: 'GitSCM',
                          branches: [[name: '*/master']],
                          extensions: [[
               $class: 'PathRestriction',
               excludedRegions: 'CommonAssemblyInfo\\.cs',
               includedRegions: ''
               ]],
                          userRemoteConfigs: [[
                              url: 'git@github.com:VirtoCommerce/vc-module-jenkinssample.git']]])
              }
          }}
          As you might see I have an excluded region defined, so changes made to CommonAssemblyInfo.cs don't trigger any builds. However "Branch Indexing" still forces the job to build when I commit changes to "CommonAssemblyInfo.cs". How can I prevent this?

          Btw, the above script works fine in a separate/individual Pipeline Job.
          New: I have an organizational project configured which scans repositories for jenkinsfile. One of the repository (https://github.com/VirtoCommerce/vc-module-jenkinssample) has a following Jenkinsfile defined:

          {code}
              node
              {
               stage 'Checkout'
                      checkout([
                          $class: 'GitSCM',
                          branches: [[name: '*/master']],
                          extensions: [[
               $class: 'PathRestriction',
               excludedRegions: 'CommonAssemblyInfo\\.cs',
               includedRegions: ''
               ]],
                          userRemoteConfigs: [[
                              url: 'git@github.com:VirtoCommerce/vc-module-jenkinssample.git']]])
              }
          {code}

          As you might see I have an excluded region defined, so changes made to CommonAssemblyInfo.cs don't trigger any builds. However "Branch Indexing" still forces the job to build when I commit changes to "CommonAssemblyInfo.cs". How can I prevent this?

          Btw, the above script works fine in a separate/individual Pipeline Job.
          Jesse Glick made changes -
          Component/s New: branch-api-plugin [ 18621 ]
          Component/s Original: github-organization-folder-plugin [ 21427 ]
          Component/s Original: workflow-multibranch-plugin [ 21465 ]
          Jesse Glick made changes -
          Component/s New: github-branch-source-plugin [ 20858 ]
          Component/s Original: branch-api-plugin [ 18621 ]
          Issue Type Original: Improvement [ 4 ] New: New Feature [ 2 ]

            bitwiseman Liam Newman
            woland Alexander Siniouguine
            Votes:
            32 Vote for this issue
            Watchers:
            40 Start watching this issue

              Created:
              Updated:
              Resolved: