@gitpod/gitpod-protocol 0.1.5-mixpanel-migration-prep.0 → 0.1.5-mp-docs-wsp-phase.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 (38) hide show
  1. package/data/gitpod-schema.json +28 -2
  2. package/lib/admin-protocol.d.ts +4 -2
  3. package/lib/admin-protocol.d.ts.map +1 -1
  4. package/lib/admin-protocol.js.map +1 -1
  5. package/lib/gitpod-service.d.ts +1 -9
  6. package/lib/gitpod-service.d.ts.map +1 -1
  7. package/lib/gitpod-service.js.map +1 -1
  8. package/lib/headless-workspace-log.d.ts +1 -0
  9. package/lib/headless-workspace-log.d.ts.map +1 -1
  10. package/lib/headless-workspace-log.js +1 -0
  11. package/lib/headless-workspace-log.js.map +1 -1
  12. package/lib/protocol.d.ts +36 -25
  13. package/lib/protocol.d.ts.map +1 -1
  14. package/lib/protocol.js +22 -0
  15. package/lib/protocol.js.map +1 -1
  16. package/lib/team-subscription-protocol.d.ts +2 -0
  17. package/lib/team-subscription-protocol.d.ts.map +1 -1
  18. package/lib/team-subscription-protocol.js.map +1 -1
  19. package/lib/workspace-instance.d.ts +2 -2
  20. package/lib/workspace-instance.d.ts.map +1 -1
  21. package/lib/wsready.d.ts +1 -1
  22. package/lib/wsready.js +2 -2
  23. package/package.json +2 -2
  24. package/pkg-yarn.lock +2 -2
  25. package/provenance-bundle.jsonl +1 -1
  26. package/src/admin-protocol.ts +4 -2
  27. package/src/gitpod-service.ts +2 -11
  28. package/src/headless-workspace-log.ts +1 -0
  29. package/src/protocol.ts +57 -33
  30. package/src/team-subscription-protocol.ts +2 -0
  31. package/src/workspace-instance.ts +27 -23
  32. package/src/wsready.ts +2 -2
  33. package/data/builtin-theia-plugins.json +0 -372
  34. package/lib/theia-plugins.d.ts +0 -11
  35. package/lib/theia-plugins.d.ts.map +0 -1
  36. package/lib/theia-plugins.js +0 -8
  37. package/lib/theia-plugins.js.map +0 -1
  38. package/src/theia-plugins.ts +0 -11
package/src/protocol.ts CHANGED
@@ -7,6 +7,7 @@
7
7
  import { WorkspaceInstance, PortVisibility } from "./workspace-instance";
8
8
  import { RoleOrPermission } from "./permission";
9
9
  import { Project } from "./teams-projects-protocol";
10
+ import { createHash } from "crypto";
10
11
 
11
12
  export interface UserInfo {
12
13
  name?: string
@@ -515,24 +516,6 @@ export namespace Workspace {
515
516
  }
516
517
  }
517
518
 
