-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[bitbucket-server] support for projects and prebuilds #8896
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
Conversation
Awesome work - we really need this change. |
@AlexTugarev Can you raise this within the team to get a review this week? Maybe from Jan? |
/werft run 👍 started the job as gitpod-build-at-bbs.14 |
New project flow fails to fetch branches (upper-case/lower-case issue?) for repo at |
Project on personal repo is able to fetch branches. ✅ |
The button to start a new workspace after creating a new project on a personal repo, appears to create a broken context url since it uses the clone url path |
@jldec, please check again 🙏🏻 Also, pay attention to the In your case, which is assumingely uncommon, there is a project and a user account named equally. Something you would not expect to be possible. I've change the workaround to try projects first, this should resolve the issues from above as well. Let's see if we need a 3rd round 🤞🏻 |
Just found an issue with the New Project wizard, which was actually reported several times, but we seem to not have found a repro for: I'll make a drive-by-change to exclude them from the results of |
I'm unable to see prebuilds for my project: Steps:
|
@inject(BitbucketServerContextParser) protected contextParser: BitbucketServerContextParser; | ||
|
||
async getRepositoriesForAutomatedPrebuilds(user: User): Promise<ProviderRepository[]> { | ||
const repos = await this.api.getRepos(user, { limit: 100, permission: "REPO_ADMIN" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] Would be good to comment that we're requesting REPO_ADMIN because that's the minimum role required to create webhooks.
if (permission && ["REPO_ADMIN", "PROJECT_ADMIN"].indexOf(permission) !== -1) { | ||
return true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] It can be sometimes helpful to communicate the reasoning for a particular check though a method name. For example:
if (hasPermissionToCreateWebhooks(permission) {
@easyCZ, please invite me to your project to reproduce #8896 (comment) |
Many thanks for implementing BBS! 🏭 Gave this a spin, and was able to successfully add a Bitbucket project! 🎉 Minor: The UI looks a little bit unpolished still --
Also, I wasn't able to start a workspace for some reason:
|
@jankeromnes thanks for asking on the
That indicated personal projects. As @jldec managed to create a personal and a regular project of the same name, I'd consider that a "feature"! Seriously, I've no idea of how to treat that properly. Ambiguity of project name is hard. Let's have the |
Okay, I was now able to push changes to my BBS repository. Unfortunately, no Prebuilds are being triggered. When I try the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've tested this as far as I can and seems to work. There are still some rough edges on the integration (largely due to BitBucket Server being a bit crazy) but I think this is a good enough 🛹 .
Code-wise, looks sensible but I don't yet have full context to know if there are skeletons.
/hold |
Nice! Feels like this is closing in on the finish line. 🏁 I've noticed a few remaining rough edges though:
(The project is actually still created, but I guess without a webhook, because prebuilds do not trigger automatically on pushes) |
I was a bit surprised to get the extra login button when I start a totally new session - if we ship this and configure our BBS integration for testing, we don't want everyone else (non-gitpod) who lands on gitpod.io for the first time to see the extra button. Can you confirm that this will not be the case for SaaS? |
Regarding the button formatting - the lack of image, and the way the button text bleeds to the edges does look unpolished. I understand that it's cosmestic, but the first impression users see is important as well. |
@jldec, don't worry, one need to do a backflip to get it running on self-hosted, there is no path for this to get initialized on SaaS. |
Thanks @jankeromnes, overlooked your issue with the 404 error. I could reproduce it on a fork. Trying to get this sorted out before proceeding. editAwesome! That was indeed a bug in "can install webhook" logic for repos in personal accounts. There is an API which should not be called for personal accounts, but it was. I changed and updated the branch. |
/unhold |
Description
This enables prebuilds for Bitbucket Server integrations.
Breaking Changes
PUBLIC_REPOS, REPO_READ, REPO_WRITE, REPO_ADMIN, PROJECT_ADMIN
Identity.authName
mapping, users need to re-login to get that updated, otherwise repository services wont be able to read permissions properly.Related Issue(s)
Fixes #8455
How to test
TODO
Known issues or out of scope
Release Notes