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

Poll SCM and Timer triggers include "Changes" for a Pipeline for any/all Shared Libraries

    XMLWordPrintable

    Details

    • Similar Issues:
    • Sprint:
      Pipeline - July/August

      Description

      I noticed this while filing another ticket (JENKINS-41496), but the "Changes" view for the Pipeline run for this project "azure" has the "wrong commits" shown. See the screenshots for more.

      What basically appears to be happening is that any change to a Shared Library will result in newly triggered Pipelines which have "Poll SCM" configured. Pipelines which configure a timer will also have Changes from the Shared Library listed when it executes again.

      I think listing the Shared Library commits in "Changes" is acceptable, but triggering based on an SCM Poll for a Pipeline is very confusing behavior and IMHO incorrect behavior.

      As a shared tooling team, I would not expect my Shared Library changes to trigger a bunch of Pipelines for projects depending on them.

        Attachments

          Issue Links

            Activity

            Hide
            dordor dor s added a comment -

            Hi Tim Jacomb , thank you for your reply. I forgot to mention it but I already tried to configure it in the global config but it's not affect on my declarative pipeline which located in github organization. So in case that there are new commits in the shared library git repo I see those changes as part of the pipeline which can be confusing or affect the change set array that I use to detect what files has been changed 

            Show
            dordor dor s added a comment - Hi Tim Jacomb , thank you for your reply. I forgot to mention it but I already tried to configure it in the global config but it's not affect on my declarative pipeline which located in github organization. So in case that there are new commits in the shared library git repo I see those changes as part of the pipeline which can be confusing or affect the change set array that I use to detect what files has been changed 
            Hide
            ahammar Anders Hammar added a comment - - edited

            dor s We have the same issue with declarative pipelines where I can't figure out how to turn off changelog. The global configuration doesn't seem to work. It's turned off but changelogs is still included for shared libraries.
            We're using v2.17 of workflow-cps-global-lib-plugin.

            Show
            ahammar Anders Hammar added a comment - - edited dor s We have the same issue with declarative pipelines where I can't figure out how to turn off changelog. The global configuration doesn't seem to work. It's turned off but changelogs is still included for shared libraries. We're using v2.17 of workflow-cps-global-lib-plugin.
            Hide
            richmond Rich added a comment -

            I am facing similar issue. When I unselect 'Include @Library changes in job recent changes' and restart Jenkins, changelog does not show changes made to shared library but any change in shared library is still triggering the build.

            Show
            richmond Rich added a comment - I am facing similar issue. When I unselect 'Include @Library changes in job recent changes' and restart Jenkins, changelog does not show changes made to shared library but any change in shared library is still triggering the build.
            Hide
            dordor dor s added a comment -

            I still can't find a way to disable the change log for the shared library changes (which is not relevant for me) in declerative pipelines

             

            is seems that the default is true

            apperantly thhis is the relevant code:

             

                private Boolean changelog = true;
                ...
                // default to including changes of the library in job recent changes
                @DataBoundSetter public void setChangelog(Boolean changelog) {
                    this.changelog = changelog;
                }

             

            https://github.com/jenkinsci/workflow-cps-global-lib-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/libs/LibraryStep.java#L111-L114

             

            and this

             

                static void doRetrieve(String name, boolean changelog, @Nonnull SCM scm, FilePath target, Run<?, ?> run, TaskListener listener) throws Exception {
                    ...
                    delegate.setChangelog(changelog);

             

            https://github.com/jenkinsci/workflow-cps-global-lib-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/libs/SCMSourceRetriever.java#L139

             

            more info here: https://issues.jenkins.io/browse/JENKINS-41497?focusedCommentId=394574&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-394574

            Devin Nusbaum any chance that you can have a look?

             

            Show
            dordor dor s added a comment - I still can't find a way to disable the change log for the shared library changes (which is not relevant for me) in declerative  pipelines   is seems that the default is true apperantly thhis is the relevant code:   private Boolean changelog = true ; ... // default to including changes of the library in job recent changes @DataBoundSetter public void setChangelog( Boolean changelog) { this .changelog = changelog; }   https://github.com/jenkinsci/workflow-cps-global-lib-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/libs/LibraryStep.java#L111-L114   and this   static void doRetrieve( String name, boolean changelog, @Nonnull SCM scm, FilePath target, Run<?, ?> run, TaskListener listener) throws Exception { ... delegate.setChangelog(changelog);   https://github.com/jenkinsci/workflow-cps-global-lib-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/libs/SCMSourceRetriever.java#L139   more info here:  https://issues.jenkins.io/browse/JENKINS-41497?focusedCommentId=394574&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-394574 Devin Nusbaum  any chance that you can have a look?  
            Hide
            falloutphil Philip Beadling added a comment - - edited

            I have the same issue in declarative pipeline with fresh install of 2.263.3.

            With a multibranch declarative pipeline (Bitbucket Source Plugin) my job changelog contains very confusingly Git revision changes for my global pipeline library (loaded via git scm), but lists no changes from Bitbucket.

            Following advice I have unticked:

              Include @Library changes in job recent changes

             

            And also tried changing my Jenkinsfile annotation to:

            @Library(value='my-lib', changelog=false)

             

            But neither prevents the details appearing on clicking on a the build page for a completed job.

            I get GIt revision details on every job run from the last library update - irrespective if the library has been updated from the last job or not.

             

            Also I note that the declarative way of loading a libraries - using the libraries directive has no provision for setting the changelog parameter, as evidenced by this note in the source code:

            https://github.com/jenkinsci/pipeline-model-definition-plugin/blob/15978cd172a8d34e2cd6bf8a6bfeaa5514d44dad/pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/ModelParser.groovy#L743

             

            As Bitbucket doesn't use polling I don't have the problem of my jenkins library kicking off builds.

             

            FWIW - I think both kicking off builds and even reporting library changes should be turned off by default, it's taken me a fair bit of head-scratching to even understand where the commit ids came from - I had just assumed they were from my project source control for months.

             

            Show
            falloutphil Philip Beadling added a comment - - edited I have the same issue in declarative pipeline with fresh install of 2.263.3. With a multibranch declarative pipeline (Bitbucket Source Plugin) my job changelog contains very confusingly Git revision changes for my global pipeline library (loaded via git scm), but lists no changes from Bitbucket. Following advice I have unticked:   Include @Library changes in job recent changes   And also tried changing my Jenkinsfile annotation to: @Library(value='my-lib', changelog=false)   But neither prevents the details appearing on clicking on a the build page for a completed job. I get GIt revision details on every job run from the last library update - irrespective if the library has been updated from the last job or not.   Also I note that the declarative way of loading a libraries - using the libraries directive has no provision for setting the changelog parameter, as evidenced by this note in the source code: https://github.com/jenkinsci/pipeline-model-definition-plugin/blob/15978cd172a8d34e2cd6bf8a6bfeaa5514d44dad/pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/ModelParser.groovy#L743   As Bitbucket doesn't use polling I don't have the problem of my jenkins library kicking off builds.   FWIW - I think both kicking off builds and even reporting library changes should be turned off by default, it's taken me a fair bit of head-scratching to even understand where the commit ids came from - I had just assumed they were from my project source control for months.  

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              rtyler R. Tyler Croy
              Votes:
              80 Vote for this issue
              Watchers:
              87 Start watching this issue

                Dates

                Created:
                Updated: