bitbucket-branch-source-plugin icon indicating copy to clipboard operation
bitbucket-branch-source-plugin copied to clipboard

Ignore committers does not work

Open reitzmichnicht opened this issue 4 years ago • 15 comments

Your checklist for this issue

  • [x] Jenkins version 2.249.1
  • [x] Plugin version 2.9.2
  • [x] Bitbucket server and version Bitbucket Server 6.6.1

Description

Setting ignored committers for a multibranch pipeline with a bitbucket source does not work. The description says the webhook is configured accordingly, but the integrated webhook approach in bitbucket server does not allow this setting. We really need this feature to ignore the Jenkins as committer itself or ignore by commit message.

Kind regards, Michael

reitzmichnicht avatar Sep 11 '20 14:09 reitzmichnicht

@reitzmichnicht Which "ignored committers" setting? Could show a screenshot?

bitwiseman avatar Sep 11 '20 16:09 bitwiseman

branch source This is a checkout behaviour setting

reitzmichnicht avatar Sep 14 '20 21:09 reitzmichnicht

@reitzmichnicht Ah, you're using this: https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/b5a8011f6a03cc8860f2c8ebd039f44086f31d6a/src/test/java/com/cloudbees/jenkins/plugins/bitbucket/WebhookConfigurationTraitTest.java

Have you looked at https://github.com/jenkinsci/ignore-committer-strategy-plugin ?

bitwiseman avatar Sep 21 '20 20:09 bitwiseman

I'll take a look and test it, was not aware that it supports organizationalFolder of bitbucket as its a bit outdated.

Nonetheless the provided bitbucket trait ignore committers seems to be legacy for not native webhooks?

reitzmichnicht avatar Sep 22 '20 09:09 reitzmichnicht

@reitzmichnicht

Nonetheless the provided bitbucket trait ignore committers seems to be legacy for not native webhooks?

I'm not sure. I don't have bandwidth to delve much on this issue currently.

bitwiseman avatar Sep 22 '20 21:09 bitwiseman

The plugin https://github.com/jenkinsci/ignore-committer-strategy-plugin is def what your looking for. I made the same mistake when I started.

ryancurrah avatar Sep 25 '20 16:09 ryancurrah

I ran into the same problem, with configuring the ignored commiter and it not being working diving into debugging. Wouldn't it be better to remove the internal plugin and just mentioning in the documentation that if you should use another plugin to do that, instead of leaving an essentially non working function in the code?

xtroce avatar Apr 12 '21 09:04 xtroce

Hi, I confirm, this feature of the plugin is not working, I tried either email, name, or more options and it does not work.

diegosep avatar Jul 26 '21 19:07 diegosep

I can confirm too that this feature is not working for us.

PrasannaShasthriDevOps avatar Aug 04 '21 11:08 PrasannaShasthriDevOps

After digging around this I found out that if you are using Native Hook (or the called webhook in BitBucket) this feature is not supported at least not in BitBucket Server 6.x... but if you use the Plugin Hook (the so called "Webhook to Jenkins for Bitbucket Server") then you can use this feature... What it makes documentation not clear how to use it.

The other plugin mentioned in here "ignore-committer-strategy-plugin" wont work if you still use the BitBucket plugin for checkout.

elopezvalecky avatar Aug 27 '21 16:08 elopezvalecky

From Bitbucket Server native webhooks, the plugin could easily extract the actor who pushed the commits. It could then filter with that. The actor might not always be the same as the author or the committer, but I think it would work fine for ignoring pushes made by Jenkins, if Jenkins has its own user account in Bitbucket Server.

KalleOlaviNiemitalo avatar Aug 27 '21 21:08 KalleOlaviNiemitalo

Any feedback on this? I have the same problem and I don't want to install other plugins.

nicolasaigner avatar Jul 14 '22 00:07 nicolasaigner

Having the same issue trying to ignore committers with this plugin using v7.x for server version, running Bitbucket version v7.21.10. Bitbucket Branch Source Plugin version: 796.v6cb_1559e1673 Jenkins version: 2.361.1 Switching to "Plugin" at "Webhook implementation to use" does not create webhooks in Bitbucket repository and throws a Jenkins warning:

Mar 15, 2023 10:04:01 AM WARNING org.apache.http.client.protocol.ResponseProcessCookies processCookies
Invalid cookie header: "Set-Cookie: BITBUCKETSESSIONID=XXXXXX; Max-Age=1209600; Expires=Wed, 29 Mar 2023 09:04:01 GMT; Path=/; Secure; HttpOnly". Invalid 'expires' attribute: Wed, 29 Mar 2023 09:04:01 GMT
Mar 15, 2023 10:04:01 AM WARNING com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener$1 doRun
Could not register hooks for MIS Group/misreport
java.io.FileNotFoundException: URL: /rest/webhook/1.0/projects/MISG/repos/misreport/configurations
	at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getRequest(BitbucketServerAPIClient.java:879)
	at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getWebHooks(BitbucketServerAPIClient.java:733)
	at com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener.registerHook(WebhookAutoRegisterListener.java:167)
	at com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener.registerHooks(WebhookAutoRegisterListener.java:133)
	at com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener.access$000(WebhookAutoRegisterListener.java:56)
	at com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener$1.doRun(WebhookAutoRegisterListener.java:102)
	at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:94)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

EDIT: In these code lines we can see, why the ignore committers setting is ignored when "Native" is selected in the config: https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/e09b562a787bacef1a0ee577020ace97decd528f/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/hooks/WebhookConfiguration.java#L121

Is there are Plugin needed on Bitbucket when using Plugin for "Webhook implementation to use" in Jenkins config? The only plugin I can find is this: https://marketplace.atlassian.com/apps/1211284/webhook-to-jenkins-for-bitbucket?hosting=server&tab=overview But its no more possible to install it to a Bitbucket server instance.

jaunusa avatar Mar 15 '23 09:03 jaunusa

Does anyone know if there are plans to fix this issue or if there is already a workaround we could use?

capeflynn avatar Nov 13 '23 19:11 capeflynn