@gitpod/gitpod-protocol 0.1.5-sje-installation-admin-dashboard.22 → 0.1.5-sje-installer-fun.1

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 (313) hide show
  1. package/data/gitpod-schema.json +181 -4
  2. package/lib/accounting-protocol.d.ts +17 -10
  3. package/lib/accounting-protocol.d.ts.map +1 -1
  4. package/lib/accounting-protocol.js +30 -32
  5. package/lib/accounting-protocol.js.map +1 -1
  6. package/lib/admin-protocol.d.ts +9 -0
  7. package/lib/admin-protocol.d.ts.map +1 -1
  8. package/lib/admin-protocol.js.map +1 -1
  9. package/lib/analytics.d.ts +4 -5
  10. package/lib/analytics.d.ts.map +1 -1
  11. package/lib/analytics.js.map +1 -1
  12. package/lib/auth.d.ts.map +1 -1
  13. package/lib/blocked-repositories-protocol.d.ts +13 -0
  14. package/lib/blocked-repositories-protocol.d.ts.map +1 -0
  15. package/lib/blocked-repositories-protocol.js +8 -0
  16. package/lib/blocked-repositories-protocol.js.map +1 -0
  17. package/lib/context-url.d.ts +17 -5
  18. package/lib/context-url.d.ts.map +1 -1
  19. package/lib/context-url.js +57 -6
  20. package/lib/context-url.js.map +1 -1
  21. package/lib/context-url.spec.d.ts +2 -0
  22. package/lib/context-url.spec.d.ts.map +1 -1
  23. package/lib/context-url.spec.js +40 -4
  24. package/lib/context-url.spec.js.map +1 -1
  25. package/lib/email-protocol.d.ts +1 -1
  26. package/lib/email-protocol.d.ts.map +1 -1
  27. package/lib/email-protocol.js.map +1 -1
  28. package/lib/encryption/container-module.d.ts.map +1 -1
  29. package/lib/encryption/container-module.js +1 -1
  30. package/lib/encryption/container-module.js.map +1 -1
  31. package/lib/encryption/encryption-engine.d.ts.map +1 -1
  32. package/lib/encryption/encryption-engine.js +7 -7
  33. package/lib/encryption/encryption-engine.js.map +1 -1
  34. package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
  35. package/lib/encryption/encryption-engine.spec.js +2 -3
  36. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  37. package/lib/encryption/encryption-service.d.ts.map +1 -1
  38. package/lib/encryption/encryption-service.js +1 -1
  39. package/lib/encryption/encryption-service.js.map +1 -1
  40. package/lib/encryption/key-provider.d.ts.map +1 -1
  41. package/lib/encryption/key-provider.js +7 -9
  42. package/lib/encryption/key-provider.js.map +1 -1
  43. package/lib/env.d.ts +0 -5
  44. package/lib/env.d.ts.map +1 -1
  45. package/lib/env.js +1 -20
  46. package/lib/env.js.map +1 -1
  47. package/lib/experiments/always-default.d.ts +8 -0
  48. package/lib/experiments/always-default.d.ts.map +1 -0
  49. package/lib/experiments/always-default.js +20 -0
  50. package/lib/experiments/always-default.js.map +1 -0
  51. package/lib/experiments/configcat-server.d.ts +8 -0
  52. package/lib/experiments/configcat-server.d.ts.map +1 -0
  53. package/lib/experiments/configcat-server.js +34 -0
  54. package/lib/experiments/configcat-server.js.map +1 -0
  55. package/lib/experiments/configcat.d.ts +21 -0
  56. package/lib/experiments/configcat.d.ts.map +1 -0
  57. package/lib/experiments/configcat.js +47 -0
  58. package/lib/experiments/configcat.js.map +1 -0
  59. package/lib/experiments/types.d.ts +19 -0
  60. package/lib/experiments/types.d.ts.map +1 -0
  61. package/lib/{theia-plugins.js → experiments/types.js} +2 -2
  62. package/lib/experiments/types.js.map +1 -0
  63. package/lib/gitpod-file-parser.d.ts.map +1 -1
  64. package/lib/gitpod-file-parser.js +6 -6
  65. package/lib/gitpod-file-parser.js.map +1 -1
  66. package/lib/gitpod-file-parser.spec.js +42 -39
  67. package/lib/gitpod-file-parser.spec.js.map +1 -1
  68. package/lib/gitpod-service.d.ts +45 -26
  69. package/lib/gitpod-service.d.ts.map +1 -1
  70. package/lib/gitpod-service.js +39 -32
  71. package/lib/gitpod-service.js.map +1 -1
  72. package/lib/headless-workspace-log.d.ts +1 -0
  73. package/lib/headless-workspace-log.d.ts.map +1 -1
  74. package/lib/headless-workspace-log.js +2 -1
  75. package/lib/headless-workspace-log.js.map +1 -1
  76. package/lib/ide-frontend-service.d.ts +1 -1
  77. package/lib/ide-protocol.d.ts +10 -6
  78. package/lib/ide-protocol.d.ts.map +1 -1
  79. package/lib/index.d.ts +16 -16
  80. package/lib/installation-admin-protocol.d.ts +9 -0
  81. package/lib/installation-admin-protocol.d.ts.map +1 -1
  82. package/lib/installation-admin-protocol.js +3 -2
  83. package/lib/installation-admin-protocol.js.map +1 -1
  84. package/lib/license-protocol.d.ts +7 -0
  85. package/lib/license-protocol.d.ts.map +1 -1
  86. package/lib/license-protocol.js.map +1 -1
  87. package/lib/messaging/browser/connection.d.ts +1 -1
  88. package/lib/messaging/browser/connection.d.ts.map +1 -1
  89. package/lib/messaging/browser/connection.js +19 -19
  90. package/lib/messaging/browser/connection.js.map +1 -1
  91. package/lib/messaging/browser/window-connection.d.ts +4 -4
  92. package/lib/messaging/browser/window-connection.d.ts.map +1 -1
  93. package/lib/messaging/browser/window-connection.js +9 -6
  94. package/lib/messaging/browser/window-connection.js.map +1 -1
  95. package/lib/messaging/client-call-metrics.d.ts +2 -2
  96. package/lib/messaging/client-call-metrics.d.ts.map +1 -1
  97. package/lib/messaging/client-call-metrics.js +20 -20
  98. package/lib/messaging/client-call-metrics.js.map +1 -1
  99. package/lib/messaging/error.d.ts +3 -0
  100. package/lib/messaging/error.d.ts.map +1 -1
  101. package/lib/messaging/error.js +6 -0
  102. package/lib/messaging/error.js.map +1 -1
  103. package/lib/messaging/handler.d.ts.map +1 -1
  104. package/lib/messaging/handler.js +1 -1
  105. package/lib/messaging/node/connection.js +8 -8
  106. package/lib/messaging/node/connection.js.map +1 -1
  107. package/lib/messaging/proxy-factory.d.ts +1 -1
  108. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  109. package/lib/messaging/proxy-factory.js +7 -9
  110. package/lib/messaging/proxy-factory.js.map +1 -1
  111. package/lib/payment-protocol.d.ts.map +1 -1
  112. package/lib/payment-protocol.js +1 -1
  113. package/lib/payment-protocol.js.map +1 -1
  114. package/lib/permission.d.ts +9 -3
  115. package/lib/permission.d.ts.map +1 -1
  116. package/lib/permission.js +34 -25
  117. package/lib/permission.js.map +1 -1
  118. package/lib/plans.d.ts +3 -3
  119. package/lib/plans.d.ts.map +1 -1
  120. package/lib/plans.js +206 -171
  121. package/lib/plans.js.map +1 -1
  122. package/lib/protocol.d.ts +88 -38
  123. package/lib/protocol.d.ts.map +1 -1
  124. package/lib/protocol.js +166 -88
  125. package/lib/protocol.js.map +1 -1
  126. package/lib/snapshot-url.spec.js.map +1 -1
  127. package/lib/team-subscription-protocol.d.ts +21 -3
  128. package/lib/team-subscription-protocol.d.ts.map +1 -1
  129. package/lib/team-subscription-protocol.js +16 -5
  130. package/lib/team-subscription-protocol.js.map +1 -1
  131. package/lib/teams-projects-protocol.d.ts +12 -3
  132. package/lib/teams-projects-protocol.d.ts.map +1 -1
  133. package/lib/teams-projects-protocol.js +8 -1
  134. package/lib/teams-projects-protocol.js.map +1 -1
  135. package/lib/typings/globals.d.ts +2 -2
  136. package/lib/typings/globals.d.ts.map +1 -1
  137. package/lib/util/analytics.d.ts.map +1 -1
  138. package/lib/util/analytics.js +12 -3
  139. package/lib/util/analytics.js.map +1 -1
  140. package/lib/util/async-iterator.d.ts.map +1 -1
  141. package/lib/util/async-iterator.js +3 -3
  142. package/lib/util/async-iterator.js.map +1 -1
  143. package/lib/util/cancelable.js.map +1 -1
  144. package/lib/util/date-time.js +6 -6
  145. package/lib/util/date-time.js.map +1 -1
  146. package/lib/util/debug-app.d.ts +25 -0
  147. package/lib/util/debug-app.d.ts.map +1 -0
  148. package/lib/util/debug-app.js +100 -0
  149. package/lib/util/debug-app.js.map +1 -0
  150. package/lib/util/deferred.js.map +1 -1
  151. package/lib/util/disposable.d.ts.map +1 -1
  152. package/lib/util/disposable.js +2 -2
  153. package/lib/util/disposable.js.map +1 -1
  154. package/lib/util/event.d.ts.map +1 -1
  155. package/lib/util/event.js +5 -3
  156. package/lib/util/event.js.map +1 -1
  157. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  158. package/lib/util/garbage-collected-cache.js +1 -1
  159. package/lib/util/garbage-collected-cache.js.map +1 -1
  160. package/lib/util/generate-workspace-id.d.ts +5 -0
  161. package/lib/util/generate-workspace-id.d.ts.map +1 -1
  162. package/lib/util/generate-workspace-id.js +446 -442
  163. package/lib/util/generate-workspace-id.js.map +1 -1
  164. package/lib/util/generate-workspace-id.spec.js +18 -7
  165. package/lib/util/generate-workspace-id.spec.js.map +1 -1
  166. package/lib/util/gitpod-cookie.d.ts +1 -1
  167. package/lib/util/gitpod-cookie.d.ts.map +1 -1
  168. package/lib/util/gitpod-cookie.js +0 -3
  169. package/lib/util/gitpod-cookie.js.map +1 -1
  170. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  171. package/lib/util/gitpod-host-url.js +31 -29
  172. package/lib/util/gitpod-host-url.js.map +1 -1
  173. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
  174. package/lib/util/gitpod-host-url.spec.js +15 -5
  175. package/lib/util/gitpod-host-url.spec.js.map +1 -1
  176. package/lib/util/grpc.d.ts.map +1 -1
  177. package/lib/util/grpc.js.map +1 -1
  178. package/lib/util/jaeger-client-types.d.ts.map +1 -1
  179. package/lib/util/logging.d.ts +1 -1
  180. package/lib/util/logging.d.ts.map +1 -1
  181. package/lib/util/logging.js +31 -25
  182. package/lib/util/logging.js.map +1 -1
  183. package/lib/util/make-link.js +5 -5
  184. package/lib/util/make-link.js.map +1 -1
  185. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  186. package/lib/util/parse-workspace-id.js +1 -2
  187. package/lib/util/parse-workspace-id.js.map +1 -1
  188. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  189. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  190. package/lib/util/queue.spec.js +9 -6
  191. package/lib/util/queue.spec.js.map +1 -1
  192. package/lib/util/semaphore.d.ts.map +1 -1
  193. package/lib/util/semaphore.js.map +1 -1
  194. package/lib/util/skip-if.d.ts.map +1 -1
  195. package/lib/util/skip-if.js.map +1 -1
  196. package/lib/util/timeutil.d.ts +1 -0
  197. package/lib/util/timeutil.d.ts.map +1 -1
  198. package/lib/util/timeutil.js +9 -3
  199. package/lib/util/timeutil.js.map +1 -1
  200. package/lib/util/timeutil.spec.d.ts.map +1 -1
  201. package/lib/util/timeutil.spec.js.map +1 -1
  202. package/lib/util/tracing.d.ts +8 -8
  203. package/lib/util/tracing.d.ts.map +1 -1
  204. package/lib/util/tracing.js +19 -20
  205. package/lib/util/tracing.js.map +1 -1
  206. package/lib/util/tracing.spec.js +3 -3
  207. package/lib/util/tracing.spec.js.map +1 -1
  208. package/lib/util/workspace-port-authentication.d.ts +7 -7
  209. package/lib/util/workspace-port-authentication.d.ts.map +1 -1
  210. package/lib/util/workspace-port-authentication.js +8 -11
  211. package/lib/util/workspace-port-authentication.js.map +1 -1
  212. package/lib/workspace-cluster.d.ts +10 -8
  213. package/lib/workspace-cluster.d.ts.map +1 -1
  214. package/lib/workspace-cluster.js +16 -1
  215. package/lib/workspace-cluster.js.map +1 -1
  216. package/lib/workspace-instance.d.ts +37 -3
  217. package/lib/workspace-instance.d.ts.map +1 -1
  218. package/lib/wsready.d.ts +1 -1
  219. package/lib/wsready.d.ts.map +1 -1
  220. package/lib/wsready.js +2 -2
  221. package/package.json +10 -7
  222. package/pkg-yarn.lock +8 -6
  223. package/provenance-bundle.jsonl +1 -1
  224. package/src/accounting-protocol.ts +63 -51
  225. package/src/admin-protocol.ts +33 -20
  226. package/src/analytics.ts +26 -28
  227. package/src/auth.ts +2 -2
  228. package/src/blocked-repositories-protocol.ts +13 -0
  229. package/src/context-url.spec.ts +37 -9
  230. package/src/context-url.ts +96 -40
  231. package/src/email-protocol.ts +5 -6
  232. package/src/encryption/container-module.ts +2 -3
  233. package/src/encryption/encryption-engine.spec.ts +9 -8
  234. package/src/encryption/encryption-engine.ts +14 -14
  235. package/src/encryption/encryption-service.ts +4 -5
  236. package/src/encryption/key-provider.ts +16 -19
  237. package/src/env.ts +0 -22
  238. package/src/experiments/always-default.ts +24 -0
  239. package/src/experiments/configcat-server.ts +37 -0
  240. package/src/experiments/configcat.ts +53 -0
  241. package/src/experiments/types.ts +32 -0
  242. package/src/gitpod-file-parser.spec.ts +55 -61
  243. package/src/gitpod-file-parser.ts +16 -17
  244. package/src/gitpod-service.ts +166 -108
  245. package/src/headless-workspace-log.ts +6 -4
  246. package/src/ide-frontend-service.ts +2 -2
  247. package/src/ide-protocol.ts +13 -8
  248. package/src/index.ts +16 -16
  249. package/src/installation-admin-protocol.ts +14 -4
  250. package/src/license-protocol.ts +12 -6
  251. package/src/messaging/browser/connection.ts +45 -47
  252. package/src/messaging/browser/window-connection.ts +39 -29
  253. package/src/messaging/client-call-metrics.ts +70 -71
  254. package/src/messaging/error.ts +10 -3
  255. package/src/messaging/handler.ts +6 -6
  256. package/src/messaging/node/connection.ts +8 -8
  257. package/src/messaging/proxy-factory.ts +23 -30
  258. package/src/oss-allowlist.ts +3 -3
  259. package/src/payment-protocol.ts +2 -2
  260. package/src/permission.ts +40 -32
  261. package/src/plans.ts +236 -189
  262. package/src/protocol.ts +352 -242
  263. package/src/snapshot-url.spec.ts +9 -7
  264. package/src/team-subscription-protocol.ts +57 -23
  265. package/src/teams-projects-protocol.ts +22 -9
  266. package/src/typings/globals.ts +4 -4
  267. package/src/util/analytics.ts +46 -24
  268. package/src/util/async-iterator.ts +4 -5
  269. package/src/util/cancelable.ts +3 -3
  270. package/src/util/date-time.ts +8 -8
  271. package/src/util/debug-app.ts +81 -0
  272. package/src/util/deferred.ts +6 -6
  273. package/src/util/disposable.ts +3 -6
  274. package/src/util/event.ts +9 -11
  275. package/src/util/garbage-collected-cache.ts +3 -6
  276. package/src/util/generate-workspace-id.spec.ts +26 -16
  277. package/src/util/generate-workspace-id.ts +460 -454
  278. package/src/util/gitpod-cookie.ts +8 -9
  279. package/src/util/gitpod-host-url.spec.ts +40 -13
  280. package/src/util/gitpod-host-url.ts +37 -34
  281. package/src/util/grpc.ts +1 -1
  282. package/src/util/jaeger-client-types.ts +2 -2
  283. package/src/util/logging.ts +60 -42
  284. package/src/util/make-link.ts +6 -7
  285. package/src/util/parse-workspace-id.spec.ts +17 -8
  286. package/src/util/parse-workspace-id.ts +5 -6
  287. package/src/util/queue.spec.ts +27 -25
  288. package/src/util/repeat.ts +1 -1
  289. package/src/util/semaphore.ts +4 -6
  290. package/src/util/skip-if.ts +9 -6
  291. package/src/util/timeutil.spec.ts +14 -15
  292. package/src/util/timeutil.ts +21 -11
  293. package/src/util/tracing.spec.ts +28 -23
  294. package/src/util/tracing.ts +58 -54
  295. package/src/util/workspace-port-authentication.ts +10 -13
  296. package/src/workspace-cluster.ts +26 -15
  297. package/src/workspace-instance.ts +68 -20
  298. package/src/wsready.ts +3 -3
  299. package/data/builtin-theia-plugins.json +0 -372
  300. package/lib/messaging/connection-error-handler.d.ts +0 -27
  301. package/lib/messaging/connection-error-handler.d.ts.map +0 -1
  302. package/lib/messaging/connection-error-handler.js +0 -34
  303. package/lib/messaging/connection-error-handler.js.map +0 -1
  304. package/lib/theia-plugins.d.ts +0 -11
  305. package/lib/theia-plugins.d.ts.map +0 -1
  306. package/lib/theia-plugins.js.map +0 -1
  307. package/lib/util/safe-promise.d.ts +0 -11
  308. package/lib/util/safe-promise.d.ts.map +0 -1
  309. package/lib/util/safe-promise.js +0 -31
  310. package/lib/util/safe-promise.js.map +0 -1
  311. package/src/messaging/connection-error-handler.ts +0 -62
  312. package/src/theia-plugins.ts +0 -11
  313. package/src/util/safe-promise.ts +0 -26
