@gitpod/gitpod-protocol 0.1.5-vn-6525.78 → 0.1.5-vn-update-gitpod-json-schema.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/gitpod-schema.json +137 -2
- package/lib/env.d.ts +0 -5
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +1 -20
- package/lib/env.js.map +1 -1
- package/lib/gitpod-service.d.ts +1 -0
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +8 -7
- package/lib/gitpod-service.js.map +1 -1
- package/lib/license-protocol.d.ts +7 -0
- package/lib/license-protocol.d.ts.map +1 -1
- package/lib/license-protocol.js.map +1 -1
- package/lib/messaging/error.d.ts +1 -0
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +2 -0
- package/lib/messaging/error.js.map +1 -1
- package/lib/protocol.d.ts +28 -4
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +89 -10
- package/lib/protocol.js.map +1 -1
- package/lib/teams-projects-protocol.d.ts +4 -0
- package/lib/teams-projects-protocol.d.ts.map +1 -1
- package/lib/teams-projects-protocol.js.map +1 -1
- package/lib/util/generate-workspace-id.d.ts +5 -0
- package/lib/util/generate-workspace-id.d.ts.map +1 -1
- package/lib/util/generate-workspace-id.js +12 -8
- package/lib/util/generate-workspace-id.js.map +1 -1
- package/lib/util/generate-workspace-id.spec.js +10 -3
- package/lib/util/generate-workspace-id.spec.js.map +1 -1
- package/lib/util/logging.js +1 -1
- package/lib/util/logging.js.map +1 -1
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +8 -10
- package/lib/util/tracing.js.map +1 -1
- package/lib/workspace-instance.d.ts +6 -1
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/wsready.js +1 -1
- package/package.json +1 -1
- package/pkg-yarn.lock +1 -1
- package/provenance-bundle.jsonl +1 -1
- package/src/env.ts +0 -22
- package/src/gitpod-service.ts +9 -7
- package/src/license-protocol.ts +7 -0
- package/src/messaging/error.ts +3 -0
- package/src/protocol.ts +106 -9
- package/src/teams-projects-protocol.ts +5 -0
- package/src/util/generate-workspace-id.spec.ts +10 -3
- package/src/util/generate-workspace-id.ts +9 -3
- package/src/util/logging.ts +0 -1
- package/src/util/tracing.ts +8 -10
- package/src/workspace-instance.ts +13 -1
- package/src/wsready.ts +1 -1
|
@@ -3,15 +3,19 @@
|
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
4
|
* See License-AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
|
+
|
|
6
7
|
import randomNumber = require("random-number-csprng");
|
|
7
8
|
|
|
8
9
|
export async function generateWorkspaceID(firstSegment?: string, secondSegment?: string): Promise<string> {
|
|
9
10
|
const firstSeg = clean(firstSegment) || (await random(colors));
|
|
10
|
-
const secSeg = clean(secondSegment
|
|
11
|
-
|
|
11
|
+
const secSeg = clean(secondSegment) || (await random(animals));
|
|
12
|
+
function fit(makeFit: string, otherSeg: string) {
|
|
13
|
+
return makeFit.substring(0, Math.max(segLength, 2 * segLength - otherSeg.length));
|
|
14
|
+
}
|
|
15
|
+
return fit(firstSeg, secSeg) + "-" + fit(secSeg, firstSeg) + "-" + (await random(characters, segLength));
|
|
12
16
|
}
|
|
13
17
|
|
|
14
|
-
function clean(segment: string | undefined, maxChars: number =
|
|
18
|
+
function clean(segment: string | undefined, maxChars: number = 16) {
|
|
15
19
|
if (!segment) {
|
|
16
20
|
return undefined;
|
|
17
21
|
}
|
|
@@ -35,6 +39,8 @@ async function random(array: string[], length: number = 1): Promise<string> {
|
|
|
35
39
|
return result;
|
|
36
40
|
}
|
|
37
41
|
|
|
42
|
+
const segLength = 11;
|
|
43
|
+
|
|
38
44
|
const characters = "abcdefghijklmnopqrstuvwxyz0123456789".split("");
|
|
39
45
|
|
|
40
46
|
export const colors = [
|
package/src/util/logging.ts
CHANGED
package/src/util/tracing.ts
CHANGED
|
@@ -22,17 +22,15 @@ export type TraceContextWithSpan = TraceContext & {
|
|
|
22
22
|
export namespace TraceContext {
|
|
23
23
|
export function startSpan(operation: string, parentCtx?: TraceContext): opentracing.Span {
|
|
24
24
|
const options: opentracing.SpanOptions = {};
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
|
|
26
|
+
// references should contain span id.
|
|
27
|
+
// cf. https://github.com/jaegertracing/jaeger-client-node/issues/432
|
|
28
|
+
if (!!parentCtx?.span) {
|
|
29
|
+
const ctx = parentCtx?.span?.context();
|
|
30
|
+
if (ctx && !!ctx.toTraceId() && !!ctx.toSpanId()) {
|
|
31
|
+
options.references = [opentracing.followsFrom(ctx)];
|
|
32
|
+
}
|
|
27
33
|
}
|
|
28
|
-
// TODO(gpl) references lead to a huge amount of errors in prod logs. Avoid those until we have time to figure out how to fix it.
|
|
29
|
-
// if (referencedSpans) {
|
|
30
|
-
// // note: allthough followsForm's type says it takes 'opentracing.Span | opentracing.SpanContext', it only works with SpanContext (typing mismatch)
|
|
31
|
-
// // note2: we need to filter out debug spans (spanId === "")
|
|
32
|
-
// options.references = referencedSpans.filter(s => s !== undefined)
|
|
33
|
-
// .filter(s => !!s!.context().toSpanId())
|
|
34
|
-
// .map(s => followsFrom(s!.context()));
|
|
35
|
-
// }
|
|
36
34
|
|
|
37
35
|
return opentracing.globalTracer().startSpan(operation, options);
|
|
38
36
|
}
|
|
@@ -98,9 +98,13 @@ export type WorkspaceInstancePhase =
|
|
|
98
98
|
| "unknown"
|
|
99
99
|
|
|
100
100
|
// Preparing means that we haven't actually started the workspace instance just yet, but rather
|
|
101
|
-
// are still preparing for launch.
|
|
101
|
+
// are still preparing for launch.
|
|
102
102
|
| "preparing"
|
|
103
103
|
|
|
104
|
+
// Building means that we are building the Docker image for the workspace. A workspace will enter this phase only
|
|
105
|
+
// if an image build is required for that workspace.
|
|
106
|
+
| "building"
|
|
107
|
+
|
|
104
108
|
// Pending means the workspace does not yet consume resources in the cluster, but rather is looking for
|
|
105
109
|
// some space within the cluster. If for example the cluster needs to scale up to accomodate the
|
|
106
110
|
// workspace, the workspace will be in Pending state until that happened.
|
|
@@ -204,6 +208,12 @@ export interface WorkspaceInstanceRepoStatus {
|
|
|
204
208
|
totalUnpushedCommits?: number;
|
|
205
209
|
}
|
|
206
210
|
|
|
211
|
+
// ConfigurationIdeConfig ide config of WorkspaceInstanceConfiguration
|
|
212
|
+
export interface ConfigurationIdeConfig {
|
|
213
|
+
useLatest?: boolean;
|
|
214
|
+
desktopIdeAlias?: string;
|
|
215
|
+
}
|
|
216
|
+
|
|
207
217
|
// WorkspaceInstanceConfiguration contains all per-instance configuration
|
|
208
218
|
export interface WorkspaceInstanceConfiguration {
|
|
209
219
|
// theiaVersion is the version of Theia this workspace instance uses
|
|
@@ -221,6 +231,8 @@ export interface WorkspaceInstanceConfiguration {
|
|
|
221
231
|
|
|
222
232
|
// supervisorImage is the ref of the supervisor image this instance uses.
|
|
223
233
|
supervisorImage?: string;
|
|
234
|
+
|
|
235
|
+
ideConfig?: ConfigurationIdeConfig;
|
|
224
236
|
}
|
|
225
237
|
|
|
226
238
|
/**
|
package/src/wsready.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* See License-AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
// generated using github.com/32leaves/bel on 2022-
|
|
7
|
+
// generated using github.com/32leaves/bel on 2022-03-29 17:08:06.113873917 +0000 UTC m=+0.010035965
|
|
8
8
|
// DO NOT MODIFY
|
|
9
9
|
|
|
10
10
|
export enum WorkspaceInitSource {
|