Skip to content

feat: add cli support for --require-active-version#10337

Merged
sreya merged 10 commits into
mainfrom
jon/activeversioncli
Oct 19, 2023
Merged

feat: add cli support for --require-active-version#10337
sreya merged 10 commits into
mainfrom
jon/activeversioncli

Conversation

@sreya

@sreya sreya commented Oct 19, 2023

Copy link
Copy Markdown
Collaborator
  • Also fixes an issue where the active template version was always being used when running coder start.

fixes #7481

@sreya
sreya requested a review from spikecurtis October 19, 2023 05:27
Comment thread cli/start.go Outdated
Comment thread cli/templateedit.go Outdated
@sreya
sreya requested a review from spikecurtis October 19, 2023 07:43

@spikecurtis spikecurtis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, with a few suggestions/FYIs inline. I don't need to review again before merge

Comment thread cli/restart.go
build, err = client.CreateWorkspaceBuild(ctx, workspace.ID, req)
// It's possible for a workspace build to fail due to the template requiring starting
// workspaces with the active version.
if cerr, ok := codersdk.AsError(err); ok && cerr.StatusCode() == http.StatusUnauthorized {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Whoops. This should have been 403 Forbidden, not 401 Unauthorized. Despite the name, 401 is for when we failed to authenticate the user. Probably shouldn't change it now, though.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah that's fair I'll update it in a separate PR

Comment thread cli/restart.go Outdated
Comment thread cli/start.go
Comment thread cli/start.go
Comment thread cli/start.go
Comment thread cli/templatecreate.go Outdated
@sreya
sreya merged commit f5f150d into main Oct 19, 2023
@sreya
sreya deleted the jon/activeversioncli branch October 19, 2023 22:16
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI commands to enable/disable template version selection

2 participants