Skip to content

chore: rename template restart requirement to autostop requirement #9295

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 3 commits into from
Aug 29, 2023
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
Merge branch 'main' into dean/rename-restart-requirement
  • Loading branch information
deansheather committed Aug 29, 2023
commit d0ac9a95d4760ebda72c02ce94ee9f5d261c7112
10 changes: 5 additions & 5 deletions cli/templateedit.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ func (r *RootCmd) templateEdit() *clibase.Cmd {
Value: clibase.DurationOf(&maxTTL),
},
{
Flag: "restart-requirement-weekdays",
Description: "Edit the template restart requirement weekdays - workspaces created from this template must be restarted on the given weekdays. To unset this value for the template (and disable the restart requirement for the template), pass 'none'.",
Flag: "autostop-requirement-weekdays",
Description: "Edit the template autostop requirement weekdays - workspaces created from this template must be restarted on the given weekdays. To unset this value for the template (and disable the autostop requirement for the template), pass 'none'.",
// TODO(@dean): unhide when we delete max_ttl
Hidden: true,
Value: clibase.Validate(clibase.StringArrayOf(&autostopRequirementDaysOfWeek), func(value *clibase.StringArray) error {
Expand All @@ -162,14 +162,14 @@ func (r *RootCmd) templateEdit() *clibase.Cmd {
}
_, err := codersdk.WeekdaysToBitmap(v)
if err != nil {
return xerrors.Errorf("invalid restart requirement days of week %q: %w", strings.Join(v, ","), err)
return xerrors.Errorf("invalid autostop requirement days of week %q: %w", strings.Join(v, ","), err)
}
return nil
}),
},
{
Flag: "restart-requirement-weeks",
Description: "Edit the template restart requirement weeks - workspaces created from this template must be restarted on an n-weekly basis.",
Flag: "autostop-requirement-weeks",
Description: "Edit the template autostop requirement weeks - workspaces created from this template must be restarted on an n-weekly basis.",
// TODO(@dean): unhide when we delete max_ttl
Hidden: true,
Value: clibase.Int64Of(&autostopRequirementWeeks),
Expand Down
16 changes: 8 additions & 8 deletions cli/templateedit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,20 +263,20 @@ func TestTemplateEdit(t *testing.T) {
{
name: "Weekdays",
flags: []string{
"--restart-requirement-weekdays", "monday",
"--autostop-requirement-weekdays", "monday",
},
},
{
name: "WeekdaysNoneAllowed",
flags: []string{
"--restart-requirement-weekdays", "none",
"--autostop-requirement-weekdays", "none",
},
ok: true,
},
{
name: "Weeks",
flags: []string{
"--restart-requirement-weeks", "1",
"--autostop-requirement-weeks", "1",
},
},
}
Expand Down Expand Up @@ -377,20 +377,20 @@ func TestTemplateEdit(t *testing.T) {
{
name: "Weekdays",
flags: []string{
"--restart-requirement-weekdays", "monday",
"--autostop-requirement-weekdays", "monday",
},
},
{
name: "WeekdaysNoneAllowed",
flags: []string{
"--restart-requirement-weekdays", "none",
"--autostop-requirement-weekdays", "none",
},
ok: true,
},
{
name: "Weeks",
flags: []string{
"--restart-requirement-weeks", "1",
"--autostop-requirement-weeks", "1",
},
},
}
Expand Down Expand Up @@ -504,8 +504,8 @@ func TestTemplateEdit(t *testing.T) {
"templates",
"edit",
template.Name,
"--restart-requirement-weekdays", "monday,tuesday",
"--restart-requirement-weeks", "3",
"--autostop-requirement-weekdays", "monday,tuesday",
"--autostop-requirement-weeks", "3",
}
inv, root := clitest.New(t, cmdArgs...)
clitest.SetupConfig(t, proxyClient, root)
Expand Down
2 changes: 1 addition & 1 deletion coderd/activitybump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestWorkspaceActivityBump(t *testing.T) {
ctx := context.Background()

// deadline allows you to forcibly set a max_deadline on the build. This
// doesn't use template restart requirements and instead edits the
// doesn't use template autostop requirements and instead edits the
// max_deadline on the build directly in the database.
setupActivityTest := func(t *testing.T, deadline ...time.Duration) (client *codersdk.Client, workspace codersdk.Workspace, assertBumped func(want bool)) {
const ttl = time.Minute
Expand Down
90 changes: 45 additions & 45 deletions coderd/apidoc/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.