X Tutup
Skip to content

feat: notify on task auto pause, manual pause and manual resume#22050

Merged
DanielleMaywood merged 4 commits intomainfrom
danielle/coco-1-tasks-notification-templates-for-pauseresume
Feb 18, 2026
Merged

feat: notify on task auto pause, manual pause and manual resume#22050
DanielleMaywood merged 4 commits intomainfrom
danielle/coco-1-tasks-notification-templates-for-pauseresume

Conversation

@DanielleMaywood
Copy link
Contributor

@DanielleMaywood DanielleMaywood commented Feb 11, 2026

@DanielleMaywood DanielleMaywood force-pushed the danielle/coco-1-tasks-notification-templates-for-pauseresume branch 6 times, most recently from 9c6c8d1 to df58893 Compare February 18, 2026 10:51
@DanielleMaywood DanielleMaywood force-pushed the danielle/coco-1-tasks-notification-templates-for-pauseresume branch from df58893 to 931bdee Compare February 18, 2026 11:22
@DanielleMaywood DanielleMaywood changed the title feat: notify on task pause and resume feat: notify on task auto pause, manual pause and manual resume Feb 18, 2026
@@ -0,0 +1,63 @@
-- Task transition to 'paused' status
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder to check migration number before merging

@DanielleMaywood DanielleMaywood marked this pull request as ready for review February 18, 2026 11:54
@DanielleMaywood DanielleMaywood requested review from johnstcn and mafredri and removed request for mafredri February 18, 2026 11:54
@coder-tasks
Copy link
Contributor

coder-tasks bot commented Feb 18, 2026

Documentation Check

Updates Needed

  • docs/admin/monitoring/notifications/index.md - The "Task Events" section lists only "Task Idle" and "Task Working". This PR adds Task Paused and Task Resumed notification events (with a pause_reason label for paused events). These two new events should be added to the list.

Automated review via Coder Tasks

Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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. 👍🏻

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand how this could trigger for non-task builds given the reason is only set for task builds.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Bug
  2. Changing the 1-to-1 task-workspace relationship
  3. ???
  4. Profit

var (
tickCh = make(chan time.Time)
statsCh = make(chan autobuild.Stats)
notifyEnq = notificationstest.FakeEnqueuer{}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(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.

@DanielleMaywood
Copy link
Contributor Author

DanielleMaywood commented Feb 18, 2026

Do we need to expose these in the UI separately or is that automatic?

@mafredri This is done automatically

@DanielleMaywood DanielleMaywood merged commit 31c1279 into main Feb 18, 2026
27 checks passed
@DanielleMaywood DanielleMaywood deleted the danielle/coco-1-tasks-notification-templates-for-pauseresume branch February 18, 2026 16:30
@github-actions github-actions bot locked and limited conversation to collaborators Feb 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tasks: Notification templates for pause/resume

3 participants

X Tutup