Skip to content

feat: Updating workspace prompts new parameters #2598

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

Merged
merged 7 commits into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Comments + import fixes
  • Loading branch information
Emyrk committed Jun 27, 2022
commit a6a81e8e94d94b3c0fe94e174cb4cd88c189b92c
2 changes: 1 addition & 1 deletion cli/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ PromptParamLoop:

err = cliui.WorkspaceResources(cmd.OutOrStdout(), resources, cliui.WorkspaceResourcesOptions{
WorkspaceName: args.NewWorkspaceName,
// Since agent's haven't connected yet, hiding this makes more sense.
// Since agents haven't connected yet, hiding this makes more sense.
HideAgentState: true,
Title: "Workspace Preview",
})
Expand Down
3 changes: 1 addition & 2 deletions cli/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import (
"fmt"
"time"

"github.com/coder/coder/cli/cliflag"

"github.com/spf13/cobra"

"github.com/coder/coder/cli/cliflag"
"github.com/coder/coder/codersdk"
)

Expand Down
2 changes: 2 additions & 0 deletions codersdk/workspaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ type CreateWorkspaceBuildRequest struct {
DryRun bool `json:"dry_run,omitempty"`
ProvisionerState []byte `json:"state,omitempty"`
// ParameterValues are optional. It will write params to the 'workspace' scope.
Copy link
Member

Choose a reason for hiding this comment

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

You should explain the behavior that it doesn't delete the old values, but any present values will overwrite any existing values with the same name.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is true... I wonder if I should delete the unused params 🤔. I can add this in another PR and test it more

// This will overwrite any existing parameters with the same name.
// This will not delete old params not included in this list.
ParameterValues []CreateParameterRequest `json:"parameter_values,omitempty"`
}

Expand Down