From 9c6dccf1643b2748e8cad65614ff39f25867622c Mon Sep 17 00:00:00 2001 From: paladin-devops <83741749+paladin-devops@users.noreply.github.com> Date: Mon, 29 Jul 2024 15:37:18 -0400 Subject: [PATCH 1/3] [WAYP-2855] no-code: Enable execution mode option for creating no-code workspaces. --- registry_no_code_module.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/registry_no_code_module.go b/registry_no_code_module.go index 2e785be4e..7fe7ea7f1 100644 --- a/registry_no_code_module.go +++ b/registry_no_code_module.go @@ -43,7 +43,6 @@ type RegistryNoCodeModules interface { type RegistryNoCodeModuleCreateWorkspaceOptions struct { Type string `jsonapi:"primary,no-code-module-workspace"` - // Add more create options here // Name is the name of the workspace, which can only include letters, // numbers, and _. This will be used as an identifier and must be unique in @@ -68,6 +67,9 @@ type RegistryNoCodeModuleCreateWorkspaceOptions struct { // SourceUrl is the URL of the source of the workspace. SourceURL *string `jsonapi:"attr,source-url,omitempty"` + + // ExecutionMode is the execution mode of the workspace. + ExecutionMode *string `jsonapi:"attr,execution-mode,omitempty"` } type RegistryNoCodeModuleUpgradeWorkspaceOptions struct { From 46a166b85f490a480cc958b81fa1bc37a4d015e0 Mon Sep 17 00:00:00 2001 From: paladin-devops <83741749+paladin-devops@users.noreply.github.com> Date: Mon, 29 Jul 2024 15:41:11 -0400 Subject: [PATCH 2/3] [WAYP-2855] no-code: Test execution mode on workspace creation. --- registry_no_code_module_integration_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/registry_no_code_module_integration_test.go b/registry_no_code_module_integration_test.go index 5b2c5f5d1..0a68d994a 100644 --- a/registry_no_code_module_integration_test.go +++ b/registry_no_code_module_integration_test.go @@ -359,9 +359,10 @@ func TestRegistryNoCodeModulesCreateWorkspace(t *testing.T) { ctx, ncm.ID, &RegistryNoCodeModuleCreateWorkspaceOptions{ - Name: wn, - SourceName: String(sn), - SourceURL: String(su), + Name: wn, + SourceName: String(sn), + SourceURL: String(su), + ExecutionMode: String("remote"), }, ) r.NoError(err) @@ -371,6 +372,7 @@ func TestRegistryNoCodeModulesCreateWorkspace(t *testing.T) { r.Equal(wn, w.Name) r.Equal(sn, w.SourceName) r.Equal(su, w.SourceURL) + r.Equal("remote", w.ExecutionMode) }) t.Run("fail to create a workspace with a bad module ID", func(t *testing.T) { From 1e2265213095640c9e72358070fc7945347a3d13 Mon Sep 17 00:00:00 2001 From: paladin-devops <83741749+paladin-devops@users.noreply.github.com> Date: Mon, 29 Jul 2024 15:53:58 -0400 Subject: [PATCH 3/3] [WAYP-2855] no-code: Add agent pool ID param. --- registry_no_code_module.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/registry_no_code_module.go b/registry_no_code_module.go index 7fe7ea7f1..0d29d756a 100644 --- a/registry_no_code_module.go +++ b/registry_no_code_module.go @@ -70,6 +70,11 @@ type RegistryNoCodeModuleCreateWorkspaceOptions struct { // ExecutionMode is the execution mode of the workspace. ExecutionMode *string `jsonapi:"attr,execution-mode,omitempty"` + + // AgentPoolId is the ID of the agent pool to use for the workspace. + // This is required when execution mode is set to "agent". + // This must not be specified when execution mode is set to "remote". + AgentPoolID *string `jsonapi:"attr,agent-pool-id,omitempty"` } type RegistryNoCodeModuleUpgradeWorkspaceOptions struct {