- Notifications
You must be signed in to change notification settings - Fork928
feat: notify owner about failed autobuild#13891
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
450db4d
422fe8b
8970be7
3ace8c6
1001bc1
881dc5e
1852953
42a1c69
e6a5aef
a4a5511
660c2d6
68ae258
3dd09d2
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1100,7 +1100,7 @@ func (s *server) notifyWorkspaceBuildFailed(ctx context.Context, workspace datab | ||
if build.Reason.Valid() && build.Reason == database.BuildReasonInitiator { | ||
mtojek marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
return // failed workspace build initiated by a user should not notify | ||
} | ||
reason =string(build.Reason) | ||
initiator := "autobuild" | ||
if _, err := s.NotificationEnqueuer.Enqueue(ctx, workspace.OwnerID, notifications.WorkspaceAutobuildFailed, | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1702,9 +1702,8 @@ func TestNotifications(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
buildReason database.BuildReason | ||
shouldNotify bool | ||
}{ | ||
{ | ||
name: "initiated by owner", | ||
@@ -1793,7 +1792,6 @@ func TestNotifications(t *testing.T) { | ||
workspace, err = db.GetWorkspaceByID(ctx, workspace.ID) | ||
require.NoError(t, err) | ||
mtojek marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
if tc.shouldNotify { | ||
mtojek marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
// Validate that the notification was sent and contained the expected values. | ||
Uh oh!
There was an error while loading.Please reload this page.