Skip to content

Commit 79a97aa

Browse files
committed
Move workspace.metadata.context onto a top-level WorkspaceSession property
1 parent f31df63 commit 79a97aa

File tree

16 files changed

+19581
-20023
lines changed

16 files changed

+19581
-20023
lines changed

components/dashboard/src/insights/download/download-sessions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ export const transformSessionRecord = (session: WorkspaceSession) => {
177177
userName: session.owner?.name,
178178

179179
contextURL: session.workspace?.metadata?.originalContextUrl,
180-
contextURL_cloneURL: session.workspace?.metadata?.context?.repository?.cloneUrl,
181-
contextURLSegment_1: session.workspace?.metadata?.context?.repository?.owner,
182-
contextURLSegment_2: session.workspace?.metadata?.context?.repository?.name,
180+
contextURL_cloneURL: session.context?.repository?.cloneUrl,
181+
contextURLSegment_1: session?.context?.repository?.owner,
182+
contextURLSegment_2: session?.context?.repository?.name,
183183

184184
workspaceType: displayWorkspaceType(session.workspace?.spec?.type),
185185
workspaceClass: session.workspace?.spec?.class,

components/public-api/gitpod/v1/workspace.proto

Lines changed: 40 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -319,53 +319,6 @@ message WorkspaceMetadata {
319319

320320
// warnings are user-facing warnings that should be displayed to the user when trying to start the workspace
321321
repeated string warnings = 8;
322-
323-
// context is the context from which the workspace is created
324-
WorkspaceContext context = 9;
325-
}
326-
327-
// WorkspaceContext is the git context from which the workspace is created
328-
message WorkspaceContext {
329-
enum RefType {
330-
REF_TYPE_UNSPECIFIED = 0;
331-
REF_TYPE_BRANCH = 1;
332-
REF_TYPE_TAG = 2;
333-
REF_TYPE_REVISION = 3;
334-
}
335-
336-
message Repository {
337-
// clone_url is the repository url as you would pass it to "git clone".
338-
string clone_url = 1;
339-
340-
// default_branch is the default branch of the repository
341-
string default_branch = 2;
342-
343-
// host is the host of the SCM
344-
string host = 3;
345-
346-
// owner is the owner of the repository
347-
string owner = 4;
348-
349-
// name is the name of the repository
350-
string name = 5;
351-
352-
// private indicates whether the repository is private
353-
bool private = 6;
354-
}
355-
356-
string path = 1;
357-
358-
// ref is the branch or tag name of the repository
359-
string ref = 2;
360-
361-
// ref_type is the type of the ref
362-
RefType ref_type = 3;
363-
364-
// revision is the commit hash of the context
365-
string revision = 4;
366-
367-
// repository is the repository of the context
368-
Repository repository = 5;
369322
}
370323

371324
// WorkspaceSpec specifies the configuration of a workspace for a workspace
@@ -815,7 +768,7 @@ message UpdateWorkspaceRequest {
815768
// timeout configures the workspace timeout
816769
optional UpdateTimeout timeout = 1;
817770

818-
// admission controlls who can access the workspace and its ports.
771+
// admission controls who can access the workspace and its ports.
819772
optional AdmissionLevel admission = 2;
820773

821774
// Note(cw): repeated fields have implicit presence. There's a difference
@@ -942,6 +895,44 @@ message WorkspaceSession {
942895
string avatar_url = 3;
943896
}
944897

898+
// WorkspaceContext is the git context from which the workspace is created
899+
message WorkspaceContext {
900+
enum RefType {
901+
REF_TYPE_UNSPECIFIED = 0;
902+
REF_TYPE_BRANCH = 1;
903+
REF_TYPE_TAG = 2;
904+
REF_TYPE_REVISION = 3;
905+
}
906+
907+
message Repository {
908+
// clone_url is the repository url as you would pass it to "git clone".
909+
string clone_url = 1;
910+
911+
// host is the host of the SCM
912+
string host = 2;
913+
914+
// owner is the owner of the repository
915+
string owner = 3;
916+
// name is the name of the repository
917+
string name = 4;
918+
}
919+
920+
// path is the path of the context (the path following the base repository URL)
921+
string path = 1;
922+
923+
// ref is the branch or tag name of the repository
924+
string ref = 2;
925+
926+
// ref_type is the type of the ref
927+
RefType ref_type = 3;
928+
929+
// revision is the commit hash of the context
930+
string revision = 4;
931+
932+
// repository is the repository of the context
933+
Repository repository = 5;
934+
}
935+
945936
message Metrics {
946937
// workspace_image_size is the size of the workspace image in bytes
947938
int64 workspace_image_size = 1;
@@ -962,4 +953,5 @@ message WorkspaceSession {
962953

963954
Metrics metrics = 8;
964955
Owner owner = 9;
956+
WorkspaceContext context = 10;
965957
}

0 commit comments

Comments
 (0)