feat(coderd): notify when workspace is marked as dormant - #13868
Conversation
dannykopping
left a comment
There was a problem hiding this comment.
Good work, left a few thoughts
|
@dannykopping, since the last changes are quite significant, I would recommend reviewing using the commits instead of the full diff. |
Signed-off-by: Danny Kopping <danny@coder.com>
|
@BrunoQuaresma I tried to move this along while you were out, but I didn't have much time. I think we should pass the enqueuer during the instantiation phase of the various areas, rather than passing the enqueuer/logger at the last moment of responsibility like you were doing before. I fixed the migration and added some detail to the notification. |
Co-authored-by: Danny Kopping <danny@coder.com>
ba7fbd9 to
299cd7f
Compare
|
@BrunoQuaresma is it still a draft PR or a regular one? |
I made it draft so that we don't merge accidentally before testing it fully, since it has approvals already. |
…nt-notifications
…nt-notifications
|
@dannykopping @mtojek The biggest changes since the last review:
|
mtojek
left a comment
There was a problem hiding this comment.
I seconded a few Danny's comments.
@BrunoQuaresma If you feel a need to clarify some comments, please sync with @dannykopping. Let's not elongate this task anymore, it is already a leftover from the last sprint.
| '0ea69165-ec14-4314-91f1-69566ac3c5a0', | ||
| 'Workspace Marked as Dormant', | ||
| E'Workspace "{{.Labels.name}}" marked as dormant', | ||
| E'Hi {{.UserName}}\n\n' || E'Your workspace **{{.Labels.name}}** has been marked as **dormant**.\n' || E'The specified reason was "**{{.Labels.reason}} (initiated by: {{ .Labels.initiator }}){{end}}**\n\n' || E'Dormancy refers to a workspace being unused for a defined length of time, and after it exceeds {{.Labels.dormancyHours}} hours of dormancy might be deleted.\n' || E'To activate your workspace again, simply use it as normal.', |
There was a problem hiding this comment.
The wording is a little weird here. Can we change it and add a link to the dormancy docs:
I don't think we need to include the initiator, just improve the reasons (see end of message).
Hi
{user-name}, your workspace{ws-name}has been marked dormant because of{reason}.
Append if dormancy cleanup is enabled and dormancy_hours < 24:
Dormant workspaces are automatically deleted after
{dormancy_hours}hours of inactivity.
Append if dormancy cleanup is enabled, and dormancy_hours > 24:
Dormant workspaces are automatically deleted after
{dormancy_hours // 24}days of inactivity.
To prevent deletion, use your workspace with the link below.
The reasons also fit into differing grammatic context:
- Lifecycle executor: "breached the template's threshold for inactivity"
- API: "requested by user"
- Template: "template updated to new dormancy policy"
If we use these, they'd fit the above messages better.
- Lifcycle: "prolonged inactivity, exceeding the dormancy threshold"
- API: "a user request"
- Template: "an update to the template's dormancy"
There was a problem hiding this comment.
Going to refactor the templates in the next PR to avoid further postponement.
Related to coder/internal#7