-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[projects] enable webhook registration for bitbucket.org and self-managed gitlab #7422
Conversation
Looking at this now! 👀 |
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 for picking this up, @AlexTugarev! Works as expected, this makes everything one step closer to having a consistent product behavior across GitLab and Bucket that require the webshook! 🔮
🍊 🍊 🍊 🍊
Opened some follow-up issues that can be considered out of the scope of this PR: #7424, #7425, #7426. Feedback is welcome!
🍋 🍋 🍋 🍋
Approving to unblock merging but holding in case we need someone from the team to take a closer look at the code changes.
/hold
@@ -115,7 +115,7 @@ export class ProjectsService { | |||
protected async onDidCreateProject(project: Project, installer: User) { | |||
let { userId, teamId, cloneUrl } = project; | |||
const parsedUrl = RepoURL.parseRepoUrl(project.cloneUrl); | |||
if ("gitlab.com" === parsedUrl?.host) { | |||
if ("gitlab.com" === parsedUrl?.host || "bitbucket.org" === parsedUrl?.host) { |
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.
issue(non-blocking): Prebuilds are still not enabled for the default branch for GitLab and Bitbucket repositories but certainly out of the scope of this PR. ➿
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.
That's interesting. Is this already planned/discussed/tracked somewhere in a GH issue?
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.
@AlexTugarev I could be missing something but I've added #7424 to continue the discussion about this issue there. Up for closing it if the issue is not accurate or valid. 🏀
LGTM label has been added. Git tree hash: cc0187c12c0ccb3fb53f4470a56675673090ab6e
|
@gtsiolis enabling prebuilds on all branches on Bitbucket should be part of fixing #7367 see comment Keeping in mind that there are overhead costs to creating and tracking new issues, let's avoid spawning followup issues to followup issues, when asking for clarification in the issue at hand would suffice. (similar feedback applies to self-hosted GitLab and #7416) |
@jldec I agree but not entirely sure if there was a background decision for not enabling prebuilds for all branches by default, see relevant docs:
Also, I'm probably wrong here but this was most probably an efficient solution to ❓ question: Maybe we could a) gather some usage data metrics or b) get an implementation estimation before making the final call?
Fair point! 🤝 I still think there's a lot of value in breaking tasks is smaller follow-up issues in case the implementation overhead increases the risk of scope creep for a PR, even if the initial PR solves the follow up issue, but I agree this could be tackled in #7367. ❓ question: Do you think we could try to tackle also #4353 within #7367? |
4e83ecf
to
078674d
Compare
@jldec and @gtsiolis, great questions and discussion so far, and I'm looking forward to clean up the differences between repo providers 🙏🏻 obviously, it makes sense to have a similar behavior from the product perspective. for the scope of this PR, I'd like to move forward if you think it solves the two mentioned issues as described. |
Yes, thanks @AlexTugarev
|
We can try with the internal test installation, though it's not required because the implementation now checks for the provider type (and not for the host name,) so if it works with gitlab.com it should work with mygitlab.com as well. |
const repositoryService = this.hostContextProvider.get(parsedUrl?.host)?.services?.repositoryService; | ||
const hostContext = parsedUrl?.host ? this.hostContextProvider.get(parsedUrl?.host) : undefined; | ||
const type = hostContext && hostContext.authProvider.info.authProviderType; | ||
if (type === "GitLab" || type === "Bitbucket") { |
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.
@jldec, this is the change which treats all GItLab installations equal, so testing with gitlab.com should be enough.
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.
ok - i'll wait for staging to test :)
/lgtm |
LGTM label has been added. Git tree hash: 19b26abbdb22da5b2a4c85c92f9643985a4463e2
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gtsiolis, jldec Associated issue: #7367 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 |
/unhold |
fixes #7367
fixes #7416