diff --git a/components/gitpod-protocol/src/context-url.spec.ts b/components/gitpod-protocol/src/context-url.spec.ts index 7f31e59060a509..5549bb9dc8bdcf 100644 --- a/components/gitpod-protocol/src/context-url.spec.ts +++ b/components/gitpod-protocol/src/context-url.spec.ts @@ -41,24 +41,6 @@ export class ContextUrlTest { expect(actual?.pathname).to.equal("/gitpod-io/gitpod-test-repo.git"); } - @test public parseContextUrl_withPrebuild() { - const actual = ContextURL.getNormalizedURL({ - contextURL: "prebuild/https://github.com/gitpod-io/gitpod-test-repo", - context: {}, - } as WsContextUrl); - expect(actual?.host).to.equal("github.com"); - expect(actual?.pathname).to.equal("/gitpod-io/gitpod-test-repo"); - } - - @test public parseContextUrl_withPrebuild_withoutSchema() { - const actual = ContextURL.getNormalizedURL({ - contextURL: "prebuild/github.com/gitpod-io/gitpod-test-repo", - context: {}, - } as WsContextUrl); - expect(actual?.host).to.equal("github.com"); - expect(actual?.pathname).to.equal("/gitpod-io/gitpod-test-repo"); - } - @test public parseContextUrl_badUrl() { const actual = ContextURL.getNormalizedURL({ contextURL: "[Object object]", context: {} } as WsContextUrl); expect(actual).to.be.undefined; diff --git a/components/gitpod-protocol/src/context-url.ts b/components/gitpod-protocol/src/context-url.ts index ee75e008527880..39a258a72b3465 100644 --- a/components/gitpod-protocol/src/context-url.ts +++ b/components/gitpod-protocol/src/context-url.ts @@ -15,8 +15,6 @@ import { Workspace } from "."; * TODO(gpl) See if we can get this into `server` code to remove the burden from clients */ export namespace ContextURL { - export const INCREMENTAL_PREBUILD_PREFIX = "incremental-prebuild"; - export const PREBUILD_PREFIX = "prebuild"; export const IMAGEBUILD_PREFIX = "imagebuild"; export const SNAPSHOT_PREFIX = "snapshot"; export const REFERRER_PREFIX = "referrer:"; @@ -90,8 +88,6 @@ export namespace ContextURL { const firstSegment = segments[0]; if ( - firstSegment === PREBUILD_PREFIX || - firstSegment === INCREMENTAL_PREBUILD_PREFIX || firstSegment === IMAGEBUILD_PREFIX || firstSegment === SNAPSHOT_PREFIX || firstSegment.startsWith(REFERRER_PREFIX) diff --git a/components/server/ee/src/container-module.ts b/components/server/ee/src/container-module.ts index de87e2370401e5..485082f35090ba 100644 --- a/components/server/ee/src/container-module.ts +++ b/components/server/ee/src/container-module.ts @@ -23,8 +23,6 @@ import { GitLabApp } from "./prebuilds/gitlab-app"; import { BitbucketApp } from "./prebuilds/bitbucket-app"; import { GitHubEnterpriseApp } from "./prebuilds/github-enterprise-app"; import { IncrementalPrebuildsService } from "./prebuilds/incremental-prebuilds-service"; -import { IPrefixContextParser } from "../../src/workspace/context-parser"; -import { StartPrebuildContextParser } from "./prebuilds/start-prebuild-context-parser"; import { WorkspaceFactory } from "../../src/workspace/workspace-factory"; import { WorkspaceFactoryEE } from "./workspace/workspace-factory"; import { MonitoringEndpointsAppEE } from "./monitoring-endpoint-ee"; @@ -72,7 +70,6 @@ export const productionEEContainerModule = new ContainerModule((bind, unbind, is rebind(MonitoringEndpointsApp).to(MonitoringEndpointsAppEE).inSingletonScope(); bind(PrebuildManager).toSelf().inSingletonScope(); - bind(IPrefixContextParser).to(StartPrebuildContextParser).inSingletonScope(); bind(GithubApp).toSelf().inSingletonScope(); bind(GitHubAppSupport).toSelf().inSingletonScope(); bind(GithubAppRules).toSelf().inSingletonScope(); diff --git a/components/server/ee/src/prebuilds/start-prebuild-context-parser.ts b/components/server/ee/src/prebuilds/start-prebuild-context-parser.ts deleted file mode 100644 index 9594c329478307..00000000000000 --- a/components/server/ee/src/prebuilds/start-prebuild-context-parser.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2020 Gitpod GmbH. All rights reserved. - * Licensed under the Gitpod Enterprise Source Code License, - * See License.enterprise.txt in the project root folder. - */ - -import { User, WorkspaceContext, StartPrebuildContext, IssueContext, ContextURL } from "@gitpod/gitpod-protocol"; -import { injectable } from "inversify"; -import { IPrefixContextParser } from "../../../src/workspace/context-parser"; - -@injectable() -export class StartPrebuildContextParser implements IPrefixContextParser { - static PREFIX = ContextURL.PREBUILD_PREFIX + "/"; - - findPrefix(user: User, context: string): string | undefined { - if (context.startsWith(StartPrebuildContextParser.PREFIX)) { - return StartPrebuildContextParser.PREFIX; - } - } - - public async handle(user: User, prefix: string, context: WorkspaceContext): Promise { - if (IssueContext.is(context)) { - throw new Error("cannot start prebuilds on an issue context"); - } - - const result: StartPrebuildContext = { - title: `Prebuild of "${context.title}"`, - actual: context, - }; - return result; - } -}