Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit be426af

Browse files
committed
address PR comments
1 parent f2904f6 commit be426af

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

cli/workspaceautostart.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ import (
1313

1414
const autostartDescriptionLong = `To have your workspace build automatically at a regular time you can enable autostart.
1515
When enabling autostart, provide the minute, hour, and day(s) of week.
16-
The default schedule is at 0900 in your local timezone (TZ env, UTC by default).
16+
The default schedule is at 09:00 in your local timezone (TZ env, UTC by default).
1717
`
1818

1919
func workspaceAutostart() *cobra.Command {
2020
autostartCmd := &cobra.Command{
2121
Use: "autostart enable <workspace>",
2222
Short: "schedule a workspace to automatically start at a regular time",
2323
Long: autostartDescriptionLong,
24-
Example: "coder workspaces autostart enable my-workspace --minute 30 --hour 9 --dow 1-5 --tz Europe/Dublin",
24+
Example: "coder workspaces autostart enable my-workspace --minute 30 --hour 9 --days 1-5 --tz Europe/Dublin",
2525
Hidden: true, // TODO(cian): un-hide when autostart scheduling implemented
2626
}
2727

@@ -73,7 +73,7 @@ func workspaceAutostartEnable() *cobra.Command {
7373

7474
cmd.Flags().StringVar(&autostartMinute, "minute", "0", "autostart minute")
7575
cmd.Flags().StringVar(&autostartHour, "hour", "9", "autostart hour")
76-
cmd.Flags().StringVar(&autostartDayOfWeek, "dow", "1-5", "autostart hour")
76+
cmd.Flags().StringVar(&autostartDayOfWeek, "days", "1-5", "autostart day(s) of week")
7777
tzEnv := os.Getenv("TZ")
7878
if tzEnv == "" {
7979
tzEnv = "UTC"

cli/workspaceautostart_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestWorkspaceAutostart(t *testing.T) {
3030
project = coderdtest.CreateTemplate(t, client, user.OrganizationID, version.ID)
3131
workspace = coderdtest.CreateWorkspace(t, client, codersdk.Me, project.ID)
3232
tz = "Europe/Dublin"
33-
cmdArgs = []string{"workspaces", "autostart", "enable", workspace.Name, "--minute", "30", "--hour", "9", "--dow", "1-5", "--tz", tz}
33+
cmdArgs = []string{"workspaces", "autostart", "enable", workspace.Name, "--minute", "30", "--hour", "9", "--days", "1-5", "--tz", tz}
3434
sched = "CRON_TZ=Europe/Dublin 30 9 * * 1-5"
3535
stdoutBuf = &bytes.Buffer{}
3636
)

cli/workspaceautostop.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ import (
1313

1414
const autostopDescriptionLong = `To have your workspace stop automatically at a regular time you can enable autostop.
1515
When enabling autostop, provide the minute, hour, and day(s) of week.
16-
The default autostop schedule is at 1800 in your local timezone (TZ env, UTC by default).
16+
The default autostop schedule is at 18:00 in your local timezone (TZ env, UTC by default).
1717
`
1818

1919
func workspaceAutostop() *cobra.Command {
2020
autostopCmd := &cobra.Command{
2121
Use: "autostop enable <workspace>",
2222
Short: "schedule a workspace to automatically stop at a regular time",
2323
Long: autostopDescriptionLong,
24-
Example: "coder workspaces autostop enable my-workspace -minute 0 -hour 18 -dow 1-5 -tz Europe/Dublin",
24+
Example: "coder workspaces autostop enable my-workspace --minute 0 --hour 18 --days 1-5 -tz Europe/Dublin",
2525
Hidden: true, // TODO(cian): un-hide when autostop scheduling implemented
2626
}
2727

@@ -73,7 +73,7 @@ func workspaceAutostopEnable() *cobra.Command {
7373

7474
cmd.Flags().StringVar(&autostopMinute, "minute", "0", "autostop minute")
7575
cmd.Flags().StringVar(&autostopHour, "hour", "18", "autostop hour")
76-
cmd.Flags().StringVar(&autostopDayOfWeek, "dow", "1-5", "autostop hour")
76+
cmd.Flags().StringVar(&autostopDayOfWeek, "days", "1-5", "autostop day(s) of week")
7777
tzEnv := os.Getenv("TZ")
7878
if tzEnv == "" {
7979
tzEnv = "UTC"

cli/workspaceautostop_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func TestWorkspaceAutostop(t *testing.T) {
2929
_ = coderdtest.AwaitTemplateVersionJob(t, client, version.ID)
3030
project = coderdtest.CreateTemplate(t, client, user.OrganizationID, version.ID)
3131
workspace = coderdtest.CreateWorkspace(t, client, codersdk.Me, project.ID)
32-
cmdArgs = []string{"workspaces", "autostop", "enable", workspace.Name, "--minute", "30", "--hour", "17", "--dow", "1-5", "--tz", "Europe/Dublin"}
32+
cmdArgs = []string{"workspaces", "autostop", "enable", workspace.Name, "--minute", "30", "--hour", "17", "--days", "1-5", "--tz", "Europe/Dublin"}
3333
sched = "CRON_TZ=Europe/Dublin 30 17 * * 1-5"
3434
stdoutBuf = &bytes.Buffer{}
3535
)

site/src/test_helpers/entities.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const MockWorkspaceAutostartDisabled: WorkspaceAutostartRequest = {
6868
export const MockWorkspaceAutostartEnabled: WorkspaceAutostartRequest = {
6969
// Runs at 9:30am Monday through Friday using Canada/Eastern
7070
// (America/Toronto) time
71-
schedule: "CRON_TZ=Canada/Eastern 30 9 1-5",
71+
schedule: "CRON_TZ=Canada/Eastern 30 9 * * 1-5",
7272
}
7373

7474
export const MockWorkspaceAutostopDisabled: WorkspaceAutostartRequest = {
@@ -77,7 +77,7 @@ export const MockWorkspaceAutostopDisabled: WorkspaceAutostartRequest = {
7777

7878
export const MockWorkspaceAutostopEnabled: WorkspaceAutostartRequest = {
7979
// Runs at 9:30pm Monday through Friday using America/Toronto
80-
schedule: "CRON_TZ=America/Toronto 30 21 1-5",
80+
schedule: "CRON_TZ=America/Toronto 30 21 * * 1-5",
8181
}
8282

8383
export const MockWorkspace: Workspace = {

0 commit comments

Comments
 (0)