Small improvements and fix#114
Conversation
6863a06 to
210fea0
Compare
1422b8b to
b0f3b85
Compare
KalleOlaviNiemitalo
left a comment
There was a problem hiding this comment.
I'm not actually using this plugin, so the changes won't affect me either way, but I wanted to share my observations.
| <dependency> | ||
| <groupId>org.jenkins-ci.plugins</groupId> | ||
| <artifactId>cloudbees-bitbucket-branch-source</artifactId> | ||
| </dependency> |
There was a problem hiding this comment.
Could perhaps be an optional dependency.
There was a problem hiding this comment.
@KalleOlaviNiemitalo what will be the case in an official delivery where this then is not included? I think that in this area I'm newbie.
There was a problem hiding this comment.
I mean, you can make the Bitbucket plugin check at run time whether the Bitbucket Branch Source plugin has been installed; if it has not been installed, then skip the scm instanceof BitbucketSCMSource checks so that class BitbucketSCMSource need not exist. There are instructions in https://www.jenkins.io/doc/developer/plugin-development/optional-dependencies/. But this is only a suggestion.
There was a problem hiding this comment.
Ok, make sense. I will give a try on this.
| gitRemote = ((BitbucketSCMSource) scm).getServerUrl() + "/" + | ||
| ((BitbucketSCMSource) scm).getRepoOwner() + "/" + | ||
| ((BitbucketSCMSource) scm).getRepository(); |
There was a problem hiding this comment.
This URL structure looks specific to Bitbucket Cloud, incompatible with Server and Data Center.
There was a problem hiding this comment.
@KalleOlaviNiemitalo this define a generic match. Why should be incompatible? The code just decouple a different type coming.
There was a problem hiding this comment.
My mistake. In Bitbucket Server, the web UI uses URLs like https://bitbucket.example:8443/projects/DEMOPROJ/repos/demorepo/browse, which includes the "projects" and "repos" keywords. I worried that this pull request does not add those keywords and might then be incompatible. However, in Bitbucket Server, git clone uses URLs like ssh://git@bitbucket.example:7999/DEMOPROJ/demorepo.git or https://bitbucket.example:8443/scm/demoproj/demorepo.git; these do not include the "projects" and "repos" keywords. So this pull request seems compatible after all.
b0f3b85 to
3dbaa03
Compare
|
Because I'm not using this plugin and am not a real Java programmer, I don't feel I can review this properly. But, please give the pull request a more descriptive title so that users who read the release notes will understand what changed. |
|
@jenkinsci/bitbucket-plugin-developers Hi there, any time to review this patch? |
…/bitbucket-hook Allow to run webhook behind a firewall (example smee.io) Before: sirio smee[2620767]: POST http://127.0.0.1:8080/bitbucket-hook/ - 403 After: sirio smee[2620767]: POST http://127.0.0.1:8080/bitbucket-hook/ - 200 Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Extend the plugin to support the BitbucketSCMSource. This allow to trigger build coming from this source Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
if( to if ( and ){ to ) {
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
3dbaa03 to
4763f88
Compare
We established a Jenkins multibranch pipeline project to monitor multiple Bitbucket repositories, specifically designed for building complex operating systems like Yocto. This setup leverages the Jenkins Remote File Provider plugin (https://plugins.jenkins.io/remote-file/) to enable the use of a single Jenkinsfile across all monitored repositories (e.g., meta-company, meta-extra-company).
Our infrastructure includes Jenkins behind a firewall, which initially caused webhook crumb issues. To resolve this, we employed smee.io to bypass the firewall and facilitate reliable webhook delivery from Bitbucket Cloud to Jenkins.
The Jenkins instance utilizes the Bitbucket Branch Source plugin, resulting in requests being processed as BitbucketSCMSource. This source, however, lacked the getRemote method, requiring specific patches for proper functionality.
Testing done
Testing was conducted within our infrastructure, confirming successful build triggering upon both push and pull request events from Bitbucket Cloud to our firewall-protected Jenkins instance