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

[bitbucket] enable projects #7251

Merged
merged 1 commit into from
Dec 17, 2021
Merged

[bitbucket] enable projects #7251

merged 1 commit into from
Dec 17, 2021

Conversation

AlexTugarev
Copy link
Member

@AlexTugarev AlexTugarev commented Dec 15, 2021

Resolves #5980

This also adds a test of permissions on webhook installations.

Screen Shot 2021-12-15 at 14 32 29

Enables bitbucket.org repositories in Teams & Projects

@AlexTugarev
Copy link
Member Author

AlexTugarev commented Dec 16, 2021

/werft run with-clean-slate-deployment

👍 started the job as gitpod-build-at-bb-projects.5

@AlexTugarev
Copy link
Member Author

Just found an issue with the cloneURL.

Couldn't parse context 'https://[email protected]/AlexTugarev3/tada68.git'.

... on it.

@AlexTugarev
Copy link
Member Author

@jldec, just fixed the issue with the wrong cloneUrl.

@gtsiolis
Copy link
Contributor

gtsiolis commented Dec 17, 2021

Looking at this now! 👀

@jldec
Copy link
Contributor

jldec commented Dec 17, 2021

/lgtm

@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: 514b037a80e1280716e3a1b70cc1e6a0ba261051

@roboquat
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jldec

Associated issue: #5980

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@roboquat roboquat merged commit 0cb0f38 into main Dec 17, 2021
@roboquat roboquat deleted the at/bb-projects branch December 17, 2021 13:59
Copy link
Contributor

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

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

Although a bit late but submitting some pending review comments since these could be helpful.

Thanks @AlexTugarev! Feels great to now support Bitbucket repositories as projects. 🔮

commit: {
sha: branch.target?.hash!,
author: branch.target?.author?.user?.display_name!,
authorAvatarUrl: branch.target?.author?.user?.links?.avatar?.href,
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: So jealous the commit author avatar is displayed for Bitbucket repositories but not for GitLab and GitHub repositories. 😭

question: Definitely out of the scope of this PR, but is this as simple to fix for GitLab and GitHub repositories? Happy to also open a follow up issue for this.

Copy link
Member Author

Choose a reason for hiding this comment

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

unfortunately, nope! they don't carry it like here.

});
}

return branches;
Copy link
Contributor

Choose a reason for hiding this comment

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

issue: Although branches are successfully retrieved, we 🅰️ don't have the default label for the default branch and 🅱️ we don't pin the default branch at the top of the branches list. Known? If this is more challenging to resolve due to Bitbucket's API, let's open a follow up issue for this if needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

fyi: Opened #7366 to track this. Cc @AlexTugarev @jldec

const response = await api.user.listPermissionsForRepos({
q: `repository.full_name="${owner}/${repoName}"`
})
return !!response.data?.values && response.data.values[0]?.permission === "admin";
Copy link
Contributor

Choose a reason for hiding this comment

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

issue: This could be considered out of the scope of this PR, but in contrast with GitLab and GitHub repositories, adding a Bitbucket repository 🅰️ does not add a webhook for enabling prebuilds and 🅱️ does not automatically trigger a first prebuilds after adding the project.

🍊 🍊 🍊 🍊

thought: This is also interesting to test and make it clearler if separating the steps adding a project and enabling prebuilds makes sense. Re-posting from #7031 (comment) for visibility:

Eventually we will most probably need to separate project addition and project configuration steps so that these can be done separastely. 💭

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I'll have a look into this. Thanks @gtsiolis!

Copy link
Contributor

Choose a reason for hiding this comment

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

fyi: Opened #7367 to track this. Cc @AlexTugarev @jldec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note size/L team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for adding projects from Bitbucket.org git provider
4 participants