Skip to content

Commit

Permalink
[projects] enable webhook registration for bitbucket.org and self-hos…
Browse files Browse the repository at this point in the history
…ted gitlab
  • Loading branch information
AlexTugarev authored and roboquat committed Jan 4, 2022
1 parent 46d55a7 commit 911d00e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/server/src/projects/projects-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@ 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) {
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") {
const repositoryService = hostContext?.services?.repositoryService;
if (repositoryService) {
// Note: For GitLab, we expect .canInstallAutomatedPrebuilds() to always return true, because earlier
// in the project creation flow, we only propose repositories where the user is actually allowed to
Expand Down

0 comments on commit 911d00e

Please sign in to comment.