Most critical issues found with Bitbucket pullrequest builder plugin is no control in triggering builds by open pull requests. When the plugin is initially installed & configured, all open pull requests will be triggered, which might crash the system when there are many open PRs. Besides, whenever a user creates a PR or commits a change, the build will be triggered, causing massive unnecessary build processes and failures. Users like to control the triggering of builds when it's ready.
Suggestion: add a checkbox like below
Only build if asked with the build phrase |
Plugin Information |
---|
View Bitbucket Pullrequest Builder on the plugin site for more information. |
28 Comments
Unknown User (raitis)
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?
Unknown User (johannsig)
Hi Raitis. Did you get this sorted out?
Unknown User (dodoent)
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.
Unknown User (johannsig)
Hi Nenad. Did you get this sorted out?
Unknown User (cayanbr)
This plugin does not support pipeline projects.
Unknown User (damovsky)
check out the latest release 1.4.21. This plugin suports Jenkins pipeline now...
Unknown User (damovsky)
Hi all,
today I made a new release of bitbucket pullrequest plugin. It does supports Jenkins Pipelines!
give it a try and let me know then!
Martin
Unknown User (yairs)
@Martin - Is the issue mentioned by @Raitis and @Nenad fixed (rebuilding same PR)?
Yair
Unknown User (damovsky)
Hi @yair_segal!
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...
Martin
Unknown User (yairs)
After a few days of trying this plugin it seems the behaviour is good.
Unknown User (damovsky)
thanks for info!
Unknown User (sreeramk)
Works great!! Thanks for such a useful plugin.
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!!
Unknown User (dokaspar)
Hi,
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:
Unknown User (dokaspar)
Can this plugin also be used for private Bitbucket servers?
Unknown User (renescheibe)
It looks like that only the public instance is supported (the URL is hardcoded in the sources).
That's also stated in the plugin's description "This plugin builds pull requests from Bitbucket.org and will report the test results.".
Unknown User (johannsig)
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?
Unknown User (johannsig)
This might work properly using post-hooks, but since our build server is on-site and not exposed to the web it's Cron or nothing, I fear.
Unknown User (fhamel_arimasoft)
Hey Johann. My comment below might help you with the job spam : Re: Bitbucket pullrequest builder plugin
Unknown User (pavanreddy)
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')
}
Unknown User (flemmingdjensen)
Hi,
We would really like to use this plugin in order to automatically build new pull request and so forth.
But I really cannot get it to work,
On the GitHub page it says create a new job. Is this a Freestyle job?
When I use the following:
git@bitbucket.org:${repositoryOwner}/${repositoryName}.git
*/${sourceBranch}
Jenkins doesn't seem to recognize the ${} parameters? How can I get this to work?
What is the meaning by RepositoryOwner and RepositoryName?
Then the guideline tells about pipeline???
So next step is to create a pipeline job in jenkins? And paste the example in?
If I run this pipeline project - it complains about missing stages information
So as you see - I am really in deep water here?
Can this plugin work for me?
We are using jenkins version 2.121.1
BR Flemming
Unknown User (samkr)
Hello everyone
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...
echo "
sonar.bitbucket.repoSlug=${REPO_NAME} <--- This is simply the repository name. Nothing else.
sonar.bitbucket.accountName=<COMPANY-NAME>
sonar.bitbucket.teamName=<COMPANY-NAME>
# OAuth credentials created under <COMPANY-NAME> account in bitbucket
sonar.bitbucket.oauthClientKey=<Created in bitbucket>
sonar.bitbucket.oauthClientSecret=<Created in bitbucket>
sonar.bitbucket.approvalFeatureEnabled=false
# This project does not need to exist
sonar.projectKey=${REPO_NAME}
sonar.sources=${FILES_TO_ANALYZE}
sonar.bitbucket.branchName=${GIT_BRANCH}
#sonar.inclusions=**/*.C
sonar.exclusions=**/*.H, **/*.h, **/GENVOIP/GenClientLib/**/*, src/CLIENTLIB/GENVOIP/GenClientLib/samples/INI1Sim/sim.C, src/CORE/RHOST/lib/RHOST_G.C, **/TEST/*
# These are set in sonarqube
sonar.login=<Sonarqube user name with rights to run analysis>
sonar.password=<password>
sonar.host.url=http://<IP - ADDRESS of sonarqube server>
sonar.analysis.mode=preview
sonar.cxx.cppcheck.reportPath=./cpp_report.xml
sonar.bitbucket.minSeverity=CRITICAL
" > sonar-project.properties
# Invoke the sonar scanner
/home/support/sonar-scanner-3.0.3/bin/sonar-scanner
The jenkins configuration of the pull request plugin is below.
Unknown User (fhamel_arimasoft)
For those of you who have the problem that pull requests are continuously rebuilding, try to change your jenkins URL from "http://servername/jenkins" to "http://servername.local/jenkins". BitBucket API seems to treat the first URL as invalid. Here is where I found the solution : https://github.com/nishio-dens/bitbucket-pullrequest-builder-plugin/issues/62#issuecomment-223901248
I hope it will help some of you.
F. Hamel
Unknown User (ganesh1991)
This plugin does not work as expected. Jenkins should kick off the build only when the "Comment phrase to trigger build" is commented on Bitbucket PR.
Does anyone have a solution for this??
Current config:
CRON : H/2 * * * *
Comment phrase to trigger build: build
It is not building when build ("Comment phrase to trigger build") is commented on Bitbucket PR. But it builds every 2 mins defined in the CRON.
Unknown User (newlix)
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.
At this point, I'm just out of ideas on how to debug this.
Unknown User (geraldi29)
check here JENKINS-53572 - Getting issue details... STATUS
Unknown User (pcadigan)
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.
Unknown User (kathir06)
In my case developer forked the main repository and give the pull request to main repo ,so without adding fork repository in the jenkins pipeline is there is anyway build the pull request?
Unknown User (vishnu87)
First of all, Thanks a ton to this team for having built this very useful plug-in. I have 2 issues
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.
Any help on this would be much appreciated.