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

Multibranch pipeline - ignore commits from certain user

    Details

    • Similar Issues:

      Description

      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?

        Attachments

          Activity

          ajit425 Ajit Patel created issue -
          it12lsp Christian Häussler made changes -
          Field Original Value New Value
          Component/s git-plugin [ 15543 ]
          Hide
          yo1_markenstein 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)

          Show
          yo1_markenstein 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)
          Hide
          rafi_tvtime Rafi Greenberg added a comment -

          +1 please!!!!

          Show
          rafi_tvtime Rafi Greenberg added a comment - +1 please!!!!
          Hide
          nicopaez Nicolas Paez added a comment -

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

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

          +1, would love to clean up my build history

          Show
          mrnorth Greg North added a comment - +1, would love to clean up my build history
          Hide
          dantran dan tran added a comment -

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

           

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

          yes please!!! any update on this?

          Show
          emoshaya_cognitoiq Ebrahim Moshaya added a comment - yes please!!! any update on this?
          Hide
          rsena Roberto Sena added a comment -

          +1

          Show
          rsena Roberto Sena added a comment - +1
          Show
          joshwand Josh Wand added a comment - found this: https://github.com/jenkinsci/ignore-committer-strategy-plugin   
          Hide
          obrejla 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 :/

          Show
          obrejla 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 :/
          Hide
          dantran dan tran added a comment -
          Show
          dantran dan tran added a comment - Josh Wand are you facing this issue https://groups.google.com/forum/#!topic/jenkinsci-users/jieSM8RX2TM   ?
          Hide
          jamesj2 James Johnson added a comment -

          +1

          Show
          jamesj2 James Johnson added a comment - +1
          Hide
          drdamour 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

          Show
          drdamour 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
          Hide
          drdamour 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

          Show
          drdamour 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
          Hide
          xbmono 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

          Show
          xbmono 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
          Hide
          drdamour 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

          Show
          drdamour 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
          Hide
          dantran dan tran added a comment -

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

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

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

          Show
          drdamour chirs damour added a comment - are you using the allmatch strategy to wrap two sub strategies? got a screen shot?
          dantran dan tran made changes -
          Attachment screenshot-1.png [ 46638 ]
          Hide
          dantran dan tran added a comment -

          uploaded my current build strategy settings

          Show
          dantran dan tran added a comment - uploaded my current build strategy settings
          Hide
          drdamour 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

          Show
          drdamour 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
          Hide
          dantran dan tran added a comment -

          ah, could you spell it out with a screenshot?

          Show
          dantran dan tran added a comment - ah, could you spell it out with a screenshot?
          drdamour chirs damour made changes -
          Hide
          drdamour chirs damour added a comment - - edited

          Show
          drdamour chirs damour added a comment - - edited
          Hide
          dantran 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

          Show
          dantran 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
          carpnick2 Nick Carpenter made changes -
          Attachment image-2019-04-05-08-14-52-491.png [ 46642 ]
          Hide
          carpnick2 Nick Carpenter added a comment -

          dan tran

          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.

          Show
          carpnick2 Nick Carpenter added a comment - dan tran 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.
          Hide
          drdamour 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

          Show
          drdamour 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
          Hide
          dantran dan tran added a comment -

          Nick Carpenter Thanks for the confirmation
          chirs damour 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

          Show
          dantran dan tran added a comment - Nick Carpenter Thanks for the confirmation chirs damour 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
          Hide
          drdamour 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

           

           

          Show
          drdamour 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    
          drdamour chirs damour made changes -
          Hide
          dantran dan tran added a comment -

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

          Show
          dantran dan tran added a comment - it is working now after reconfiguring the same setup again. Thanks for all the help.
          Hide
          xbmono Mohammad Norouzi added a comment -

          dan tran 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

          Show
          xbmono Mohammad Norouzi added a comment - dan tran 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
          Show
          drdamour 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
          Hide
          dantran 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

          Show
          dantran 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
          Hide
          drdamour chirs damour added a comment -

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

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

            People

            • Assignee:
              vaimr Denis Saponenko
              Reporter:
              ajit425 Ajit Patel
            • Votes:
              24 Vote for this issue
              Watchers:
              33 Start watching this issue

              Dates

              • Created:
                Updated: