8000 feat!: allow disabling notifications by DanielleMaywood · Pull Request #15509 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat!: allow disabling notifications #15509

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5c36c93
fix: remove defaults for CODER_EMAIL_ options
DanielleMaywood Nov 12, 2024
196f538
fix: failing tests
DanielleMaywood Nov 12, 2024
b670009
fix: tests (again)
DanielleMaywood Nov 12, 2024
19398cc
fix: run 'make gen'
DanielleMaywood Nov 12, 2024
4175bc8
fix: consistency
DanielleMaywood Nov 13, 2024
66d1a69
nit: trim smarthost
DanielleMaywood Nov 13, 2024
4689e5b
nit: re-add default for CODER_EMAIL_HELLO
DanielleMaywood Nov 13, 2024
01d4957
fix: run 'make {update-golden-files,gen}'
DanielleMaywood Nov 13, 2024
27fa5bf
fix: run 'make fmt'
DanielleMaywood Nov 13, 2024
6ca7844
feat: allow disabling notifications entirely
DanielleMaywood Nov 13, 2024
fb54e45
Merge branch 'main' into dm-fix-defaults-notifications
DanielleMaywood Nov 14, 2024
d5aff28
chore: re-add default for smarthost
DanielleMaywood Nov 14, 2024
01cb999
fix: remove default for deprecated option
DanielleMaywood Nov 14, 2024
c513113
chore: revert change
DanielleMaywood Nov 14, 2024
a8b5a61
chore: remove unrelated test changes
DanielleMaywood Nov 14, 2024
1711e68
revert: more changes
DanielleMaywood Nov 14, 2024
2e03ed1
chore: simplify description
DanielleMaywood Nov 14, 2024
28ec1b7
Merge branch 'main' into dm-fix-defaults-notifications
DanielleMaywood Nov 14, 2024
7ba3a6c
chore: make {gen,update-golden-files}
DanielleMaywood Nov 14, 2024
4a72e4f
chore: rename cfg to notificationsCfg
DanielleMaywood Nov 14, 2024
9c02842
chore: drop enabled flag
DanielleMaywood Nov 18, 2024
dd527f9
fix: invalid test
DanielleMaywood Nov 18, 2024
77d1803
chore: improve info message and add to docs
DanielleMaywood Nov 19, 2024
5fd03b3
test: notifications.Enabled()
DanielleMaywood Nov 19, 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
Prev Previous commit
Next Next commit
nit: re-add default for CODER_EMAIL_HELLO
temporarily using new branch from coder/serpent for this
  • Loading branch information
DanielleMaywood committed Nov 13, 2024
commit 4689e5bb4c14a953002a9dbbb5879c35d54be058
2 changes: 2 additions & 0 deletions codersdk/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,7 @@ when required by your organization's security policy.`,
Description: "The hostname identifying the SMTP server.",
Flag: "email-hello",
Env: "CODER_EMAIL_HELLO",
Default: "localhost",
Value: &c.Notifications.SMTP.Hello,
Group: &deploymentGroupEmail,
YAML: "hello",
Expand Down Expand Up @@ -2625,6 +2626,7 @@ Write out the current server config as YAML to stdout.`,
Description: "The hostname identifying the SMTP server.",
Flag: "notifications-email-hello",
Env: "CODER_NOTIFICATIONS_EMAIL_HELLO",
Default: "localhost",
Value: &c.Notifications.SMTP.Hello,
Group: &deploymentGroupNotificationsEmail,
YAML: "hello",
Expand Down
24 changes: 24 additions & 0 deletions codersdk/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,30 @@ func TestEmailValuesTakeCorrectPrecedent(t *testing.T) {
newEnv: "CODER_EMAIL_SMARTHOST",
expectedValue: "localhost:1000",
},
{
name: "CODER_NOTIFICATIONS_EMAIL_HELLO is not discarded",
envs: []serpent.EnvVar{
{
Name: "CODER_NOTIFICATIONS_EMAIL_HELLO",
Value: "not-localhost",
},
},
oldEnv: "CODER_NOTIFICATIONS_EMAIL_HELLO",
newEnv: "CODER_EMAIL_HELLO",
expectedValue: "not-localhost",
},
{
name: "CODER_EMAIL_HELLO is not discarded",
envs: []serpent.EnvVar{
{
Name: "CODER_EMAIL_HELLO",
Value: "not-localhost",
},
},
oldEnv: "CODER_NOTIFICATIONS_EMAIL_HELLO",
newEnv: "CODER_EMAIL_HELLO",
expectedValue: "not-localhost",
},
}

for _, tt := range tests {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ require (
github.com/charmbracelet/bubbles v0.20.0
github.com/charmbracelet/bubbletea v1.2.1
github.com/charmbracelet/lipgloss v1.0.0
github.com/coder/serpent v0.8.0
github.com/coder/serpent v0.8.1-0.20241113113009-ad8fe148f0d8
github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21
github.com/emersion/go-smtp v0.21.2
github.com/go-jose/go-jose/v4 v4.0.2
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ github.com/coder/retry v1.5.1 h1:iWu8YnD8YqHs3XwqrqsjoBTAVqT9ml6z9ViJ2wlMiqc=
github.com/coder/retry v1.5.1/go.mod h1:blHMk9vs6LkoRT9ZHyuZo360cufXEhrxqvEzeMtRGoY=
github.com/coder/serpent v0.8.0 h1:6OR+k6fekhSeEDmwwzBgnSjaa7FfGGrMlc3GoAEH9dg=
github.com/coder/serpent v0.8.0/go.mod h1:cZFW6/fP+kE9nd/oRkEHJpG6sXCtQ+AX7WMMEHv0Y3Q=
github.com/coder/serpent v0.8.1-0.20241113113009-ad8fe148f0d8 h1:xBsCXOg2KBd5eq2uJFjXjVEJCZn6QaflS7qgzzipqZE=
github.com/coder/serpent v0.8.1-0.20241113113009-ad8fe148f0d8/go.mod h1:cZFW6/fP+kE9nd/oRkEHJpG6sXCtQ+AX7WMMEHv0Y3Q=
github.com/coder/ssh v0.0.0-20231128192721-70855dedb788 h1:YoUSJ19E8AtuUFVYBpXuOD6a/zVP3rcxezNsoDseTUw=
github.com/coder/ssh v0.0.0-20231128192721-70855dedb788/go.mod h1:aGQbuCLyhRLMzZF067xc84Lh7JDs1FKwCmF1Crl9dxQ=
github.com/coder/tailscale v1.1.1-0.20241003034647-02286e537fc2 h1:mBbPFyJ2i9o490IwWGvWgtG0qmvIk45R7GWJpoaXotI=
Expand Down
Loading
0