Skip to content

Commit

Permalink
Disable the deprecated '#prebuild/' context URL prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
jankeromnes committed Nov 29, 2022
1 parent efed526 commit b1260d4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 29 deletions.
18 changes: 0 additions & 18 deletions components/gitpod-protocol/src/context-url.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions components/gitpod-protocol/src/context-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +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";
Expand Down Expand Up @@ -91,7 +90,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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,8 @@ export class StartPrebuildContextParser implements IPrefixContextParser {
}

public async handle(user: User, prefix: string, context: WorkspaceContext): Promise<WorkspaceContext> {
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;
throw new Error(
`Running prebuilds without a project is no longer supported. Please add your repository as a project in a Gitpod team.`,
);
}
}

0 comments on commit b1260d4

Please sign in to comment.