518
- export interface PreparePluginUploadParams {
519
- fullPluginName: string;
520
- }
521
-
522
- export interface ResolvePluginsParams {
523
- config?: WorkspaceConfig
524
- builtins?: ResolvedPlugins
525
- vsxRegistryUrl?: string
526
- }
527
-
528
- export interface InstallPluginsParams {
529
- pluginIds: string[]
530
- }
531
-
532
- export interface UninstallPluginParams {
533
- pluginId: string;
534
- }
535
-
536
519
  export interface GuessGitTokenScopesParams {
537
520
  host: string
538
521
  repoUrl: string
@@ -551,23 +534,18 @@ export interface GuessedGitTokenScopes {
551
534
  scopes?: string[]
552
535
  }
553
536
 
554
- export type ResolvedPluginKind = 'user' | 'workspace' | 'builtin';
555
-
556
- export interface ResolvedPlugins {
557
- [pluginId: string]: ResolvedPlugin | undefined
537
+ export interface VSCodeConfig {
538
+ extensions?: string[];
558
539
  }
559
540
 
560
- export interface ResolvedPlugin {
561
- fullPluginName: string;
541
+ export interface RepositoryCloneInformation {
562
542
  url: string;
563
- kind: ResolvedPluginKind;
564
- }
565
-
566
- export interface VSCodeConfig {
567
- extensions?: string[];
543
+ checkoutLocation?: string;
568
544
  }
569
545
 
570
546
  export interface WorkspaceConfig {
547
+ mainConfiguration?: string;
548
+ additionalRepositories?: RepositoryCloneInformation[];
571
549
  image?: ImageConfig;
572
550
  ports?: PortConfig[];
573
551
  tasks?: TaskConfig[];
@@ -645,12 +623,14 @@ export type PrebuiltWorkspaceState
645
623
  = "queued"
646
624
  // the workspace prebuild is currently running (i.e. there's a workspace pod deployed)
647
625
  | "building"
648
- // the prebuild failed due to some issue with the system (e.g. missed a message, could not start workspace)
626
+ // the prebuild was aborted
649
627
  | "aborted"
650
628
  // the prebuild timed out
651
629
  | "timeout"
652
- // the prebuild has finished and a snapshot is available
653
- | "available";
630
+ // the prebuild has finished (even if a headless task failed) and a snapshot is available
631
+ | "available"
632
+ // the prebuild (headless workspace) failed due to some system error
633
+ | "failed";
654
634
 
655
635
  export interface PrebuiltWorkspace {
656
636
  id: string;
@@ -686,6 +666,10 @@ export interface PrebuiltWorkspaceUpdatable {
686
666
  repo: string;
687
667
  isResolved: boolean;
688
668
  installationId: string;
669
+ /**
670
+ * the commitSHA of the commit that triggered the prebuild
671
+ */
672
+ commitSHA?: string;
689
673
  issue?: string;
690
674
  contextUrl?: string;
691
675
  }
@@ -866,6 +850,10 @@ export namespace SnapshotContext {
866
850
  export interface StartPrebuildContext extends WorkspaceContext {
867
851
  actual: WorkspaceContext;
868
852
  commitHistory?: string[];
853
+ additionalRepositoryCommitHistories?: {
854
+ cloneUrl: string;
855
+ commitHistory: string[];
856
+ }[];
869
857
  project?: Project;
870
858
  branch?: string;
871
859
  }
@@ -968,9 +956,43 @@ export namespace AdditionalContentContext {
968
956
  }
969
957
  }
970
958
 
971
- export interface CommitContext extends WorkspaceContext, Commit {
959
+ export interface CommitContext extends WorkspaceContext, GitCheckoutInfo {
972
960
  /** @deprecated Moved to .repository.cloneUrl, left here for backwards-compatibility for old workspace contextes in the DB */
973
961
  cloneUrl?: string
962
+
963
+ /**
964
+ * The clone and checkout information for additional repositories in case of multi-repo projects.
965
+ */
966
+ additionalRepositoryCheckoutInfo?: GitCheckoutInfo[];
967
+ }
968
+
969
+ export namespace CommitContext {
970
+
971
+ /**
972
+ * Creates a hash for all the commits of the CommitContext and all sub-repo commit infos.
973
+ * The hash is max 255 chars long.
974
+ * @param commitContext
975
+ * @returns hash for commitcontext
976
+ */
977
+ export function computeHash(commitContext: CommitContext): string {
978
+ // for single commits we use the revision to be backward compatible.
979
+ if (!commitContext.additionalRepositoryCheckoutInfo || commitContext.additionalRepositoryCheckoutInfo.length === 0) {
980
+ return commitContext.revision;
981
+ }
982
+ const hasher = createHash('sha256');
983
+ hasher.update(commitContext.revision);
984
+ for (const info of commitContext.additionalRepositoryCheckoutInfo) {
985
+ hasher.update(info.revision);
986
+ }
987
+ return hasher.digest('hex');
988
+ }
989
+
990
+ }
991
+
992
+ export interface GitCheckoutInfo extends Commit {
993
+ checkoutLocation?: string;
994
+ upstreamRemoteURI?: string;
995
+ localBranch?: string;
974
996
  }
975
997
 
976
998
  export namespace CommitContext {
@@ -1170,6 +1192,8 @@ export interface AuthProviderEntry {
1170
1192
  readonly status: AuthProviderEntry.Status;
1171
1193
 
1172
1194
  readonly oauth: OAuth2Config;
1195
+ /** A random string that is to change whenever oauth changes (enforced on DB level) */
1196
+ readonly oauthRevision?: string;
1173
1197
  }
1174
1198
 
1175
1199
  export interface OAuth2Config {
@@ -18,6 +18,8 @@ export interface TeamSubscription {
18
18
  paymentReference: string;
19
19
  cancellationDate?: string;
20
20
  deleted?: boolean;
21
+ /** If this flag is set slots are not eligibile for clusters with "more-resources" - even if their plan might be */
22
+ excludeFromMoreResources: boolean;
21
23
  }
22
24
 
23
25
  export namespace TeamSubscription {
@@ -55,7 +55,7 @@ export interface WorkspaceInstance {
55
55
  /**
56
56
  * Contains information about the image build, if there was any
57
57
  */
58
- imageBuildInfo?: ImageBuildInfo;
58
+ imageBuildInfo?: ImageBuildInfo;
59
59
  }
60
60
 
61
61
  // WorkspaceInstanceStatus describes the current state of a workspace instance
@@ -95,49 +95,50 @@ export interface WorkspaceInstanceStatus {
95
95
  export type WorkspaceInstancePhase =
96
96
  // unknown indicates an issue within the system in that it cannot determine the actual phase of
97
97
  // a workspace. This phase is usually accompanied by an error.
98
- "unknown" |
98
+ | "unknown"
99
99
 
100
100
  // Preparing means that we haven't actually started the workspace instance just yet, but rather
101
101
  // are still preparing for launch. This means we're building the Docker image for the workspace.
102
- "preparing" |
102
+ | "preparing"
103
103
 
104
104
  // Pending means the workspace does not yet consume resources in the cluster, but rather is looking for
105
105
  // some space within the cluster. If for example the cluster needs to scale up to accomodate the
106
106
  // workspace, the workspace will be in Pending state until that happened.
107
- "pending" |
107
+ | "pending"
108
108
 
109
109
  // Creating means the workspace is currently being created. Thati includes downloading the images required
110
110
  // to run the workspace over the network. The time spent in this phase varies widely and depends on the current
111
111
  // network speed, image size and cache states.
112
- "creating" |
112
+ | "creating"
113
113
 
114
114
  // Initializing is the phase in which the workspace is executing the appropriate workspace initializer (e.g. Git
115
115
  // clone or backup download). After this phase one can expect the workspace to either be Running or Failed.
116
- "initializing" |
116
+ | "initializing"
117
117
 
118
118
  // Running means the workspace is able to actively perform work, either by serving a user through Theia,
119
119
  // or as a headless workspace.
120
- "running" |
120
+ | "running"
121
121
 
122
122
  // Interrupted is an exceptional state where the container should be running but is temporarily unavailable.
123
123
  // When in this state, we expect it to become running or stopping anytime soon.
124
- "interrupted" |
124
+ | "interrupted"
125
125
 
126
126
  // Stopping means that the workspace is currently shutting down. It could go to stopped every moment.
127
- "stopping" |
127
+ | "stopping"
128
128
 
129
129
  // Stopped means the workspace ended regularly because it was shut down.
130
- "stopped";
130
+ | "stopped";
131
131
 
132
132
  export interface WorkspaceInstanceConditions {
133
133
  // Failed contains the reason the workspace failed to operate. If this field is empty, the workspace has not failed.
134
- failed?: string
134
+ // failed contains technical details for the failure of the workspace.
135
+ failed?: string;
135
136
 
136
137
  // timeout contains the reason the workspace has timed out. If this field is empty, the workspace has not timed out.
137
- timeout?: string
138
+ timeout?: string;
138
139
 
139
140
  // PullingImages marks if the workspace is currently pulling its images. This condition can only be set during PhaseCreating
140
- pullingImages?: boolean
141
+ pullingImages?: boolean;
141
142
 
142
143
  // deployed marks that a workspace instance was sent/deployed at a workspace manager
143
144
  deployed?: boolean;
@@ -148,7 +149,10 @@ export interface WorkspaceInstanceConditions {
148
149
  // ISO8601 timestamp when the first user activity was registered in the frontend. Only set if the workspace is running.
149
150
  firstUserActivity?: string;
150
151
 
151
- // headless_task_failed indicates that a headless workspace task failed
152
+ // headlessTaskFailed indicates that a headless workspace task failed
153
+ // headlessTaskFailed is only set if:
154
+ // * this workspace is headless
155
+ // * the task being run returned a non 0 exit status code
152
156
  headlessTaskFailed?: string;
153
157
 
154
158
  // stopped_by_request is true if the workspace was stopped using a StopWorkspace call
@@ -156,10 +160,10 @@ export interface WorkspaceInstanceConditions {
156
160
  }
157
161
 
158
162
  // AdmissionLevel describes who can access a workspace instance and its ports.
159
- export type AdmissionLevel = 'owner_only' | 'everyone';
163
+ export type AdmissionLevel = "owner_only" | "everyone";
160
164
 
161
165
  // PortVisibility describes how a port can be accessed
162
- export type PortVisibility = 'public' | 'private';
166
+ export type PortVisibility = "public" | "private";
163
167
 
164
168
  // WorkspaceInstancePort describes a port exposed on a workspace instance
165
169
  export interface WorkspaceInstancePort {
@@ -185,19 +189,19 @@ export interface WorkspaceInstanceRepoStatus {
185
189
  uncommitedFiles?: string[];
186
190
 
187
191
  // the total number of uncommited files
188
- totalUncommitedFiles?: number
192
+ totalUncommitedFiles?: number;
189
193
 
190
194
  // untrackedFiles is the list of untracked files in the workspace, possibly truncated
191
195
  untrackedFiles?: string[];
192
196
 
193
197
  // the total number of untracked files
194
- totalUntrackedFiles?: number
198
+ totalUntrackedFiles?: number;
195
199
 
196
200
  // unpushedCommits is the list of unpushed changes in the workspace, possibly truncated
197
201
  unpushedCommits?: string[];
198
202
 
199
203
  // the total number of unpushed changes
200
- totalUnpushedCommits?: number
204
+ totalUnpushedCommits?: number;
201
205
  }
202
206
 
203
207
  // WorkspaceInstanceConfiguration contains all per-instance configuration
@@ -213,7 +217,7 @@ export interface WorkspaceInstanceConfiguration {
213
217
  ideImage: string;
214
218
 
215
219
  // desktopIdeImage is the ref of the desktop IDE image this instance uses.
216
- desktopIdeImage?: string
220
+ desktopIdeImage?: string;
217
221
 
218
222
  // supervisorImage is the ref of the supervisor image this instance uses.
219
223
  supervisorImage?: string;
@@ -223,13 +227,13 @@ export interface WorkspaceInstanceConfiguration {
223
227
  * Holds information about the image build (if there was one) for this WorkspaceInstance
224
228
  */
225
229
  export interface ImageBuildInfo {
226
- log?: ImageBuildLogInfo,
230
+ log?: ImageBuildLogInfo;
227
231
  }
228
232
 
229
233
  /**
230
234
  * Holds information about how to access logs for this an image build
231
235
  */
232
236
  export interface ImageBuildLogInfo {
233
- url: string,
234
- headers: { [key: string]: string },
237
+ url: string;
238
+ headers: { [key: string]: string };
235
239
  }
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-02-15 11:53:18.380158212 +0000 UTC m=+0.011913675
8
8
  // DO NOT MODIFY
9
9
 
10
10
  export enum WorkspaceInitSource {