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

Equivalent to polling commit exclusions for branch indexing

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: branch-api-plugin
    • Labels:
      None
    • Environment:
      Windows
    • Similar Issues:

      Description

      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.

        Attachments

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

          Issue Links

            Activity

            Hide
            maxime_lem Maxime Lemanissier added a comment - - edited

            I'm having a similar issue using pipeline library.

            When i merge a change on the master branch of my jenkins pipeline library, all jobs using this library (more than 100...) are all rebuilt simultaneously, which fills Jenkins queue for hours everytime a change is made on the library...

            This default behavior is probably well intended, as if the pipeline changes, all jobs using should be rebuilt, but when having a lot of jobs, this becomes unpractical/unusable. I would prefer to wait for the next manual build or SCM change on the project repository (not on the lib one) to trigger a new build.

            Is there a way to not trigger builds due to changes on the pipeline library?

            If not, can i use a specific naming convention for the master branch of the pipeline library, and excluding it from polling as shared in previous comment? Will this exclusion also apply on pipeline library?

            Show
            maxime_lem Maxime Lemanissier added a comment - - edited I'm having a similar issue using pipeline library. When i merge a change on the master branch of my jenkins pipeline library, all jobs using this library (more than 100...) are all rebuilt simultaneously, which fills Jenkins queue for hours everytime a change is made on the library... This default behavior is probably well intended, as if the pipeline changes, all jobs using should be rebuilt, but when having a lot of jobs, this becomes unpractical/unusable. I would prefer to wait for the next manual build or SCM change on the project repository (not on the lib one) to trigger a new build. Is there a way to not trigger builds due to changes on the pipeline library? If not, can i use a specific naming convention for the master branch of the pipeline library, and excluding it from polling as shared in previous comment? Will this exclusion also apply on pipeline library?
            Hide
            natefaerber Nate Faerber added a comment -

            I believe this is the feature I've been looking for.  It makes sense with the introduction of custom Jenkinsfile path to allow us to ignore changes that occur outside of the Jenkinsfile path.  Even that might be too restrictive.  It would solve a lot of people's problems if we can just specific the subdirectory we want to poll.  This would allow folks to put their Jenkinsfiles in completely different paths.

            Show
            natefaerber Nate Faerber added a comment - I believe this is the feature I've been looking for.  It makes sense with the introduction of custom Jenkinsfile path to allow us to ignore changes that occur outside of the Jenkinsfile path.  Even that might be too restrictive.  It would solve a lot of people's problems if we can just specific the subdirectory we want to poll.  This would allow folks to put their Jenkinsfiles in completely different paths.
            Hide
            nlowe_hyland Nathan Lowe added a comment -

            We'd love to see this as well. The closest I can get now is a step that scripts the currentBuild.result to ABORTED and fail the build. This shows up as skipped in some places:

            But failed in others:

            And jenkins reports the build as failed to Bitbucket.

            Show
            nlowe_hyland Nathan Lowe added a comment - We'd love to see this as well. The closest I can get now is a step that scripts the currentBuild.result to ABORTED and fail the build. This shows up as skipped in some places: But failed in others: And jenkins reports the build as failed to Bitbucket.
            Hide
            webrat Andreas Sieferlinger added a comment -

            any update on this?

            Show
            webrat Andreas Sieferlinger added a comment - any update on this?
            Hide
            tknerr Torben Knerr added a comment -

            +1 to what Kevin Phillips mentioned above. "Polling ignores commits in certain paths" is available for "normal" Pipelines, just not for Multibranch Pipelines.

            Jesse Glick any chance the extension to scm-api you mentioned in https://issues.jenkins-ci.org/browse/JENKINS-35988?focusedCommentId=295310&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-295310 are on the roadmap?

            (in my case, it would even be for the bitbucket-branch-source-plugin....)

            Show
            tknerr Torben Knerr added a comment - +1 to what Kevin Phillips mentioned above. "Polling ignores commits in certain paths" is available for "normal" Pipelines, just not for Multibranch Pipelines. Jesse Glick any chance the extension to scm-api you mentioned in https://issues.jenkins-ci.org/browse/JENKINS-35988?focusedCommentId=295310&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-295310 are on the roadmap? (in my case, it would even be for the bitbucket-branch-source-plugin....)

              People

              • Assignee:
                Unassigned
                Reporter:
                woland Alexander Siniouguine
              • Votes:
                32 Vote for this issue
                Watchers:
                38 Start watching this issue

                Dates

                • Created:
                  Updated: