28 Comments

This plugin triggers builds even if pr/commit was already built. Is that a bug? I have one open PR in my bitbucket repository and in jenkins job configuration in bbprb plugin section cron field i have "* * * * *" so it triggers build every minute for the same PR/commit.

I expected that it will check every minute for untested commits in PRs and if all of them were already built then the build would not be triggered. Am I missing something here?

Same for me. After v1.4.8 all my pull requests are continuously rebuilt. Even more, since one build lasts 15 minutes, every minute new build is triggered. I am currently using v1.4.7 because it was last one which worked correctly.

this is quite old issue....I'm not aware of any issue like that. I've been using it in my team quite heavily every day. You can give it a try and let us know.

P.S. I started working on bitbucket-pullrequest-plugin one month ago...and some old issues might have been already fixed by original author. Thus I try to focus on newly reported issues and the one I'm aware of...

It'd be nice if I can set the name of the repository using a variable collected as a Build parameter instead of having to hard code it. If I don't hardcode the name of the repository, the cron expression does not trigger the job when a PR is generated in bitbucket. Otherwise, all good!!

Could you please give a clue on how to define the BIT_BUCKET_PATH in a pipeline configuration? This is in the documentation without explanation:

bitbucketpr(projectPath:'<BIT_BUCKET_PATH>', ...

For example, if my repository is at "bitbucket.org:${repositoryOwner}/${repositoryName}.git", then should BIT_BUCKET_PATH be the whole URL, only the base URL "bitbucket.org", only the path to the repo "${repositoryOwner}/${repositoryName}" or even something else?

I tried all I could think of in the Jenkinsfile of my Multibranch Pipeline... but no pull-request yet triggered a build

Am encountering the same issues that Raitis and Nenad reported above: Cron keeps spamming new PR jobs even though they're unchanged in the repo. I looked at the source code at https://github.com/nishio-dens/bitbucket-pullrequest-builder-plugin and don't seem to find any "skip new one if nothing's changed" logic, only "abort previous ones if queued or running". Anyone who can help?

Hello all, I am using the below configuration in my Jenkins pipeline file but my Jenkins server send the inprogress build status to bit bucket using the CI key but it is not updating the status once the build is finished. when I tried using the same plugin in free style project it send the build status using the CI name and updates the build status also once the build is finished.triggers{bitbucketpr(projectPath:'################################',cron:'* * * * *',credentialsId:'##################',username:'########',password:'#########',repositoryOwner:'#####',repositoryName:'#####',branchesFilter:'',branchesFilterBySCMIncludes:false,ciKey:'',ciName:'',ciSkipPhrases:'',checkDestinationCommit:true,approveIfSuccess:true,cancelOutdatedJobs:true,commentTrigger:'test this please')}

This plugin has been working wonderfully for me for the past year or more. I'm using it to run sonarqube analysis on the Bitbucket Pull request code and post results directly in the PR for reviewers to see. I'll post my configuration in hopes it will help someone. Let me know if you have any other questions.

its been a while since I worked on this, but the way its supposed to work is that a full analysis is done already on the code and any new code that is in the PR will trigger an incremental over the already analyzed code. But our full analysis is not possible as we have 2 million lines of code and it never finishes on time. So, I'm pulling the changes in each PR in the jenkins job and running analysis only on it and posting results in bitbucket.

On the sonarqube side, I have installed the plugin 'Bitbucket for Sonar' version 1.2.3

On Bitbucket side I have created OAuth consumer and the key and secret are in the configuration below.

More details...

I have disabled manual triggering of this job as it will try to analyze all the open pull requests. At one time we had close to 100 or more open PR's and imagine the catastrophe of emails and what not. LOL

Eventhough I use groovy declarative pipelines, for this exercise I stuck with the standard freestyle job in Jenkins. I did try, but dont have the time or patience to work on porting this to the declarative pipelines. So, I think that already answers one question from above.

Our code is in private Bitbucket repo. We are using Bitbucket cloud and not Bitbucket server. Please note that detail.

The branch specifier is ** I could be wrong, but I believe this has to be ** so it can process any branch name. The PR is technically a branch which gets merged to the parent. So, if you put master on it, since there can be Pull request branch called master, it will not work.H

# OAuth credentials created under <COMPANY-NAME> account in bitbucketsonar.bitbucket.oauthClientKey=<Created in bitbucket>sonar.bitbucket.oauthClientSecret=<Created in bitbucket>sonar.bitbucket.approvalFeatureEnabled=false

# This project does not need to existsonar.projectKey=${REPO_NAME}sonar.sources=${FILES_TO_ANALYZE}sonar.bitbucket.branchName=${GIT_BRANCH}

# These are set in sonarqubesonar.login=<Sonarqube user name with rights to run analysis>sonar.password=<password>sonar.host.url=http://<IP - ADDRESS of sonarqube server> sonar.analysis.mode=previewsonar.cxx.cppcheck.reportPath=./cpp_report.xmlsonar.bitbucket.minSeverity=CRITICAL

I've been trying to figure out why the build result is not being updated in Bitbucket.

My job gets triggered properly when a PR is created or a commit to exiting PR is pushed and when I look at the commits, I see the "build in progress" icon but it doesn't get updated to "build successful" upon completion. The build does succeed without error as well.

I recently upgraded my branch strategy and I'm having difficulty getting the builds to run automatically. When I configure the strategies, the project is scanned by Jenkins, the proper multi-branch pipelines are created and the builds execute like I think they should. However, subsequent pushes to the repository are ignored by the Multi-branch builds in the organization folder.

From what I can tell, the organization scan runs correctly, but the multi-branch pipelines do not. When you run the multi-branch scan manually, all of the proper jobs are picked up.

First of all, Thanks a ton to this team for having built this very useful plug-in. I have 2 issues

This is Most Critical to me. Using the BranchesFilter option, I would like to run different Build jobs for source branches having different name patterns. For instance, I would like to run BuildJob1 for all pull requests whose source branches have names starting with a pre-defined text, say, ABC. Similarly, I would like to run BuildJob2 for all pull requests whose source branches have names starting with yet another pre-defined text, say, XYZ.

I have tried all combinations of filter values in the BranchesFIlter (both in SCM and BitBucket Pull Request builder), text, regex, etc. Nothing seems to work for me. All pull request (both conforming to the specified pattern or otherwise) keep triggering my BuildJob. Been struggling with this for months now.

2. The other one is, I am unable to change the default build trigger text. If I change it to anything other than "test this please", it does not trigger the build.