@gitpod/gitpod-protocol 0.1.5-se-multi-repo.24 → 0.1.5-se-prebuilds-failed.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.
@@ -30,7 +30,7 @@ import { GithubUpgradeURL, PlanCoupon } from './payment-protocol';
30
30
  import { TeamSubscription, TeamSubscriptionSlot, TeamSubscriptionSlotResolved } from './team-subscription-protocol';
31
31
  import { RemotePageMessage, RemoteTrackMessage, RemoteIdentifyMessage } from './analytics';
32
32
  import { IDEServer } from './ide-protocol';
33
- import { InstallationAdminSettings } from './installation-admin-protocol';
33
+ import { InstallationAdminSettings, TelemetryData } from './installation-admin-protocol';
34
34
 
35
35
  export interface GitpodClient {
36
36
  onInstanceUpdate(instance: WorkspaceInstance): void;
@@ -136,6 +136,7 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
136
136
  // Admin Settings
137
137
  adminGetSettings(): Promise<InstallationAdminSettings>;
138
138
  adminUpdateSettings(settings: InstallationAdminSettings): Promise<void>;
139
+ adminGetTelemetryData(): Promise<TelemetryData>;
139
140
 
140
141
  // Projects
141
142
  getProviderRepositoriesForUser(params: GetProviderRepositoriesParams): Promise<ProviderRepository[]>;
@@ -11,6 +11,7 @@ export enum HeadlessWorkspaceEventType {
11
11
  FinishedButFailed = "finish-fail",
12
12
  AbortedTimedOut = "aborted-timeout",
13
13
  Aborted = "aborted",
14
+ Failed = "failed",
14
15
  Started = "started"
15
16
  }
16
17
  export namespace HeadlessWorkspaceEventType {
@@ -23,6 +23,13 @@ export interface InstallationAdmin {
23
23
  settings: InstallationAdminSettings;
24
24
  }
25
25
 
26
+ export interface TelemetryData {
27
+ installationAdmin: InstallationAdmin
28
+ totalUsers: number
29
+ totalWorkspaces: number
30
+ totalInstances: number
31
+ }
32
+
26
33
  export namespace InstallationAdmin {
27
34
  export function createDefault(): InstallationAdmin {
28
35
  return {
package/src/protocol.ts CHANGED
@@ -567,14 +567,7 @@ export interface VSCodeConfig {
567
567
  extensions?: string[];
568
568
  }
569
569
 
570
- export interface RepositoryCloneInformation {
571
- url: string;
572
- checkoutLocation?: string;
573
- }
574
-
575
570
  export interface WorkspaceConfig {
576
- mainConfiguration?: string;
577
- additionalRepositories?: RepositoryCloneInformation[];
578
571
  image?: ImageConfig;
579
572
  ports?: PortConfig[];
580
573
  tasks?: TaskConfig[];
@@ -657,7 +650,9 @@ export type PrebuiltWorkspaceState
657
650
  // the prebuild timed out
658
651
  | "timeout"
659
652
  // the prebuild has finished and a snapshot is available
660
- | "available";
653
+ | "available"
654
+ //
655
+ | "failed";
661
656
 
662
657
  export interface PrebuiltWorkspace {
663
658
  id: string;
@@ -693,7 +688,6 @@ export interface PrebuiltWorkspaceUpdatable {
693
688
  repo: string;
694
689
  isResolved: boolean;
695
690
  installationId: string;
696
- commitSHA?: string;
697
691
  issue?: string;
698
692
  contextUrl?: string;
699
693
  }
@@ -823,15 +817,14 @@ export namespace WithSnapshot {
823
817
  }
824
818
  }
825
819
 
826
- export interface WithPrebuild {
827
- snapshotBucketId: string;
820
+ export interface WithPrebuild extends WithSnapshot {
828
821
  prebuildWorkspaceId: string;
829
822
  wasPrebuilt: true;
830
823
  }
831
824
  export namespace WithPrebuild {
832
825
  export function is(context: any): context is WithPrebuild {
833
826
  return context
834
- && 'snapshotBucketId' in context
827
+ && WithSnapshot.is(context)
835
828
  && 'prebuildWorkspaceId' in context
836
829
  && 'wasPrebuilt' in context;
837
830
  }
@@ -875,7 +868,6 @@ export namespace SnapshotContext {
875
868
  export interface StartPrebuildContext extends WorkspaceContext {
876
869
  actual: WorkspaceContext;
877
870
  commitHistory?: string[];
878
- subRepoCommitHistories?: string[][];
879
871
  project?: Project;
880
872
  branch?: string;
881
873
  }
@@ -978,47 +970,9 @@ export namespace AdditionalContentContext {
978
970
  }
979
971
  }
980
972
 
981
- export interface CommitContext extends WorkspaceContext, GitCheckoutInfo {
973
+ export interface CommitContext extends WorkspaceContext, Commit {
982
974
  /** @deprecated Moved to .repository.cloneUrl, left here for backwards-compatibility for old workspace contextes in the DB */
983
975
  cloneUrl?: string
984
-
985
- /**
986
- * The clone and checkout information for the sub-repositories in case of multi-repo projects.
987
- */
988
- subRepositoryCheckoutInfo?: GitCheckoutInfo[];
989
- }
990
-
991
- export namespace CommitContext {
992
- /**
993
- * Creates an identifier pointing to the commits of the CommitContext and all sub-repo commit infos.
994
- * The identifier is max 255 chars long.
995
- * @param commitContext
996
- * @returns identifier for set of commits
997
- */
998
- export function getCommitSHAs(commitContext: CommitContext): string {
999
- if (!commitContext.subRepositoryCheckoutInfo || commitContext.subRepositoryCheckoutInfo.length === 0) {
1000
- return commitContext.revision;
1001
- }
1002
- // it's a multi-repo project, we need to store all commit shas and that needs to fit into 255 chars. Let's only store at most first seven.
1003
- const commits = [commitContext.revision, ... commitContext.subRepositoryCheckoutInfo.map(i => i.revision)];
1004
- const maxLength = Math.min(7, 255 / commits.length);
1005
- return commits.map( r => r.substring(0, maxLength)).join(',');
1006
- }
1007
-
1008
- /**
1009
- * unparses the commitShaIdentifier into an array of commit SHAs.
1010
- * @param commitSHAIdentifier
1011
- * @returns the array of commit SHAs
1012
- */
1013
- export function parseCommitSHAs(commitSHAIdentifier: string): string[] {
1014
- return commitSHAIdentifier.split(',');
1015
- }
1016
- }
1017
-
1018
- export interface GitCheckoutInfo extends Commit {
1019
- checkoutLocation?: string;
1020
- upstreamRemoteURI?: string;
1021
- localBranch?: string;
1022
976
  }
1023
977
 
1024
978
  export namespace CommitContext {
@@ -1218,6 +1172,8 @@ export interface AuthProviderEntry {
1218
1172
  readonly status: AuthProviderEntry.Status;
1219
1173
 
1220
1174
  readonly oauth: OAuth2Config;
1175
+ /** A random string that is to change whenever oauth changes (enforced on DB level) */
1176
+ readonly oauthRevision?: string;
1221
1177
  }
1222
1178
 
1223
1179
  export interface OAuth2Config {
@@ -30,7 +30,13 @@ class SegmentAnalyticsWriter implements IAnalyticsWriter {
30
30
 
31
31
  identify(msg: IdentifyMessage) {
32
32
  try {
33
- this.analytics.identify(msg, (err: Error) => {
33
+ this.analytics.identify({
34
+ ...msg,
35
+ integrations: {
36
+ "All": true,
37
+ "Mixpanel": !!msg.userId
38
+ }
39
+ }, (err: Error) => {
34
40
  if (err) {
35
41
  log.warn("analytics.identify failed", err);
36
42
  }
@@ -42,7 +48,13 @@ class SegmentAnalyticsWriter implements IAnalyticsWriter {
42
48
 
43
49
  track(msg: TrackMessage) {
44
50
  try {
45
- this.analytics.track(msg, (err: Error) => {
51
+ this.analytics.track({
52
+ ...msg,
53
+ integrations: {
54
+ "All": true,
55
+ "Mixpanel": !!msg.userId
56
+ }
57
+ }, (err: Error) => {
46
58
  if (err) {
47
59
  log.warn("analytics.track failed", err);
48
60
  }
@@ -54,7 +66,13 @@ class SegmentAnalyticsWriter implements IAnalyticsWriter {
54
66
 
55
67
  page(msg: PageMessage) {
56
68
  try{
57
- this.analytics.page(msg, (err: Error) => {
69
+ this.analytics.page({
70
+ ...msg,
71
+ integrations: {
72
+ "All": true,
73
+ "Mixpanel": !!msg.userId
74
+ }
75
+ }, (err: Error) => {
58
76
  if (err) {
59
77
  log.warn("analytics.page failed", err);
60
78
  }
package/src/wsready.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Copyright (c) 2022 Gitpod GmbH. All rights reserved.
2
+ * Copyright (c) 2021 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 2022-02-15 11:53:18.380158212 +0000 UTC m=+0.011913675
7
+ // generated using github.com/32leaves/bel on 2021-11-04 12:16:53.917570766 +0000 UTC m=+0.006002884
8
8
  // DO NOT MODIFY
9
9
 
10
10
  export enum WorkspaceInitSource {