@@ -4,35 +4,32 @@
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
-
8
- import * as opentracing from 'opentracing';
9
- import { TracingConfig, initTracerFromEnv } from 'jaeger-client';
10
- import { Sampler, SamplingDecision } from './jaeger-client-types';
11
- import { followsFrom, initGlobalTracer } from 'opentracing';
12
- import { injectable } from 'inversify';
13
- import { ResponseError } from 'vscode-jsonrpc';
14
- import { log, LogContext } from './logging';
7
+ import * as opentracing from "opentracing";
8
+ import { TracingConfig, initTracerFromEnv } from "jaeger-client";
9
+ import { Sampler, SamplingDecision } from "./jaeger-client-types";
10
+ import { initGlobalTracer } from "opentracing";
11
+ import { injectable } from "inversify";
12
+ import { ResponseError } from "vscode-jsonrpc";
13
+ import { log, LogContext } from "./logging";
15
14
 
16
15
  export interface TraceContext {
17
- span?: opentracing.Span
16
+ span?: opentracing.Span;
18
17
  }
19
18
  export type TraceContextWithSpan = TraceContext & {
20
- span: opentracing.Span
21
- }
22
-
19
+ span: opentracing.Span;
20
+ };
23
21
 
24
22
  export namespace TraceContext {
25
- export function startSpan(operation: string, parentCtx?: TraceContext, ...referencedSpans: (opentracing.Span | undefined)[]): opentracing.Span {
23
+ export function startSpan(operation: string, parentCtx?: TraceContext): opentracing.Span {
26
24
  const options: opentracing.SpanOptions = {};
27
- if (parentCtx && parentCtx.span && !!parentCtx.span.context().toSpanId()) {
28
- options.childOf = parentCtx.span;
29
- }
30
- if (referencedSpans) {
31
- // note: allthough followsForm's type says it takes 'opentracing.Span | opentracing.SpanContext', it only works with SpanContext (typing mismatch)
32
- // note2: we need to filter out debug spans (spanId === "")
33
- options.references = referencedSpans.filter(s => s !== undefined)
34
- .filter(s => !!s!.context().toSpanId())
35
- .map(s => followsFrom(s!.context()));
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
+ }
36
33
  }
37
34
 
38
35
  return opentracing.globalTracer().startSpan(operation, options);
@@ -43,18 +40,18 @@ export namespace TraceContext {
43
40
  return { span };
44
41
  }
45
42
 
46
- export function withSpan(operation: string, callback: () => void, ctx?: TraceContext, ...referencedSpans: (opentracing.Span | undefined)[]): void {
43
+ export function withSpan(operation: string, callback: (ctx: TraceContext) => void, ctx?: TraceContext): void {
47
44
  // if we don't have a parent span, don't create a trace here as those <trace-without-root-spans> are not useful.
48
45
  if (!ctx || !ctx.span || !ctx.span.context()) {
49
- callback();
46
+ callback({});
50
47
  return;
51
48
  }
52
49
 
53
- const span = TraceContext.startSpan(operation, ctx, ...referencedSpans);
50
+ const span = TraceContext.startSpan(operation, ctx);
54
51
  try {
55
- callback();
52
+ callback({ span });
56
53
  } catch (e) {
57
- TraceContext.setError({span}, e);
54
+ TraceContext.setError({ span }, e);
58
55
  throw e;
59
56
  } finally {
60
57
  span.finish();
@@ -92,7 +89,12 @@ export namespace TraceContext {
92
89
  addNestedTags(ctx, tags);
93
90
  }
94
91
 
95
- export function setJsonRPCError(ctx: TraceContext, method: string, err: ResponseError<any>, withStatusCode: boolean = false) {
92
+ export function setJsonRPCError(
93
+ ctx: TraceContext,
94
+ method: string,
95
+ err: ResponseError<any>,
96
+ withStatusCode: boolean = false,
97
+ ) {
96
98
  if (!ctx.span) {
97
99
  return;
98
100
  }
@@ -159,7 +161,7 @@ export namespace TraceContext {
159
161
  if (!ctx.span) {
160
162
  return;
161
163
  }
162
- const namespace = _namespace ? `${_namespace}.` : '';
164
+ const namespace = _namespace ? `${_namespace}.` : "";
163
165
 
164
166
  try {
165
167
  for (const k of Object.keys(keyValueMap)) {
@@ -188,7 +190,6 @@ export namespace TraceContext {
188
190
 
189
191
  @injectable()
190
192
  export class TracingManager {
191
-
192
193
  public setup(serviceName: string, opts?: CustomTracerOpts) {
193
194
  initGlobalTracer(this.getTracerForService(serviceName, opts));
194
195
  }
@@ -197,16 +198,16 @@ export class TracingManager {
197
198
  const config: TracingConfig = {
198
199
  disable: false,
199
200
  reporter: {
200
- logSpans: false
201
+ logSpans: false,
201
202
  },
202
203
  serviceName,
203
- }
204
+ };
204
205
  const t = initTracerFromEnv(config, {
205
206
  logger: console,
206
207
  tags: {
207
- 'service.build.commit': process.env.GITPOD_BUILD_GIT_COMMIT,
208
- 'service.build.version': process.env.GITPOD_BUILD_VERSION,
209
- }
208
+ "service.build.commit": process.env.GITPOD_BUILD_GIT_COMMIT,
209
+ "service.build.version": process.env.GITPOD_BUILD_VERSION,
210
+ },
210
211
  });
211
212
 
212
213
  if (opts) {
@@ -216,24 +217,22 @@ export class TracingManager {
216
217
  }
217
218
  return t;
218
219
  }
219
-
220
220
  }
221
221
 
222
222
  export interface CustomTracerOpts {
223
- perOpSampling?: PerOperationSampling
223
+ perOpSampling?: PerOperationSampling;
224
224
  }
225
225
 
226
-
227
226
  // has to conform to https://github.com/jaegertracing/jaeger-client-node/blob/0042b1c0a0796bb655eb93e77ff76ab5e94c2bb6/src/_flow/sampler-thrift.js#L32
228
227
  export interface PerOperationSampling {
229
- [key: string]: boolean
228
+ [key: string]: boolean;
230
229
  }
231
230
 
232
231
  export class PerOperationSampler implements Sampler {
233
232
  constructor(protected readonly fallback: Sampler, protected readonly strategies: PerOperationSampling) {}
234
233
 
235
234
  name(): string {
236
- return 'PerOperationSampler';
235
+ return "PerOperationSampler";
237
236
  }
238
237
 
239
238
  toString(): string {
@@ -273,7 +272,7 @@ export class PerOperationSampler implements Sampler {
273
272
  return false; // TODO equal should be removed
274
273
  }
275
274
 
276
- close(callback: ()=>void): void {
275
+ close(callback: () => void): void {
277
276
  // all nested samplers are of simple types, so we do not need to Close them
278
277
  if (callback) {
279
278
  callback();
@@ -282,18 +281,23 @@ export class PerOperationSampler implements Sampler {
282
281
  }
283
282
 
284
283
  // Augment interfaces with an leading parameter "TraceContext" on every method
285
- type IsValidArg<T> = T extends object ? keyof T extends never ? false : true : true;
286
- type AddTraceContext<T> =
287
- T extends (a: infer A, b: infer B, c: infer C, d: infer D, e: infer E, f: infer F) => infer R ? (
288
- IsValidArg<F> extends true ? (ctx: TraceContextWithSpan, a: A, b: B, c: C, d: D, e: E, f: F) => R :
289
- IsValidArg<E> extends true ? (ctx: TraceContextWithSpan, a: A, b: B, c: C, d: D, e: E) => R :
290
- IsValidArg<D> extends true ? (ctx: TraceContextWithSpan, a: A, b: B, c: C, d: D) => R :
291
- IsValidArg<C> extends true ? (ctx: TraceContextWithSpan, a: A, b: B, c: C) => R :
292
- IsValidArg<B> extends true ? (ctx: TraceContextWithSpan, a: A, b: B) => R :
293
- IsValidArg<A> extends true ? (ctx: TraceContextWithSpan, a: A) => R :
294
- (ctx: TraceContextWithSpan) => Promise<R>
295
- ) : never;
284
+ type IsValidArg<T> = T extends object ? (keyof T extends never ? false : true) : true;
285
+ type AddTraceContext<T> = T extends (a: infer A, b: infer B, c: infer C, d: infer D, e: infer E, f: infer F) => infer R
286
+ ? IsValidArg<F> extends true
287
+ ? (ctx: TraceContextWithSpan, a: A, b: B, c: C, d: D, e: E, f: F) => R
288
+ : IsValidArg<E> extends true
289
+ ? (ctx: TraceContextWithSpan, a: A, b: B, c: C, d: D, e: E) => R
290
+ : IsValidArg<D> extends true
291
+ ? (ctx: TraceContextWithSpan, a: A, b: B, c: C, d: D) => R
292
+ : IsValidArg<C> extends true
293
+ ? (ctx: TraceContextWithSpan, a: A, b: B, c: C) => R
294
+ : IsValidArg<B> extends true
295
+ ? (ctx: TraceContextWithSpan, a: A, b: B) => R
296
+ : IsValidArg<A> extends true
297
+ ? (ctx: TraceContextWithSpan, a: A) => R
298
+ : (ctx: TraceContextWithSpan) => Promise<R>
299
+ : never;
296
300
 
297
301
  export type InterfaceWithTraceContext<T> = {
298
- [P in keyof T]: AddTraceContext<T[P]>
299
- };
302
+ [P in keyof T]: AddTraceContext<T[P]>;
303
+ };
@@ -5,16 +5,13 @@
5
5
  */
6
6
 
7
7
  /**
8
- * These cookies are set in the Theia frontend. This pattern is relied upon in:
9
- * - proxy:
10
- * - to filter it out on port locations
11
- * - to forward it to the server for authentication
12
- * - server:
13
- * - to authenticate access to port locations
14
- */
15
- export const worspacePortAuthCookieName = function(host: string, workspaceId: string): string {
16
- return host
17
- .replace(/https?/, '')
18
- .replace(/[\W_]+/g, "_")
19
- + `_ws_${workspaceId}_port_auth_`;
20
- };
8
+ * These cookies are set in the Theia frontend. This pattern is relied upon in:
9
+ * - proxy:
10
+ * - to filter it out on port locations
11
+ * - to forward it to the server for authentication
12
+ * - server:
13
+ * - to authenticate access to port locations
14
+ */
15
+ export const worspacePortAuthCookieName = function (host: string, workspaceId: string): string {
16
+ return host.replace(/https?/, "").replace(/[\W_]+/g, "_") + `_ws_${workspaceId}_port_auth_`;
17
+ };
@@ -4,10 +4,10 @@
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
- import * as fs from 'fs';
8
- import { filePathTelepresenceAware } from './env';
7
+ import * as fs from "fs";
8
+ import { filePathTelepresenceAware } from "./env";
9
9
  import { DeepPartial } from "./util/deep-partial";
10
- import { PermissionName } from './permission';
10
+ import { PermissionName } from "./permission";
11
11
 
12
12
  export interface WorkspaceCluster {
13
13
  // Name of the workspace cluster.
@@ -35,9 +35,6 @@ export interface WorkspaceCluster {
35
35
 
36
36
  // An optional set of constraints that limit who can start workspaces on the cluster
37
37
  admissionConstraints?: AdmissionConstraint[];
38
-
39
- // An optional set of admission preferences that guide cluster selection
40
- admissionPreferences?: AdmissionPreference[];
41
38
  }
42
39
 
43
40
  export type WorkspaceClusterState = "available" | "cordoned" | "draining";
@@ -50,19 +47,33 @@ export interface TLSConfig {
50
47
  crt: string;
51
48
  }
52
49
  export namespace TLSConfig {
53
- export const loadFromBase64File = (path: string): string => fs.readFileSync(filePathTelepresenceAware(path)).toString("base64");
50
+ export const loadFromBase64File = (path: string): string =>
51
+ fs.readFileSync(filePathTelepresenceAware(path)).toString("base64");
54
52
  }
55
53
  export type WorkspaceClusterWoTLS = Omit<WorkspaceCluster, "tls">;
56
54
  export type WorkspaceManagerConnectionInfo = Pick<WorkspaceCluster, "name" | "url" | "tls">;
57
55
 
58
- export type AdmissionConstraint = AdmissionConstraintFeaturePreview | AdmissionConstraintHasRole | AdmissionConstraintHasUserLevel;
56
+ export type AdmissionConstraint =
57
+ | AdmissionConstraintFeaturePreview
58
+ | AdmissionConstraintHasPermission
59
+ | AdmissionConstraintHasUserLevel
60
+ | AdmissionConstraintHasMoreResources;
59
61
  export type AdmissionConstraintFeaturePreview = { type: "has-feature-preview" };
60
- export type AdmissionConstraintHasRole = { type: "has-permission", permission: PermissionName };
61
- export type AdmissionConstraintHasUserLevel = { type: "has-user-level", level: string };
62
-
63
- export type AdmissionPreference = AdmissionPreferenceUserLevel;
64
- export type AdmissionPreferenceUserLevel = { type: 'user-level', level: string };
65
-
62
+ export type AdmissionConstraintHasPermission = { type: "has-permission"; permission: PermissionName };
63
+ export type AdmissionConstraintHasUserLevel = { type: "has-user-level"; level: string };
64
+ export type AdmissionConstraintHasMoreResources = { type: "has-more-resources" };
65
+
66
+ export namespace AdmissionConstraint {
67
+ export function is(o: any): o is AdmissionConstraint {
68
+ return !!o && "type" in o;
69
+ }
70
+ export function isHasPermissionConstraint(o: any): o is AdmissionConstraintHasPermission {
71
+ return is(o) && o.type === "has-permission";
72
+ }
73
+ export function hasPermission(ac: AdmissionConstraint, permission: PermissionName): boolean {
74
+ return isHasPermissionConstraint(ac) && ac.permission === permission;
75
+ }
76
+ }
66
77
 
67
78
  export const WorkspaceClusterDB = Symbol("WorkspaceClusterDB");
68
79
  export interface WorkspaceClusterDB {
@@ -93,4 +104,4 @@ export interface WorkspaceClusterDB {
93
104
  }
94
105
  export interface WorkspaceClusterFilter extends Pick<WorkspaceCluster, "state" | "govern" | "url"> {
95
106
  minScore: number;
96
- }
107
+ }
@@ -51,6 +51,23 @@ export interface WorkspaceInstance {
51
51
 
52
52
  // instance is hard-deleted on the database and about to be collected by db-sync
53
53
  readonly deleted?: boolean;
54
+
55
+ /**
56
+ * Contains information about the image build, if there was any
57
+ */
58
+ imageBuildInfo?: ImageBuildInfo;
59
+
60
+ /**
61
+ * workspace class, also known as workspace size, determines the type of
62
+ * resources that are provided to the workspace.
63
+ */
64
+ workspaceClass?: string;
65
+
66
+ /**
67
+ * Identifies the team or user to which this instance's runtime should be attributed to
68
+ * (e.g. for usage analytics or billing purposes).
69
+ */
70
+ usageAttributionId?: string;
54
71
  }
55
72
 
56
73
  // WorkspaceInstanceStatus describes the current state of a workspace instance
@@ -90,49 +107,54 @@ export interface WorkspaceInstanceStatus {
90
107
  export type WorkspaceInstancePhase =
91
108
  // unknown indicates an issue within the system in that it cannot determine the actual phase of
92
109
  // a workspace. This phase is usually accompanied by an error.
93
- "unknown" |
110
+ | "unknown"
94
111
 
95
112
  // Preparing means that we haven't actually started the workspace instance just yet, but rather
96
- // are still preparing for launch. This means we're building the Docker image for the workspace.
97
- "preparing" |
113
+ // are still preparing for launch.
114
+ | "preparing"
115
+
116
+ // Building means that we are building the Docker image for the workspace. A workspace will enter this phase only
117
+ // if an image build is required for that workspace.
118
+ | "building"
98
119
 
99
120
  // Pending means the workspace does not yet consume resources in the cluster, but rather is looking for
100
121
  // some space within the cluster. If for example the cluster needs to scale up to accomodate the
101
122
  // workspace, the workspace will be in Pending state until that happened.
102
- "pending" |
123
+ | "pending"
103
124
 
104
125
  // Creating means the workspace is currently being created. Thati includes downloading the images required
105
126
  // to run the workspace over the network. The time spent in this phase varies widely and depends on the current
106
127
  // network speed, image size and cache states.
107
- "creating" |
128
+ | "creating"
108
129
 
109
130
  // Initializing is the phase in which the workspace is executing the appropriate workspace initializer (e.g. Git
110
131
  // clone or backup download). After this phase one can expect the workspace to either be Running or Failed.
111
- "initializing" |
132
+ | "initializing"
112
133
 
113
134
  // Running means the workspace is able to actively perform work, either by serving a user through Theia,
114
135
  // or as a headless workspace.
115
- "running" |
136
+ | "running"
116
137
 
117
138
  // Interrupted is an exceptional state where the container should be running but is temporarily unavailable.
118
139
  // When in this state, we expect it to become running or stopping anytime soon.
119
- "interrupted" |
140
+ | "interrupted"
120
141
 
121
142
  // Stopping means that the workspace is currently shutting down. It could go to stopped every moment.
122
- "stopping" |
143
+ | "stopping"
123
144
 
124
145
  // Stopped means the workspace ended regularly because it was shut down.
125
- "stopped";
146
+ | "stopped";
126
147
 
127
148
  export interface WorkspaceInstanceConditions {
128
149
  // Failed contains the reason the workspace failed to operate. If this field is empty, the workspace has not failed.
129
- failed?: string
150
+ // failed contains technical details for the failure of the workspace.
151
+ failed?: string;
130
152
 
131
153
  // timeout contains the reason the workspace has timed out. If this field is empty, the workspace has not timed out.
132
- timeout?: string
154
+ timeout?: string;
133
155
 
134
156
  // PullingImages marks if the workspace is currently pulling its images. This condition can only be set during PhaseCreating
135
- pullingImages?: boolean
157
+ pullingImages?: boolean;
136
158
 
137
159
  // deployed marks that a workspace instance was sent/deployed at a workspace manager
138
160
  deployed?: boolean;
@@ -143,7 +165,10 @@ export interface WorkspaceInstanceConditions {
143
165
  // ISO8601 timestamp when the first user activity was registered in the frontend. Only set if the workspace is running.
144
166
  firstUserActivity?: string;
145
167
 
146
- // headless_task_failed indicates that a headless workspace task failed
168
+ // headlessTaskFailed indicates that a headless workspace task failed
169
+ // headlessTaskFailed is only set if:
170
+ // * this workspace is headless
171
+ // * the task being run returned a non 0 exit status code
147
172
  headlessTaskFailed?: string;
148
173
 
149
174
  // stopped_by_request is true if the workspace was stopped using a StopWorkspace call
@@ -151,10 +176,10 @@ export interface WorkspaceInstanceConditions {
151
176
  }
152
177
 
153
178
  // AdmissionLevel describes who can access a workspace instance and its ports.
154
- export type AdmissionLevel = 'owner_only' | 'everyone';
179
+ export type AdmissionLevel = "owner_only" | "everyone";
155
180
 
156
181
  // PortVisibility describes how a port can be accessed
157
- export type PortVisibility = 'public' | 'private';
182
+ export type PortVisibility = "public" | "private";
158
183
 
159
184
  // WorkspaceInstancePort describes a port exposed on a workspace instance
160
185
  export interface WorkspaceInstancePort {
@@ -180,19 +205,25 @@ export interface WorkspaceInstanceRepoStatus {
180
205
  uncommitedFiles?: string[];
181
206
 
182
207
  // the total number of uncommited files
183
- totalUncommitedFiles?: number
208
+ totalUncommitedFiles?: number;
184
209
 
185
210
  // untrackedFiles is the list of untracked files in the workspace, possibly truncated
186
211
  untrackedFiles?: string[];
187
212
 
188
213
  // the total number of untracked files
189
- totalUntrackedFiles?: number
214
+ totalUntrackedFiles?: number;
190
215
 
191
216
  // unpushedCommits is the list of unpushed changes in the workspace, possibly truncated
192
217
  unpushedCommits?: string[];
193
218
 
194
219
  // the total number of unpushed changes
195
- totalUnpushedCommits?: number
220
+ totalUnpushedCommits?: number;
221
+ }
222
+
223
+ // ConfigurationIdeConfig ide config of WorkspaceInstanceConfiguration
224
+ export interface ConfigurationIdeConfig {
225
+ useLatest?: boolean;
226
+ desktopIdeAlias?: string;
196
227
  }
197
228
 
198
229
  // WorkspaceInstanceConfiguration contains all per-instance configuration
@@ -208,8 +239,25 @@ export interface WorkspaceInstanceConfiguration {
208
239
  ideImage: string;
209
240
 
210
241
  // desktopIdeImage is the ref of the desktop IDE image this instance uses.
211
- desktopIdeImage?: string
242
+ desktopIdeImage?: string;
212
243
 
213
244
  // supervisorImage is the ref of the supervisor image this instance uses.
214
245
  supervisorImage?: string;
246
+
247
+ ideConfig?: ConfigurationIdeConfig;
248
+ }
249
+
250
+ /**
251
+ * Holds information about the image build (if there was one) for this WorkspaceInstance
252
+ */
253
+ export interface ImageBuildInfo {
254
+ log?: ImageBuildLogInfo;
255
+ }
256
+
257
+ /**
258
+ * Holds information about how to access logs for this an image build
259
+ */
260
+ export interface ImageBuildLogInfo {
261
+ url: string;
262
+ headers: { [key: string]: string };
215
263
  }
package/src/wsready.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
2
+ * Copyright (c) 2022 Gitpod GmbH. All rights reserved.
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
- // generated using github.com/32leaves/bel on 2021-11-04 12:16:53.917570766 +0000 UTC m=+0.006002884
7
+ // generated using github.com/32leaves/bel on 2022-05-18 18:19:49.011672619 +0000 UTC m=+0.006607361
8
8
  // DO NOT MODIFY
9
9
 
10
10
  export enum WorkspaceInitSource {
@@ -13,5 +13,5 @@ export enum WorkspaceInitSource {
13
13
  WorkspaceInitFromOther = "from-other",
14
14
  }
15
15
  export interface WorkspaceReadyMessage {
16
- source: WorkspaceInitSource
16
+ source: WorkspaceInitSource;
17
17
  }