Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WAYP-2855] Enable execution mode option for creating no-code workspaces #941

Merged
merged 3 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion registry_no_code_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll also need to include AgentPoolID too, in case someone uses agent for its ExecutionMode?

}

type RegistryNoCodeModuleUpgradeWorkspaceOptions struct {
Expand Down
8 changes: 5 additions & 3 deletions registry_no_code_module_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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) {
Expand Down
Loading