-
Notifications
You must be signed in to change notification settings - Fork 903
feat(coderd): notify when workspace is marked as dormant #13868
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
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
9a398e7
feat(coderd): notify when workspace is marked as dormant
BrunoQuaresma fbf99be
Fix role
BrunoQuaresma 40e5801
Apply Danny suggestions
BrunoQuaresma 9a35cbb
Notify dormant workspace on lifecycle executor
BrunoQuaresma 0701572
Notify dormancy on template schedule
BrunoQuaresma 64cf76b
Apply Danny review suggestions
BrunoQuaresma b2f9180
Fix mismatch usage
BrunoQuaresma a445c4c
Resolve migration conflict
BrunoQuaresma bdc08d6
Merge branch 'main' of https://github.com/coder/coder into bq/impleme…
BrunoQuaresma ee7d542
Return error instead of receiving the logger
BrunoQuaresma f6db3c7
Improve verbiage
BrunoQuaresma 95c784a
Merge branch 'main' of github.com:/coder/coder into bq/implement-noti…
dannykopping 68bcfb0
Merge branch 'main' of github.com:/coder/coder into bq/implement-noti…
dannykopping 467a797
Possible implementation simplification
dannykopping 853e59e
Merge branch 'main' of https://github.com/coder/coder into bq/impleme…
BrunoQuaresma bbcb28e
Apply fmt
BrunoQuaresma e3c6f49
Notify after executor is done
BrunoQuaresma 20a8766
Revert refactoring mistake
dannykopping e087172
Add workspace name to the log
BrunoQuaresma 4b99061
Set a fake enqueuer on coderdtest options
BrunoQuaresma 1932168
Merge branch 'bq/implement-notifications' of https://github.com/coder…
BrunoQuaresma 36c043c
Fix migration
BrunoQuaresma d07f9d8
Fix migration sql
BrunoQuaresma 21f7c35
Merge branch 'main' of https://github.com/coder/coder into bq/impleme…
BrunoQuaresma 72da82d
Fix typo
BrunoQuaresma b49cd08
Fix migration number
BrunoQuaresma 6f61f9f
Merge branch 'main' of https://github.com/coder/coder into bq/impleme…
BrunoQuaresma 281b545
Apply Marcin comments
BrunoQuaresma 7f73d90
Fix lint
BrunoQuaresma 7c5de97
Update coderd/autobuild/lifecycle_executor.go
BrunoQuaresma 299cd7f
Apply dannys comment
BrunoQuaresma 16a3c19
Simplify dormancy template
BrunoQuaresma cf9eaec
Merge branch 'main' of https://github.com/coder/coder into bq/impleme…
BrunoQuaresma aea55aa
Add test to verify dormancy in lifecycle executor
BrunoQuaresma 6d47c04
Add placeholder
BrunoQuaresma 7b4ae29
make test pass
sreya 308bd69
fix: lint
mtojek 10ff6cf
Merge branch 'main' of https://github.com/coder/coder into bq/impleme…
BrunoQuaresma 48ad269
Add test to verify notification in lifecycle executor
BrunoQuaresma 0226fdf
Add notification for marked as deletion
BrunoQuaresma 4d71c94
Apply Dannys review comments
BrunoQuaresma e1d5fec
Fix SQL
BrunoQuaresma a2023a1
Rollback dormant at test
BrunoQuaresma bae985c
Fix template
BrunoQuaresma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Possible implementation simplification
Signed-off-by: Danny Kopping <danny@coder.com>
- Loading branch information
commit 467a797edcd927d66c47f0ef44b52f0bee22f05e
There are no files selected for viewing
9 changes: 0 additions & 9 deletions
9
coderd/database/migrations/000226_dormancy_notification_template.up.sql
This file was deleted.
Oops, something went wrong.
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
coderd/database/migrations/000227_dormancy_notification_template.up.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
INSERT INTO notification_templates (id, name, title_template, body_template, "group", actions) | ||
VALUES ('123e4567-e89b-12d3-a456-426614174000', '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}}{{ if .Labels.initiator }} (initiated by: {{ .Labels.initiator }}){{end}}**\n\n' || | ||
BrunoQuaresma marked this conversation as resolved.
Show resolved
Hide resolved
|
||
E'Dormancy refers to a workspace being unused for a defined length of time, and after it exceeds {{.Labels.dormancyHours}} hours of dormancy it will be deleted.\n' || | ||
E'To prevent your workspace from being deleted, simply use it as normal.', | ||
'Workspace Events', '[ | ||
{ | ||
"label": "View workspace", | ||
"url": "{{ base_url }}/@{{.UserName}}/{{.Labels.name}}" | ||
} | ||
]'::jsonb); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.