-
Notifications
You must be signed in to change notification settings - Fork 881
Streamline coder autostart
UX
#1647
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
Comments
Oops, I think this may be redundant with #1641 |
This ticket is written way better though! |
Blocking this ticket on the autostart UI work. As @vapurrmaid mentions, it will likely be easier to refactor after those pieces are in place, in 1 PR like we did for ttl together |
Something else to consider is a time-based instead of duration-based approach to auto-off, following the logic in #2141. |
We need to document that we only support IANA Time Locations, and not time zones for the TZ input. If you look at this list, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones, the value must be in the This is a bit unfortunate as timezones like CST and CDT are not supported (although daylight savings is a headache on it's own). From a brief look a the I think the 2 timezones people will use is Currently we don't support
I wrote a brief PR (https://github.com/coder/coder/pull/2207/files) on how we can use Lines 101 to 109 in da00128
|
100%
This is probably for the best. Having daylight-savings-time-specific timezones in a schedule is probably going to lead to confusion.
If whoever uses this lives in a location where daylight savings time is active, storing their autostart time in UTC will cause bugs. |
I didn't think about this. I wonder if we have this issue in v1. If we handle TZ parsing manually, we could maybe support zone syntax? This part of the code makes it look like we can set the location manually? coder/coderd/autobuild/schedule/schedule.go Lines 53 to 60 in fff59ef
I wonder if this works? Then we can support more common zones? tz, _ := time.Parse("MST", "CDT")
schedule.Location = tz.Location() Or alternatively, just tell them to use IANA locations. Maybe add this code to catch the common mistake of using a zone name. It is confusing the output text uses a zone
if strings.Contains(err.Error(), "provided bad location") {
_, err := time.Parse("MST", autostartTimezone)
if err == nil {
// We should find a nice easy list to use.
return xerrors.Errorf("It appears you have entered a timezone, try using a location from the IANA location list https://gist.github.com/aviflax/a4093965be1cd008f172")
}
} |
I just want to be completely clear here: not supporting time zones like CDT or EST is a feature. We never want to support those because they they don't adapt to human needs and expectations. |
This commit adds the following changes: - autostart enable|disable => autostart set|unset - autostart enable now accepts a more natual schedule format: <time> <days-of-week> <location> - autostart show now shows configured timezone - π automatic timezone detection across mac, windows, linux π Fixes #1647
cc @johnstcn (thank you! ππ½ββοΈ)
subcommand naming
coder autostart enable
implies it just turns on autostart, not that it would update it too. For example, you wouldn't enable autostart multiple times. Perhapscoder autostart set
makes more sense?restructured set syntax
I believe that we should use defaults only when they satisfy a majority of the use cases.
In the case of autostart, maybe 1 in 20 will use UTC, and maybe 1 in 3 want their workspace to start at 9am. I believe we should remove these defaults and force users to set their workspace schedule as follows:
display schedule more clearly
In the current schedule print, the displayed time zone is extracted from the local system when the configured time zone may be different. There's also no acknowledgement of which days autostart is enabled for.
What we display here should closely map to how autostart is configured. I suggest this format:
Acceptance Criteria
autostart enable|disable
->autostart set|unset
--autostart-hour --autostart-minute --autostart-dow
->HH:MM{AM|PM} [DOW] [TIMEZONE]
MON-SUNSUN-SAT Edit: our existing schedules assume Sunday is the first day of the week./etc/localtime
)/etc/localtime
)autostart show
output showing DOW and in configured autostart timezoneThe text was updated successfully, but these errors were encountered: