feat: notify on task auto pause, manual pause and manual resume#22050
Conversation
9c6c8d1 to
df58893
Compare
df58893 to
931bdee
Compare
| @@ -0,0 +1,63 @@ | |||
| -- Task transition to 'paused' status | |||
There was a problem hiding this comment.
Reminder to check migration number before merging
Documentation CheckUpdates Needed
Automated review via Coder Tasks |
mafredri
left a comment
There was a problem hiding this comment.
Looks good to me. Do we need to expose these in the UI separately or is that automatic?
(Future idea: Depending on how long tasks take to resume, it might be nice to see a notification once the task is active too.)
| return nil | ||
| } | ||
|
|
||
| if reason == database.BuildReasonTaskAutoPause { |
There was a problem hiding this comment.
Note: I guess this would trigger for non-task builds with a wrong reason. But we'll end up logging it below (fetching null UUID), which I think is good. 👍🏻
There was a problem hiding this comment.
I'm not sure I understand how this could trigger for non-task builds given the reason is only set for task builds.
There was a problem hiding this comment.
- Bug
- Changing the 1-to-1 task-workspace relationship
- ???
- Profit
coderd/database/migrations/000419_task_pause_resume_notifications.up.sql
Outdated
Show resolved
Hide resolved
| var ( | ||
| tickCh = make(chan time.Time) | ||
| statsCh = make(chan autobuild.Stats) | ||
| notifyEnq = notificationstest.FakeEnqueuer{} |
There was a problem hiding this comment.
(Follow-up, out of scope): I think we might want to bake in some assertions in the enqueuer here so that if we enqueue unexpectedly OR if we fail to enqueue expectedly, the test fails.
- Links should use `task_id` - Label should be task name not workspace name
@mafredri This is done automatically |
Closes coder/internal#1260