Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: notify about manual failed builds#14419

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

Merged
mtojek merged 16 commits intomainfrom16-manual-build-failed
Aug 27, 2024
Merged

Conversation

mtojek
Copy link
Member

@mtojekmtojek commentedAug 23, 2024
edited
Loading

Fixes:coder/internal#16

This PR modifies ProvisionerdServer to notify template admins about manual workspace build failures.

@mtojekmtojek self-assigned thisAug 23, 2024
@mtojekmtojek marked this pull request as ready for reviewAugust 26, 2024 13:14
Comment on lines +1851 to +1861
assert.Equal(t, notifEnq.Sent[0].UserID, templateAdmin.ID)
assert.Equal(t, notifEnq.Sent[0].TemplateID, notifications.TemplateWorkspaceManualBuildFailed)
assert.Contains(t, notifEnq.Sent[0].Targets, template.ID)
assert.Contains(t, notifEnq.Sent[0].Targets, workspace.ID)
assert.Contains(t, notifEnq.Sent[0].Targets, workspace.OrganizationID)
assert.Contains(t, notifEnq.Sent[0].Targets, user.ID)
assert.Equal(t, workspace.Name, notifEnq.Sent[0].Labels["name"])
assert.Equal(t, template.Name, notifEnq.Sent[0].Labels["template_name"])
assert.Equal(t, version.Name, notifEnq.Sent[0].Labels["template_version_name"])
assert.Equal(t, user.Username, notifEnq.Sent[0].Labels["initiator"])
assert.Equal(t, user.Username, notifEnq.Sent[0].Labels["workspace_owner_username"])
Copy link
Member

Choose a reason for hiding this comment

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

I feel like these assertions could be passed into the previous table-based test "Workspace build failed"?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

There is a significant difference as here we expect notifications sent only to template admins, we don't care about workspace owners. I tried to squeeze this unit test as much as possible.

@@ -1150,15 +1130,43 @@ func (s *server) notifyWorkspaceManualBuildFailed(ctx context.Context, workspace
"template_version_name": templateVersion.Name,
"initiator": build.InitiatorByUsername,
"workspace_owner_username": workspaceOwner.Username,
"workspace_build_number": strconv.Itoa(int(build.BuildNumber)),
Copy link
Contributor

Choose a reason for hiding this comment

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

Including this will mean that deduplication won't be possible, just so you're aware.

mtojek reacted with thumbs up emoji
@mtojekmtojek requested a review fromjohnstcnAugust 27, 2024 13:24
Copy link
Member

@johnstcnjohnstcn left a comment

Choose a reason for hiding this comment

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

👍

@mtojekmtojekenabled auto-merge (squash)August 27, 2024 14:27
@mtojekmtojek merged commit47f2c7d intomainAug 27, 2024
30 checks passed
@mtojekmtojek deleted the 16-manual-build-failed branchAugust 27, 2024 14:35
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 27, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@BrunoQuaresmaBrunoQuaresmaBrunoQuaresma left review comments

@dannykoppingdannykoppingdannykopping approved these changes

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@mtojekmtojek

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

feat: template notifications
4 participants
@mtojek@dannykopping@BrunoQuaresma@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp