Skip to content

Commit 154891d

Browse files
committed
Disable the deprecated '#prebuild/' context URL prefix
1 parent efed526 commit 154891d

File tree

3 files changed

+4
-30
lines changed

3 files changed

+4
-30
lines changed

components/gitpod-protocol/src/context-url.spec.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,6 @@ export class ContextUrlTest {
4141
expect(actual?.pathname).to.equal("/gitpod-io/gitpod-test-repo.git");
4242
}
4343

44-
@test public parseContextUrl_withPrebuild() {
45-
const actual = ContextURL.getNormalizedURL({
46-
contextURL: "prebuild/https://github.com/gitpod-io/gitpod-test-repo",
47-
context: {},
48-
} as WsContextUrl);
49-
expect(actual?.host).to.equal("github.com");
50-
expect(actual?.pathname).to.equal("/gitpod-io/gitpod-test-repo");
51-
}
52-
53-
@test public parseContextUrl_withPrebuild_withoutSchema() {
54-
const actual = ContextURL.getNormalizedURL({
55-
contextURL: "prebuild/github.com/gitpod-io/gitpod-test-repo",
56-
context: {},
57-
} as WsContextUrl);
58-
expect(actual?.host).to.equal("github.com");
59-
expect(actual?.pathname).to.equal("/gitpod-io/gitpod-test-repo");
60-
}
61-
6244
@test public parseContextUrl_badUrl() {
6345
const actual = ContextURL.getNormalizedURL({ contextURL: "[Object object]", context: {} } as WsContextUrl);
6446
expect(actual).to.be.undefined;

components/gitpod-protocol/src/context-url.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { Workspace } from ".";
1515
* TODO(gpl) See if we can get this into `server` code to remove the burden from clients
1616
*/
1717
export namespace ContextURL {
18-
export const INCREMENTAL_PREBUILD_PREFIX = "incremental-prebuild";
1918
export const PREBUILD_PREFIX = "prebuild";
2019
export const IMAGEBUILD_PREFIX = "imagebuild";
2120
export const SNAPSHOT_PREFIX = "snapshot";
@@ -91,7 +90,6 @@ export namespace ContextURL {
9190
const firstSegment = segments[0];
9291
if (
9392
firstSegment === PREBUILD_PREFIX ||
94-
firstSegment === INCREMENTAL_PREBUILD_PREFIX ||
9593
firstSegment === IMAGEBUILD_PREFIX ||
9694
firstSegment === SNAPSHOT_PREFIX ||
9795
firstSegment.startsWith(REFERRER_PREFIX)

components/server/ee/src/prebuilds/start-prebuild-context-parser.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* See License.enterprise.txt in the project root folder.
55
*/
66

7-
import { User, WorkspaceContext, StartPrebuildContext, IssueContext, ContextURL } from "@gitpod/gitpod-protocol";
7+
import { User, WorkspaceContext, ContextURL } from "@gitpod/gitpod-protocol";
88
import { injectable } from "inversify";
99
import { IPrefixContextParser } from "../../../src/workspace/context-parser";
1010

@@ -19,14 +19,8 @@ export class StartPrebuildContextParser implements IPrefixContextParser {
1919
}
2020

2121
public async handle(user: User, prefix: string, context: WorkspaceContext): Promise<WorkspaceContext> {
22-
if (IssueContext.is(context)) {
23-
throw new Error("cannot start prebuilds on an issue context");
24-
}
25-
26-
const result: StartPrebuildContext = {
27-
title: `Prebuild of "${context.title}"`,
28-
actual: context,
29-
};
30-
return result;
22+
throw new Error(
23+
`Running prebuilds without a project is no longer supported. Please add your repository as a project in a Gitpod team.`,
24+
);
3125
}
3226
}

0 commit comments

Comments
 (0)