mirror of
https://github.com/coder/coder.git
synced 2025-07-18 14:17:22 +00:00
feat: notify on workspace update (#15979)
Relates to https://github.com/coder/coder/issues/15845 When the `/workspace/<name>/builds` endpoint is hit, we check if the requested template version is different to the previously used template version. If these values differ, we can assume that the workspace has been manually updated and send the appropriate notification. Automatic updates happen in the lifecycle executor and bypasses this endpoint entirely.
This commit is contained in:
@ -1048,6 +1048,22 @@ func TestNotificationTemplates_Golden(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "TemplateWorkspaceManuallyUpdated",
|
||||
id: notifications.TemplateWorkspaceManuallyUpdated,
|
||||
payload: types.MessagePayload{
|
||||
UserName: "Bobby",
|
||||
UserEmail: "bobby@coder.com",
|
||||
UserUsername: "bobby",
|
||||
Labels: map[string]string{
|
||||
"organization": "bobby-organization",
|
||||
"initiator": "bobby",
|
||||
"workspace": "bobby-workspace",
|
||||
"template": "bobby-template",
|
||||
"version": "alpha",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
// We must have a test case for every notification_template. This is enforced below:
|
||||
|
Reference in New Issue
Block a user