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

Multibranch pipeline - ignore commits from certain user

      I would like my Jenkins multibranch pipeline job to avoid triggering itself. The job makes a commit because it increments the version file and checks it into source control which causes an endless loop.

      In a regular Jenkins job I was able to avoid this loop by using additional behaviors configuration.( I set Polling ignores commits from certain users option to "Jenkins automation server" ).

      This functionality does not work for multibranch pipeline (there is no 'ignore commits from certain users' option). Is there any way in a Jenkins mulitbranch pipeline to prevent a self-triggered commit?

          [JENKINS-48296] Multibranch pipeline - ignore commits from certain user

          +1 to have this solved. I have the exactly the same issue and I don't see a work around without introducing too nasty side effects. (e.g. like aborting the build after checking the committer which will pollute the build history)

          Johan Markenstein added a comment - +1 to have this solved. I have the exactly the same issue and I don't see a work around without introducing too nasty side effects. (e.g. like aborting the build after checking the committer which will pollute the build history)

          +1 please!!!!

          Rafi Greenberg added a comment - +1 please!!!!

          Nicolas Paez added a comment -

          +1, in my case I see the option "Polling ignores commits from certain users" but it has no effect.

          Nicolas Paez added a comment - +1, in my case I see the option "Polling ignores commits from certain users" but it has no effect.

          Greg North added a comment -

          +1, would love to clean up my build history

          Greg North added a comment - +1, would love to clean up my build history

          dan tran added a comment -

          We are using BB to ignore the commit user, but is get reset every multi branch job rescanned    ouch

           

          dan tran added a comment - We are using BB to ignore the commit user, but is get reset every multi branch job rescanned    ouch  

          yes please!!! any update on this?

          Ebrahim Moshaya added a comment - yes please!!! any update on this?

          Roberto Sena added a comment -

          +1

          Roberto Sena added a comment - +1

          Josh Wand added a comment -

          Josh Wand added a comment - found this: https://github.com/jenkinsci/ignore-committer-strategy-plugin   

          Ondrej Brejla added a comment -

          +1

          It is crucial to have this feature implemented...especially when your admins does not allow you to install plugins like ignore-committer-strategy :/

          Ondrej Brejla added a comment - +1 It is crucial to have this feature implemented...especially when your admins does not allow you to install plugins like ignore-committer-strategy :/

          dan tran added a comment -

          dan tran added a comment - joshwand are you facing this issue https://groups.google.com/forum/#!topic/jenkinsci-users/jieSM8RX2TM   ?

          James Johnson added a comment -

          +1

          James Johnson added a comment - +1

          chirs damour added a comment - - edited

          it's not really clear from the help/docs (at least to me) but does the build happen if any of the stategies are met or only if all are met? (and vs or)  it seems like it might be an or, which makes the ignore committer strategy not very useful when other strategies are in there too

           

          code seems to indicate that's the case  https://github.com/jenkinsci/branch-api-plugin/blob/0ae692141b3ba878b9fd6c774c063fefdd7ff7c2/src/main/java/jenkins/branch/MultiBranchProject.java#L2224

           

          as such these suggestions kinda suck for any custom case

          chirs damour added a comment - - edited it's not really clear from the help/docs (at least to me) but does the build happen if any of the stategies are met or only if all are met? (and vs or)  it seems like it might be an or, which makes the ignore committer strategy not very useful when other strategies are in there too   code seems to indicate that's the case  https://github.com/jenkinsci/branch-api-plugin/blob/0ae692141b3ba878b9fd6c774c063fefdd7ff7c2/src/main/java/jenkins/branch/MultiBranchProject.java#L2224   as such these suggestions kinda suck for any custom case

          chirs damour added a comment -

          to work around this i created a plugin that supported ANDing and ORing sub strategies.  I submitted a PR for this to https://github.com/jenkinsci/basic-branch-build-strategies-plugin/pull/3

          chirs damour added a comment - to work around this i created a plugin that supported ANDing and ORing sub strategies.  I submitted a PR for this to  https://github.com/jenkinsci/basic-branch-build-strategies-plugin/pull/3

          We need this feature. We can't automatically bump up our libraries version as they get stuck in a loop

          Mohammad Norouzi added a comment - We need this feature. We can't automatically bump up our libraries version as they get stuck in a loop

          chirs damour added a comment - - edited

          my pr got merged and plugin got released so you can use the all match with nested https://github.com/jenkinsci/ignore-committer-strategy-plugin and whatever your normal strategy is. im doing this in our builds with much success jenkins commits and no build happens

          chirs damour added a comment - - edited my pr got merged and plugin got released so you can use the all match with nested https://github.com/jenkinsci/ignore-committer-strategy-plugin and whatever your normal strategy is. im doing this in our builds with much success jenkins commits and no build happens

          dan tran added a comment -

          drdamour not working. Once i add the ignore committer email, it triggers all my PRs builds (many) to rebuild

          dan tran added a comment - drdamour not working. Once i add the ignore committer email, it triggers all my PRs builds (many) to rebuild

          chirs damour added a comment -

          are you using the allmatch strategy to wrap two sub strategies? got a screen shot?

          chirs damour added a comment - are you using the allmatch strategy to wrap two sub strategies? got a screen shot?

          dan tran added a comment -

          uploaded my current build strategy settings

          dan tran added a comment - uploaded my current build strategy settings

          chirs damour added a comment -

          so you didnt do what ive suggested at all. by default build strategies are or'd. you need to wrap them in an all match to make them AND'd

          chirs damour added a comment - so you didnt do what ive suggested at all. by default build strategies are or'd. you need to wrap them in an all match to make them AND'd

          dan tran added a comment -

          ah, could you spell it out with a screenshot?

          dan tran added a comment - ah, could you spell it out with a screenshot?

          chirs damour added a comment - - edited

          chirs damour added a comment - - edited

          dan tran added a comment - - edited

          arg.. not working for me. Is there a trace a can lookup? must be something very simple at my side

          dan tran added a comment - - edited arg.. not working for me. Is there a trace a can lookup? must be something very simple at my side

          dantran

          This works for me.  Make sure when the CI does the commit its registered by your git provider as the right email address.  That is the requirement here.  Otherwise the plugin cant tell who its coming from.

          Nick Carpenter added a comment - dantran This works for me.  Make sure when the CI does the commit its registered by your git provider as the right email address.  That is the requirement here.  Otherwise the plugin cant tell who its coming from.

          chirs damour added a comment -

          @nick carpenter thanks for confirmation.

          @dan tran yeah check the jenkins system log and build log.

          fwiw saying "not working" is pretty worthless. u should always include what you've been trying, what you expect, and whats actually happening every time you think "not working". especially as you try new things. makes it way easier for others to help you

          chirs damour added a comment - @nick carpenter thanks for confirmation. @dan tran yeah check the jenkins system log and build log. fwiw saying "not working" is pretty worthless. u should always include what you've been trying, what you expect, and whats actually happening every time you think "not working". especially as you try new things. makes it way easier for others to help you

          dan tran added a comment -

          carpnick2 Thanks for the confirmation
          drdamour sorry about the short whine, I had the exact same configuration as suggested. The only culprit I can think of is my email input which I get it from BB user profile

          dan tran added a comment - carpnick2 Thanks for the confirmation drdamour sorry about the short whine, I had the exact same configuration as suggested. The only culprit I can think of is my email input which I get it from BB user profile

          chirs damour added a comment - - edited

          use git log to see what email is being used. the git plugin has a way to call git config to set the email

           

           

          chirs damour added a comment - - edited use git log to see what email is being used. the git plugin has a way to call git config to set the email    

          dan tran added a comment -

          it is working now after reconfiguring the same setup again. Thanks for all the help.

          dan tran added a comment - it is working now after reconfiguring the same setup again. Thanks for all the help.

          dantran I assume these changes you guys are talking about haven't been merged and released yet. Is that right? or can we use the plugin now?

          Thanks

          Mohammad Norouzi added a comment - dantran I assume these changes you guys are talking about haven't been merged and released yet. Is that right? or can we use the plugin now? Thanks

          chirs damour added a comment - everything is released cf  https://issues.jenkins-ci.org/browse/JENKINS-48296?focusedCommentId=364281&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-364281

          dan tran added a comment - - edited

          Things went well until I picked up the latest plugins on 4/11. All BB branch source events, except the PR events, sent to Jenkins are ignored. Ended up to remove the settings

          Any one facing the same issue? or it is just me

          dan tran added a comment - - edited Things went well until I picked up the latest plugins on 4/11. All BB branch source events, except the PR events, sent to Jenkins are ignored. Ended up to remove the settings Any one facing the same issue? or it is just me

          chirs damour added a comment -

          yup they broke it with JENKINS-38552 i filed JENKINS-56984

          chirs damour added a comment - yup they broke it with  JENKINS-38552 i filed  JENKINS-56984

            Unassigned Unassigned
            ajit425 Ajit Patel
            Votes:
            25 Vote for this issue
            Watchers:
            34 Start watching this issue

              Created:
              Updated: