Skip to content

bug: template settings #3640

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

Closed
matifali opened this issue Aug 23, 2022 · 3 comments · Fixed by #3668 or #3662
Closed

bug: template settings #3640

matifali opened this issue Aug 23, 2022 · 3 comments · Fixed by #3668 or #3662
Assignees

Comments

@matifali
Copy link
Member

matifali commented Aug 23, 2022

Screencast from 08-23-2022 02:37:39 PM.webm
There are multiple issues.

  1. Does not allow saving if,

    • Description is longer than some characters. (Show a limit on the length of maximum characters) or show a message if the user exceeds that limit
    • if MAX_TTL time is 1 year = 31536000000 milliseconds.
  2. Make MAX_TTL in hours

  3. Allow setting MAX_TTL to inf or turning off the auto-shutdown for the template.

@matifali matifali changed the title Template Settings bug: template settings Aug 23, 2022
@johnstcn
Copy link
Member

johnstcn commented Aug 23, 2022

Workaround for 2: set template max_ttl via CLI:

coder template edit mytemplate --max-ttl 8766h # 1 year in hours

CLI syntax is Go duration e.g. 3h2m1s.

@matifali
Copy link
Member Author

Workaround for 2: set template max_ttl via CLI:

coder template edit mytemplate --max-ttl 8766h # 1 year in hours

CLI syntax is Go duration e.g. 3h2m1s.

I am using this workaround for now.

@johnstcn
Copy link
Member

johnstcn commented Aug 23, 2022

  • We should check the bounds of max_ttl in the FE -> cannot be greater than 604800 seconds (7 days)
  • We should also check the bounds of max_ttl in the BE (ditto, 7 days)
    • 7 days is the maximum allowable TTL of a workspace because it's a weekly schedule
  • Backend must not return a number greater than MAX_INT64
  • We should also update the form to allow input in hours (more granular -> use the CLI)
  • We should validate the character limit in the UI to max 128 characters (not bytes) on both FE and BE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants