Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-33507] Add support for the Bitbucket server. #5

Merged
merged 6 commits into from Sep 17, 2016

Conversation

Eernie
Copy link
Contributor

@Eernie Eernie commented Jun 19, 2016

JENKINS-33507

I made some changes to the code to enable more support for Bitbucket server.
I also made a plugin for Bitbucket which is currently submitted for approval. When both installed Bitbucket can successfully send events to the jenkins machine.

See bitbucket-webhooks-plugin repo for more information about the Bitbucket plugin.
The plugin is also accepted by atlassian.

@reviewbybees

This commit serves to be able to use this plugin with the Bitbucket server instance. I'm also creating an plugin for Bitbucket server for this to work.
This will send ( just like the cloud ) events when a PR is created/updated and when a push is done.
This way we can use the same functionality for both Cloud and Server.
@ghost
Copy link

ghost commented Jun 20, 2016

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.

@tiny-dancer
Copy link

+1

1 similar comment
@Jurrie
Copy link

Jurrie commented Jun 23, 2016

+1

* Represents a push event coming from Bitbucket (webhooks).
*/
public interface BitbucketPushEvent
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, follow the current code style in the rest of the code base.

@amuniz
Copy link
Member

amuniz commented Jul 2, 2016

Looks good in general, and I like the idea to use an OSS plugin at Bitbucket side also, thanks for it.

I didn't have time to test it locally, but I want to do it. In the meantime, please fix the code style comments and merge with master (there are conflicts now).

…-plugin into feature/moreSupportForBBServer

# Conflicts:
#	src/main/java/com/cloudbees/jenkins/plugins/bitbucket/hooks/BitbucketSCMSourcePushHookReceiver.java
@Eernie
Copy link
Contributor Author

Eernie commented Jul 2, 2016

@amuniz Thanks for the review, I've resolved the conflict and fixed the code style.

@tiny-dancer
Copy link

image
;)

@nickbroon
Copy link

Is this now suitable for merging?

@amuniz amuniz changed the title Add support for the Bitbucket server. [JENKINS-33507] Add support for the Bitbucket server. Jul 20, 2016
@jreijn
Copy link

jreijn commented Jul 22, 2016

I've tested the PR locally in combination with https://marketplace.atlassian.com/plugins/nl.topicus.bitbucket.bitbucket-webhooks/server/overview . Works like a charm.

@Jurrie
Copy link

Jurrie commented Jul 29, 2016

@amuniz Can this PR be merged now? It seems your comments are processed.

@Eernie
Copy link
Contributor Author

Eernie commented Aug 1, 2016

@amuniz Had any time to test this lately? I think a lot of people are waiting on a new release with this. :)

@bhat-man
Copy link

bhat-man commented Aug 25, 2016

Please merge this. We just purchased a license of Cloudbees and can't do what we want without this.

FYI, I built and installed the plugin from snapshot and it doesn't appear to be working. I am using BitBucket Server version 4.5.2 and CloudBees version "Jenkins ver. 1.642.18.2 (CloudBees Jenkins Enterprise 15.11)" I am using the Webhook to Jenkins for Bitbucket plugin in BitBucket (https://marketplace.atlassian.com/plugins/com.nerdwin15.stash-stash-webhook-jenkins/server/overview)

@amuniz
Copy link
Member

amuniz commented Aug 26, 2016

@bhat-man the plugin this PR is developed against is this. I think you are using another one.

@bhat-man
Copy link

bhat-man commented Aug 26, 2016

I did try that one as well and had similar issues. I will build a fresh Jenkins server and test again. Is this the correct endpoint to use:

/bitbucket-scmsource-hook/notify

EDIT: Realized I was building the plugin off of master instead of the feature branch. After building from the correct branch I confirmed this is working as expected.

@Mktmac
Copy link

Mktmac commented Sep 12, 2016

Hi guys,

I was wondering if there's a timetable for the merge of this PR? I saw that everything seems to be working fine.

Thanks,
Dnaiel

@markottaviani
Copy link

Another Cloudbees customer here, very interested in seeing this get merged if all concerns have been satisfied. Big thinks to @Eernie for putting this together.

@aheritier
Copy link
Member

I will try to escalate it internally but I don't expect to have some help this week with Jenkins World. But if some of you are going to JW, don't hesitate to kidnapp @amuniz up until it reviews/merge/release it :-P

@Eernie
Copy link
Contributor Author

Eernie commented Sep 13, 2016

@aheritier Thanks for that, I'm hoping the list of PR's can be merged and released quickly. 👍

@amuniz
Copy link
Member

amuniz commented Sep 13, 2016

@aheritier with friends like you I prefer enemies 😛
This is going to be merged in a few days (I need to test it against a BB Server, which will take me some time).

BTW we need a way to test this kind of changes ideally without the need of a running BB Server, if someone come up with a solution for that, it would be more than welcome!! (maybe an embedded dumb JSON server returning static files suffice, TBD).

@aheritier
Copy link
Member

@amuniz 😗 ❤️ I love you too

@zackpollard
Copy link

Glad to hear this should be merged soon, was trying to use the auto webhook feature earlier today to find out it can only be used with bitbucket cloud! Good work all :)

@zackpollard
Copy link

@Eernie Is there any reason that this needs to use your own plugin for bitbucket? Could it not use the more widely used (and so more likely to be installed on an enterprise bitbucket) plugin found here https://marketplace.atlassian.com/plugins/com.atlassian.stash.plugin.stash-web-post-receive-hooks-plugin/server/overview

@Eernie
Copy link
Contributor Author

Eernie commented Sep 15, 2016

@zackpollard I've tried that first. But after implementing that version I noticed that you're limited to 5 Calls per repo and you're limited to pushes only. The hook wouldn't get triggered when making a pull request.
And implementing the "auto register" function would be imposible.

@zackpollard
Copy link

I believe that the pull request thing is actually a bug in the more recent versions of bitbucket. As for auto registering that would be possible as you can do it through the API, I have done this for another automated setup we are currently using.

via Newton Mail [https://cloudmagic.com/k/d/mailapp?ct=pa&cv=8.6.38&pv=7.0&source=email_footer_2] On Thu, Sep 15, 2016 at 9:38 PM, Erwin Oldenkamp < notifications@github.com [notifications@github.com] > wrote:
@zackpollard [https://github.com/zackpollard] I've tried that first. But after implementing that version I noticed that you're limited to 5 Calls per repo and you're limited to pushes only. The hook wouldn't get triggered when making a pull request.
And implementing the "auto register" function would be imposible.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub [https://github.com//pull/5#issuecomment-247448498] , or mute the thread [https://github.com/notifications/unsubscribe-auth/ABQLKvnjNoal3iyBfOnrmVCrxyrnhczwks5qqazagaJpZM4I5RB9] .

@Eernie
Copy link
Contributor Author

Eernie commented Sep 15, 2016

Then still there isn't a way to be as complient as the cloud version is. There you can choose the different events you want to send. The plugin you sent is a close source solution. So creating features for it wouldn't be posible. Therefor implementing the different kind of events wouldn't be possible.
The plugin is not written for this plugin only. We got more plans for it in the future :)

@zackpollard
Copy link

Yea it would just be nice to have additional options as in large enterprise wide bitbucket instances getting plugins installed can be difficult, so using what is already installed is easier :P

via Newton Mail [https://cloudmagic.com/k/d/mailapp?ct=pa&cv=8.6.38&pv=7.0&source=email_footer_2] On Thu, Sep 15, 2016 at 9:53 PM, Erwin Oldenkamp < notifications@github.com [notifications@github.com] > wrote:
Then still there isn't a way to be as complient as the cloud version is. There you can choose the different events you want to send. The plugin you sent is a close source solution. So creating features for it wouldn't be posible. Therefor implementing the different kind of events wouldn't be possible.
The plugin is not written for this plugin only. We got more plans for it in the future :)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub [https://github.com//pull/5#issuecomment-247452230] , or mute the thread [https://github.com/notifications/unsubscribe-auth/ABQLKhnNrMkoV5zKCfLXtJ3GbyLTmm5Vks5qqbAygaJpZM4I5RB9] .

amuniz added a commit that referenced this pull request Sep 17, 2016
@amuniz amuniz merged commit 6566de5 into jenkinsci:master Sep 17, 2016
@amuniz
Copy link
Member

amuniz commented Sep 17, 2016

This has been merged into master manually. I fixed some minor glitches (users being uppercase in Bitbucket Server) and other minor changes.

@Eernie Eernie deleted the feature/moreSupportForBBServer branch September 17, 2016 19:21
fengxx pushed a commit to fengxx/bitbucket-branch-source-plugin that referenced this pull request Mar 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet