From b67454ed285da4138e6fda9c0ccb0cede0537e82 Mon Sep 17 00:00:00 2001 From: defelmnq Date: Mon, 13 Jan 2025 09:08:03 +0000 Subject: [PATCH 1/5] remove window option in open_in --- .../provisionerdserver/provisionerdserver.go | 2 +- provisioner/terraform/provision.go | 6 +-- provisioner/terraform/resources.go | 2 - provisioner/terraform/timings_test.go | 2 +- provisionersdk/proto/provisioner.pb.go | 54 +++++++++---------- provisionersdk/proto/provisioner.proto | 5 +- site/e2e/provisionerGenerated.ts | 5 +- site/src/api/typesGenerated.ts | 1 - 8 files changed, 34 insertions(+), 43 deletions(-) diff --git a/coderd/provisionerdserver/provisionerdserver.go b/coderd/provisionerdserver/provisionerdserver.go index e3bbb621e57f6..b6e71b05fcf75 100644 --- a/coderd/provisionerdserver/provisionerdserver.go +++ b/coderd/provisionerdserver/provisionerdserver.go @@ -2017,7 +2017,7 @@ func InsertWorkspaceResource(ctx context.Context, db database.Store, jobID uuid. switch app.OpenIn { case sdkproto.AppOpenIn_TAB: openIn = database.WorkspaceAppOpenInTab - case sdkproto.AppOpenIn_WINDOW: + case sdkproto.AppOpenIn_SLIM_WINDOW: openIn = database.WorkspaceAppOpenInWindow } diff --git a/provisioner/terraform/provision.go b/provisioner/terraform/provision.go index 70a83bb2334b2..76107ee5fdd70 100644 --- a/provisioner/terraform/provision.go +++ b/provisioner/terraform/provision.go @@ -78,7 +78,7 @@ func (s *server) Plan( e := s.executor(sess.WorkDirectory, database.ProvisionerJobTimingStagePlan) if err := e.checkMinVersion(ctx); err != nil { - return provisionersdk.PlanErrorf(err.Error()) + return provisionersdk.PlanErrorf("%s", err.Error()) } logTerraformEnvVars(sess) @@ -168,7 +168,7 @@ func (s *server) Plan( request.Metadata.GetWorkspaceTransition() == proto.WorkspaceTransition_DESTROY, ) if err != nil { - return provisionersdk.PlanErrorf(err.Error()) + return provisionersdk.PlanErrorf("%s", err.Error()) } // Prepend init timings since they occur prior to plan timings. @@ -189,7 +189,7 @@ func (s *server) Apply( e := s.executor(sess.WorkDirectory, database.ProvisionerJobTimingStageApply) if err := e.checkMinVersion(ctx); err != nil { - return provisionersdk.ApplyErrorf(err.Error()) + return provisionersdk.ApplyErrorf("%s", err.Error()) } logTerraformEnvVars(sess) diff --git a/provisioner/terraform/resources.go b/provisioner/terraform/resources.go index bf668107c4b12..4a48023b7463e 100644 --- a/provisioner/terraform/resources.go +++ b/provisioner/terraform/resources.go @@ -437,8 +437,6 @@ func ConvertState(ctx context.Context, modules []*tfjson.StateModule, rawGraph s switch strings.ToLower(attrs.OpenIn) { case "slim-window": openIn = proto.AppOpenIn_SLIM_WINDOW - case "window": - openIn = proto.AppOpenIn_WINDOW case "tab": openIn = proto.AppOpenIn_TAB } diff --git a/provisioner/terraform/timings_test.go b/provisioner/terraform/timings_test.go index e128b4d654d56..86d24b6ca6ba2 100644 --- a/provisioner/terraform/timings_test.go +++ b/provisioner/terraform/timings_test.go @@ -28,7 +28,7 @@ func TestTimingsFromProvision(t *testing.T) { // Given: a fake terraform bin that behaves as we expect it to. fakeBin := filepath.Join(cwd, "testdata", "timings-aggregation/fake-terraform.sh") - t.Logf(fakeBin) + t.Log("%s", fakeBin) ctx, api := setupProvisioner(t, &provisionerServeOptions{ binaryPath: fakeBin, diff --git a/provisionersdk/proto/provisioner.pb.go b/provisionersdk/proto/provisioner.pb.go index f2c4b601dcf0b..b38c558b7d410 100644 --- a/provisionersdk/proto/provisioner.pb.go +++ b/provisionersdk/proto/provisioner.pb.go @@ -129,22 +129,19 @@ func (AppSharingLevel) EnumDescriptor() ([]byte, []int) { type AppOpenIn int32 const ( - AppOpenIn_WINDOW AppOpenIn = 0 - AppOpenIn_SLIM_WINDOW AppOpenIn = 1 - AppOpenIn_TAB AppOpenIn = 2 + AppOpenIn_SLIM_WINDOW AppOpenIn = 0 + AppOpenIn_TAB AppOpenIn = 1 ) // Enum value maps for AppOpenIn. var ( AppOpenIn_name = map[int32]string{ - 0: "WINDOW", - 1: "SLIM_WINDOW", - 2: "TAB", + 0: "SLIM_WINDOW", + 1: "TAB", } AppOpenIn_value = map[string]int32{ - "WINDOW": 0, - "SLIM_WINDOW": 1, - "TAB": 2, + "SLIM_WINDOW": 0, + "TAB": 1, } ) @@ -1562,7 +1559,7 @@ func (x *App) GetOpenIn() AppOpenIn { if x != nil { return x.OpenIn } - return AppOpenIn_WINDOW + return AppOpenIn_SLIM_WINDOW } // Healthcheck represents configuration for checking for app readiness. @@ -3442,25 +3439,24 @@ var file_provisionersdk_proto_provisioner_proto_rawDesc = []byte{ 0x61, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x09, 0x0a, 0x05, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x55, 0x42, 0x4c, - 0x49, 0x43, 0x10, 0x02, 0x2a, 0x31, 0x0a, 0x09, 0x41, 0x70, 0x70, 0x4f, 0x70, 0x65, 0x6e, 0x49, - 0x6e, 0x12, 0x0a, 0x0a, 0x06, 0x57, 0x49, 0x4e, 0x44, 0x4f, 0x57, 0x10, 0x00, 0x12, 0x0f, 0x0a, - 0x0b, 0x53, 0x4c, 0x49, 0x4d, 0x5f, 0x57, 0x49, 0x4e, 0x44, 0x4f, 0x57, 0x10, 0x01, 0x12, 0x07, - 0x0a, 0x03, 0x54, 0x41, 0x42, 0x10, 0x02, 0x2a, 0x37, 0x0a, 0x13, 0x57, 0x6f, 0x72, 0x6b, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x09, - 0x0a, 0x05, 0x53, 0x54, 0x41, 0x52, 0x54, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x54, 0x4f, - 0x50, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x53, 0x54, 0x52, 0x4f, 0x59, 0x10, 0x02, - 0x2a, 0x35, 0x0a, 0x0b, 0x54, 0x69, 0x6d, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, - 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, - 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x46, - 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x02, 0x32, 0x49, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, - 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, - 0x30, 0x01, 0x42, 0x30, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2f, 0x76, 0x32, 0x2f, - 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x73, 0x64, 0x6b, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x49, 0x43, 0x10, 0x02, 0x2a, 0x25, 0x0a, 0x09, 0x41, 0x70, 0x70, 0x4f, 0x70, 0x65, 0x6e, 0x49, + 0x6e, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x4c, 0x49, 0x4d, 0x5f, 0x57, 0x49, 0x4e, 0x44, 0x4f, 0x57, + 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x41, 0x42, 0x10, 0x01, 0x2a, 0x37, 0x0a, 0x13, 0x57, + 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x54, 0x41, 0x52, 0x54, 0x10, 0x00, 0x12, 0x08, 0x0a, + 0x04, 0x53, 0x54, 0x4f, 0x50, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x53, 0x54, 0x52, + 0x4f, 0x59, 0x10, 0x02, 0x2a, 0x35, 0x0a, 0x0b, 0x54, 0x69, 0x6d, 0x69, 0x6e, 0x67, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, + 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x02, 0x32, 0x49, 0x0a, 0x0b, 0x50, + 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x07, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x30, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72, + 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x73, + 0x64, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/provisionersdk/proto/provisioner.proto b/provisionersdk/proto/provisioner.proto index 8c34d2092ea81..66f1e21d72f2f 100644 --- a/provisionersdk/proto/provisioner.proto +++ b/provisionersdk/proto/provisioner.proto @@ -164,9 +164,8 @@ message Script { } enum AppOpenIn { - WINDOW = 0; - SLIM_WINDOW = 1; - TAB = 2; + SLIM_WINDOW = 0; + TAB = 1; } // App represents a dev-accessible application on the workspace. diff --git a/site/e2e/provisionerGenerated.ts b/site/e2e/provisionerGenerated.ts index a3f64b78f0a6e..b7aab12b3ea4d 100644 --- a/site/e2e/provisionerGenerated.ts +++ b/site/e2e/provisionerGenerated.ts @@ -23,9 +23,8 @@ export enum AppSharingLevel { } export enum AppOpenIn { - WINDOW = 0, - SLIM_WINDOW = 1, - TAB = 2, + SLIM_WINDOW = 0, + TAB = 1, UNRECOGNIZED = -1, } diff --git a/site/src/api/typesGenerated.ts b/site/src/api/typesGenerated.ts index 4956de8691ed7..3eed7022190b5 100644 --- a/site/src/api/typesGenerated.ts +++ b/site/src/api/typesGenerated.ts @@ -2987,7 +2987,6 @@ export type WorkspaceAppOpenIn = "slim-window" | "tab" | "window"; export const WorkspaceAppOpenIns: WorkspaceAppOpenIn[] = [ "slim-window", "tab", - "window", ]; // From codersdk/workspaceapps.go From ecfbdd16ce793f4c024673c4a5c94e3b2f76f79c Mon Sep 17 00:00:00 2001 From: defelmnq Date: Mon, 13 Jan 2025 09:19:44 +0000 Subject: [PATCH 2/5] revert test files gen --- coderd/provisionerdserver/provisionerdserver.go | 2 +- provisioner/terraform/provision.go | 6 +++--- provisioner/terraform/timings_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/coderd/provisionerdserver/provisionerdserver.go b/coderd/provisionerdserver/provisionerdserver.go index b6e71b05fcf75..ddc3ac56170cd 100644 --- a/coderd/provisionerdserver/provisionerdserver.go +++ b/coderd/provisionerdserver/provisionerdserver.go @@ -2018,7 +2018,7 @@ func InsertWorkspaceResource(ctx context.Context, db database.Store, jobID uuid. case sdkproto.AppOpenIn_TAB: openIn = database.WorkspaceAppOpenInTab case sdkproto.AppOpenIn_SLIM_WINDOW: - openIn = database.WorkspaceAppOpenInWindow + openIn = database.WorkspaceAppOpenInSlimWindow } dbApp, err := db.InsertWorkspaceApp(ctx, database.InsertWorkspaceAppParams{ diff --git a/provisioner/terraform/provision.go b/provisioner/terraform/provision.go index 76107ee5fdd70..70a83bb2334b2 100644 --- a/provisioner/terraform/provision.go +++ b/provisioner/terraform/provision.go @@ -78,7 +78,7 @@ func (s *server) Plan( e := s.executor(sess.WorkDirectory, database.ProvisionerJobTimingStagePlan) if err := e.checkMinVersion(ctx); err != nil { - return provisionersdk.PlanErrorf("%s", err.Error()) + return provisionersdk.PlanErrorf(err.Error()) } logTerraformEnvVars(sess) @@ -168,7 +168,7 @@ func (s *server) Plan( request.Metadata.GetWorkspaceTransition() == proto.WorkspaceTransition_DESTROY, ) if err != nil { - return provisionersdk.PlanErrorf("%s", err.Error()) + return provisionersdk.PlanErrorf(err.Error()) } // Prepend init timings since they occur prior to plan timings. @@ -189,7 +189,7 @@ func (s *server) Apply( e := s.executor(sess.WorkDirectory, database.ProvisionerJobTimingStageApply) if err := e.checkMinVersion(ctx); err != nil { - return provisionersdk.ApplyErrorf("%s", err.Error()) + return provisionersdk.ApplyErrorf(err.Error()) } logTerraformEnvVars(sess) diff --git a/provisioner/terraform/timings_test.go b/provisioner/terraform/timings_test.go index 86d24b6ca6ba2..e128b4d654d56 100644 --- a/provisioner/terraform/timings_test.go +++ b/provisioner/terraform/timings_test.go @@ -28,7 +28,7 @@ func TestTimingsFromProvision(t *testing.T) { // Given: a fake terraform bin that behaves as we expect it to. fakeBin := filepath.Join(cwd, "testdata", "timings-aggregation/fake-terraform.sh") - t.Log("%s", fakeBin) + t.Logf(fakeBin) ctx, api := setupProvisioner(t, &provisionerServeOptions{ binaryPath: fakeBin, From 14639cd065fb39994465829db35b048d51a7a476 Mon Sep 17 00:00:00 2001 From: defelmnq Date: Mon, 13 Jan 2025 09:39:50 +0000 Subject: [PATCH 3/5] revert test files gen --- site/src/api/typesGenerated.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/api/typesGenerated.ts b/site/src/api/typesGenerated.ts index 3eed7022190b5..f82d646ec94c1 100644 --- a/site/src/api/typesGenerated.ts +++ b/site/src/api/typesGenerated.ts @@ -2982,7 +2982,7 @@ export const WorkspaceAppHealths: WorkspaceAppHealth[] = [ ]; // From codersdk/workspaceapps.go -export type WorkspaceAppOpenIn = "slim-window" | "tab" | "window"; +export type WorkspaceAppOpenIn = "slim-window" | "tab"; export const WorkspaceAppOpenIns: WorkspaceAppOpenIn[] = [ "slim-window", From 78c805105ba8205844b874ff524c90832a3b8e2f Mon Sep 17 00:00:00 2001 From: defelmnq Date: Mon, 13 Jan 2025 10:20:06 +0000 Subject: [PATCH 4/5] make fmt --- coderd/apidoc/docs.go | 2 -- coderd/apidoc/swagger.json | 3 +-- codersdk/workspaceapps.go | 2 -- docs/reference/api/builds.md | 2 -- docs/reference/api/schemas.md | 1 - docs/reference/api/templates.md | 2 -- site/src/api/typesGenerated.ts | 5 +---- 7 files changed, 2 insertions(+), 15 deletions(-) diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index a8bfcb2af3b19..cf4d3f3d078cc 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -15223,12 +15223,10 @@ const docTemplate = `{ "type": "string", "enum": [ "slim-window", - "window", "tab" ], "x-enum-varnames": [ "WorkspaceAppOpenInSlimWindow", - "WorkspaceAppOpenInWindow", "WorkspaceAppOpenInTab" ] }, diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index d7c32d8a33a52..aa88afaac327e 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -13853,10 +13853,9 @@ }, "codersdk.WorkspaceAppOpenIn": { "type": "string", - "enum": ["slim-window", "window", "tab"], + "enum": ["slim-window", "tab"], "x-enum-varnames": [ "WorkspaceAppOpenInSlimWindow", - "WorkspaceAppOpenInWindow", "WorkspaceAppOpenInTab" ] }, diff --git a/codersdk/workspaceapps.go b/codersdk/workspaceapps.go index 3b4528087800c..25e45ac5eb305 100644 --- a/codersdk/workspaceapps.go +++ b/codersdk/workspaceapps.go @@ -38,13 +38,11 @@ type WorkspaceAppOpenIn string const ( WorkspaceAppOpenInSlimWindow WorkspaceAppOpenIn = "slim-window" - WorkspaceAppOpenInWindow WorkspaceAppOpenIn = "window" WorkspaceAppOpenInTab WorkspaceAppOpenIn = "tab" ) var MapWorkspaceAppOpenIns = map[WorkspaceAppOpenIn]struct{}{ WorkspaceAppOpenInSlimWindow: {}, - WorkspaceAppOpenInWindow: {}, WorkspaceAppOpenInTab: {}, } diff --git a/docs/reference/api/builds.md b/docs/reference/api/builds.md index d9bea14e060c1..2f634badeba7c 100644 --- a/docs/reference/api/builds.md +++ b/docs/reference/api/builds.md @@ -809,7 +809,6 @@ Status Code **200** | `health` | `healthy` | | `health` | `unhealthy` | | `open_in` | `slim-window` | -| `open_in` | `window` | | `open_in` | `tab` | | `sharing_level` | `owner` | | `sharing_level` | `authenticated` | @@ -1447,7 +1446,6 @@ Status Code **200** | `health` | `healthy` | | `health` | `unhealthy` | | `open_in` | `slim-window` | -| `open_in` | `window` | | `open_in` | `tab` | | `sharing_level` | `owner` | | `sharing_level` | `authenticated` | diff --git a/docs/reference/api/schemas.md b/docs/reference/api/schemas.md index b6874bc5b1bc9..745e4469dabd3 100644 --- a/docs/reference/api/schemas.md +++ b/docs/reference/api/schemas.md @@ -7531,7 +7531,6 @@ If the schedule is empty, the user will be updated to use the default schedule.| | Value | |---------------| | `slim-window` | -| `window` | | `tab` | ## codersdk.WorkspaceAppSharingLevel diff --git a/docs/reference/api/templates.md b/docs/reference/api/templates.md index 5af9726b83b35..46efbfc027205 100644 --- a/docs/reference/api/templates.md +++ b/docs/reference/api/templates.md @@ -2281,7 +2281,6 @@ Status Code **200** | `health` | `healthy` | | `health` | `unhealthy` | | `open_in` | `slim-window` | -| `open_in` | `window` | | `open_in` | `tab` | | `sharing_level` | `owner` | | `sharing_level` | `authenticated` | @@ -2716,7 +2715,6 @@ Status Code **200** | `health` | `healthy` | | `health` | `unhealthy` | | `open_in` | `slim-window` | -| `open_in` | `window` | | `open_in` | `tab` | | `sharing_level` | `owner` | | `sharing_level` | `authenticated` | diff --git a/site/src/api/typesGenerated.ts b/site/src/api/typesGenerated.ts index f82d646ec94c1..5908a69c7e629 100644 --- a/site/src/api/typesGenerated.ts +++ b/site/src/api/typesGenerated.ts @@ -2984,10 +2984,7 @@ export const WorkspaceAppHealths: WorkspaceAppHealth[] = [ // From codersdk/workspaceapps.go export type WorkspaceAppOpenIn = "slim-window" | "tab"; -export const WorkspaceAppOpenIns: WorkspaceAppOpenIn[] = [ - "slim-window", - "tab", -]; +export const WorkspaceAppOpenIns: WorkspaceAppOpenIn[] = ["slim-window", "tab"]; // From codersdk/workspaceapps.go export type WorkspaceAppSharingLevel = "authenticated" | "owner" | "public"; From 1fd686dce927356bf9768c2b88723e79ccb2982c Mon Sep 17 00:00:00 2001 From: defelmnq Date: Wed, 15 Jan 2025 01:10:33 +0000 Subject: [PATCH 5/5] add back field as deprecated --- provisionersdk/proto/provisioner.pb.go | 25 +++++++++++++++---------- provisionersdk/proto/provisioner.proto | 5 +++-- site/e2e/provisionerGenerated.ts | 6 ++++-- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/provisionersdk/proto/provisioner.pb.go b/provisionersdk/proto/provisioner.pb.go index b38c558b7d410..992fb30acc13a 100644 --- a/provisionersdk/proto/provisioner.pb.go +++ b/provisionersdk/proto/provisioner.pb.go @@ -129,19 +129,23 @@ func (AppSharingLevel) EnumDescriptor() ([]byte, []int) { type AppOpenIn int32 const ( - AppOpenIn_SLIM_WINDOW AppOpenIn = 0 - AppOpenIn_TAB AppOpenIn = 1 + // Deprecated: Marked as deprecated in provisionersdk/proto/provisioner.proto. + AppOpenIn_WINDOW AppOpenIn = 0 + AppOpenIn_SLIM_WINDOW AppOpenIn = 1 + AppOpenIn_TAB AppOpenIn = 2 ) // Enum value maps for AppOpenIn. var ( AppOpenIn_name = map[int32]string{ - 0: "SLIM_WINDOW", - 1: "TAB", + 0: "WINDOW", + 1: "SLIM_WINDOW", + 2: "TAB", } AppOpenIn_value = map[string]int32{ - "SLIM_WINDOW": 0, - "TAB": 1, + "WINDOW": 0, + "SLIM_WINDOW": 1, + "TAB": 2, } ) @@ -1559,7 +1563,7 @@ func (x *App) GetOpenIn() AppOpenIn { if x != nil { return x.OpenIn } - return AppOpenIn_SLIM_WINDOW + return AppOpenIn_WINDOW } // Healthcheck represents configuration for checking for app readiness. @@ -3439,9 +3443,10 @@ var file_provisionersdk_proto_provisioner_proto_rawDesc = []byte{ 0x61, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x09, 0x0a, 0x05, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x55, 0x42, 0x4c, - 0x49, 0x43, 0x10, 0x02, 0x2a, 0x25, 0x0a, 0x09, 0x41, 0x70, 0x70, 0x4f, 0x70, 0x65, 0x6e, 0x49, - 0x6e, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x4c, 0x49, 0x4d, 0x5f, 0x57, 0x49, 0x4e, 0x44, 0x4f, 0x57, - 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x41, 0x42, 0x10, 0x01, 0x2a, 0x37, 0x0a, 0x13, 0x57, + 0x49, 0x43, 0x10, 0x02, 0x2a, 0x35, 0x0a, 0x09, 0x41, 0x70, 0x70, 0x4f, 0x70, 0x65, 0x6e, 0x49, + 0x6e, 0x12, 0x0e, 0x0a, 0x06, 0x57, 0x49, 0x4e, 0x44, 0x4f, 0x57, 0x10, 0x00, 0x1a, 0x02, 0x08, + 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x4c, 0x49, 0x4d, 0x5f, 0x57, 0x49, 0x4e, 0x44, 0x4f, 0x57, + 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x41, 0x42, 0x10, 0x02, 0x2a, 0x37, 0x0a, 0x13, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x54, 0x41, 0x52, 0x54, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x54, 0x4f, 0x50, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x53, 0x54, 0x52, diff --git a/provisionersdk/proto/provisioner.proto b/provisionersdk/proto/provisioner.proto index 66f1e21d72f2f..6e0c44800adcf 100644 --- a/provisionersdk/proto/provisioner.proto +++ b/provisionersdk/proto/provisioner.proto @@ -164,8 +164,9 @@ message Script { } enum AppOpenIn { - SLIM_WINDOW = 0; - TAB = 1; + WINDOW = 0 [deprecated = true]; + SLIM_WINDOW = 1; + TAB = 2; } // App represents a dev-accessible application on the workspace. diff --git a/site/e2e/provisionerGenerated.ts b/site/e2e/provisionerGenerated.ts index b7aab12b3ea4d..a56143f367c4a 100644 --- a/site/e2e/provisionerGenerated.ts +++ b/site/e2e/provisionerGenerated.ts @@ -23,8 +23,10 @@ export enum AppSharingLevel { } export enum AppOpenIn { - SLIM_WINDOW = 0, - TAB = 1, + /** @deprecated */ + WINDOW = 0, + SLIM_WINDOW = 1, + TAB = 2, UNRECOGNIZED = -1, }