@gitpod/gitpod-protocol 0.1.5-vn-6525.76 → 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.
Files changed (52) hide show
  1. package/data/gitpod-schema.json +137 -2
  2. package/lib/env.d.ts +0 -5
  3. package/lib/env.d.ts.map +1 -1
  4. package/lib/env.js +1 -20
  5. package/lib/env.js.map +1 -1
  6. package/lib/gitpod-service.d.ts +1 -0
  7. package/lib/gitpod-service.d.ts.map +1 -1
  8. package/lib/gitpod-service.js +8 -7
  9. package/lib/gitpod-service.js.map +1 -1
  10. package/lib/license-protocol.d.ts +7 -0
  11. package/lib/license-protocol.d.ts.map +1 -1
  12. package/lib/license-protocol.js.map +1 -1
  13. package/lib/messaging/error.d.ts +1 -0
  14. package/lib/messaging/error.d.ts.map +1 -1
  15. package/lib/messaging/error.js +2 -0
  16. package/lib/messaging/error.js.map +1 -1
  17. package/lib/protocol.d.ts +28 -4
  18. package/lib/protocol.d.ts.map +1 -1
  19. package/lib/protocol.js +89 -10
  20. package/lib/protocol.js.map +1 -1
  21. package/lib/teams-projects-protocol.d.ts +4 -0
  22. package/lib/teams-projects-protocol.d.ts.map +1 -1
  23. package/lib/teams-projects-protocol.js.map +1 -1
  24. package/lib/util/generate-workspace-id.d.ts +5 -0
  25. package/lib/util/generate-workspace-id.d.ts.map +1 -1
  26. package/lib/util/generate-workspace-id.js +12 -8
  27. package/lib/util/generate-workspace-id.js.map +1 -1
  28. package/lib/util/generate-workspace-id.spec.js +10 -3
  29. package/lib/util/generate-workspace-id.spec.js.map +1 -1
  30. package/lib/util/logging.js +1 -1
  31. package/lib/util/logging.js.map +1 -1
  32. package/lib/util/tracing.d.ts.map +1 -1
  33. package/lib/util/tracing.js +8 -10
  34. package/lib/util/tracing.js.map +1 -1
  35. package/lib/workspace-instance.d.ts +6 -1
  36. package/lib/workspace-instance.d.ts.map +1 -1
  37. package/lib/wsready.js +1 -1
  38. package/package.json +1 -1
  39. package/pkg-yarn.lock +1 -1
  40. package/provenance-bundle.jsonl +1 -1
  41. package/src/env.ts +0 -22
  42. package/src/gitpod-service.ts +9 -7
  43. package/src/license-protocol.ts +7 -0
  44. package/src/messaging/error.ts +3 -0
  45. package/src/protocol.ts +106 -9
  46. package/src/teams-projects-protocol.ts +5 -0
  47. package/src/util/generate-workspace-id.spec.ts +10 -3
  48. package/src/util/generate-workspace-id.ts +9 -3
  49. package/src/util/logging.ts +0 -1
  50. package/src/util/tracing.ts +8 -10
  51. package/src/workspace-instance.ts +13 -1
  52. 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, Math.min(15, 23 - firstSeg.length)) || (await random(animals));
11
- return firstSeg + "-" + secSeg + "-" + (await random(characters, 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 = 15) {
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 = [
@@ -315,7 +315,6 @@ function makeLogItem(
315
315
  component,
316
316
  severity,
317
317
  time: new Date().toISOString(),
318
- environment: process.env.KUBE_STAGE,
319
318
  context,
320
319
  message,
321
320
  error,
@@ -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
- if (parentCtx && parentCtx.span && !!parentCtx.span.context().toSpanId()) {
26
- options.childOf = parentCtx.span;
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. This means we're building the Docker image for the workspace.
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-02-15 11:53:18.380158212 +0000 UTC m=+0.011913675
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 {