-
Improvement
-
Resolution: Unresolved
-
Critical
-
None
-
Jenkins 2.82, Plugins - git, gitHub, pipeline-multibranch,
-
Powered by SuggestiMate
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, in my case I see the option "Polling ignores commits from certain users" but it has no effect.
We are using BB to ignore the commit user, but is get reset every multi branch job rescanned ouch
+1
It is crucial to have this feature implemented...especially when your admins does not allow you to install plugins like ignore-committer-strategy :/
joshwand are you facing this issue https://groups.google.com/forum/#!topic/jenkinsci-users/jieSM8RX2TM ?
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
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
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
drdamour not working. Once i add the ignore committer email, it triggers all my PRs builds (many) to rebuild
are you using the allmatch strategy to wrap two sub strategies? got a screen shot?
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
arg.. not working for me. Is there a trace a can lookup? must be something very simple at my side
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 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
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
use git log to see what email is being used. the git plugin has a way to call git config to set the email
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
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
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
+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)