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: add notification preferences database & audit support#14100

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
dannykopping merged 20 commits intomainfromdk/notification-prefs/db-audit
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
20 commits
Select commitHold shift + click to select a range
019de10
Implement notification template update auditing
dannykoppingJul 25, 2024
3ac40be
Add notification preferences migrations
dannykoppingJul 23, 2024
8556c38
Add preferences queries
dannykoppingJul 23, 2024
9e0adbf
Allow notification templates to be auditable
dannykoppingJul 25, 2024
88294a3
Add kind to notification_templates and query to retrieve templates by…
dannykoppingJul 26, 2024
2fce7ce
Remove redundant suffix on trigger name
dannykoppingJul 29, 2024
a30ee5c
Add notification preferences RBAC role
dannykoppingJul 29, 2024
81d9261
UpdateUserNotificationPreferences
dannykoppingJul 29, 2024
0c662fb
RBAC for notification templates & preferences
dannykoppingAug 1, 2024
fdce564
CI
dannykoppingAug 1, 2024
ee77df8
Self-review, appeasing CI
dannykoppingAug 1, 2024
71dd626
Self-review, appeasing CI
dannykoppingAug 1, 2024
36306af
CI
dannykoppingAug 2, 2024
17d27be
Fixture, add composite primary key
dannykoppingAug 2, 2024
52d3108
Self-review
dannykoppingAug 2, 2024
2d45187
Rename migration
dannykoppingAug 2, 2024
27dfc51
Rename migration, again
dannykoppingAug 2, 2024
c744d33
Review feedback
dannykoppingAug 5, 2024
e4103c3
feat: allow admins to modify notification template delivery method (#…
dannykoppingAug 5, 2024
5d683d4
Review comments
dannykoppingAug 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletionscli/notifications_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,6 +16,16 @@ import (
"github.com/coder/coder/v2/testutil"
)

funccreateOpts(t*testing.T)*coderdtest.Options {
t.Helper()

dt:=coderdtest.DeploymentValues(t)
dt.Experiments= []string{string(codersdk.ExperimentNotifications)}
return&coderdtest.Options{
DeploymentValues:dt,
}
}

funcTestNotifications(t*testing.T) {
t.Parallel()

Expand All@@ -42,7 +52,7 @@ func TestNotifications(t *testing.T) {
t.Parallel()

// given
ownerClient,db:=coderdtest.NewWithDatabase(t,nil)
ownerClient,db:=coderdtest.NewWithDatabase(t,createOpts(t))
_=coderdtest.CreateFirstUser(t,ownerClient)

// when
Expand DownExpand Up@@ -72,7 +82,7 @@ func TestPauseNotifications_RegularUser(t *testing.T) {
t.Parallel()

// given
ownerClient,db:=coderdtest.NewWithDatabase(t,nil)
ownerClient,db:=coderdtest.NewWithDatabase(t,createOpts(t))
owner:=coderdtest.CreateFirstUser(t,ownerClient)
anotherClient,_:=coderdtest.CreateAnotherUser(t,ownerClient,owner.OrganizationID)

Expand All@@ -87,7 +97,7 @@ func TestPauseNotifications_RegularUser(t *testing.T) {
require.Error(t,err)
require.ErrorAsf(t,err,&sdkError,"error should be of type *codersdk.Error")
assert.Equal(t,http.StatusForbidden,sdkError.StatusCode())
assert.Contains(t,sdkError.Message,"Insufficient permissions to update notifications settings.")
assert.Contains(t,sdkError.Message,"Forbidden.")

// then
ctx,cancel:=context.WithTimeout(context.Background(),testutil.WaitShort)
Expand Down
253 changes: 251 additions & 2 deletionscoderd/apidoc/docs.go
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp