jenkinsci / bitbucket-branch-source-plugin

Bitbucket Branch Source Plugin
https://plugins.jenkins.io/cloudbees-bitbucket-branch-source
MIT License
216 stars 351 forks source link

Ignore committers does not work #367

Open reitzmichnicht opened 4 years ago

reitzmichnicht commented 4 years ago

Your checklist for this issue

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

bitwiseman commented 4 years ago

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

reitzmichnicht commented 4 years ago

branch source This is a checkout behaviour setting

bitwiseman commented 4 years ago

@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 ?

reitzmichnicht commented 4 years ago

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?

bitwiseman commented 4 years ago

@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.

ryancurrah commented 4 years ago

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

xtroce commented 3 years ago

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?

diegosep commented 3 years ago

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

PrasannaShasthriDevOps commented 3 years ago

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

elopezvalecky commented 3 years ago

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.

KalleOlaviNiemitalo commented 3 years ago

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.

nicolasaigner commented 2 years ago

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

jaunusa commented 1 year ago

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.

capeflynn commented 1 year ago

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

CJCombrink commented 6 months ago

Any updates on this? Also having the same issue, I can't get the "Set ignored committers" to work and would really like to have this functionality