-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Remove all the deprecated setting fallback logic because it reached the target version and put a warning there if old configuration are still present #33707
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
Changes from all commits
564c670
5ab0de8
1f62ea3
ae166fd
302bb33
7e7811b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,8 @@ | |
| package setting | ||
|
|
||
| import ( | ||
| "net" | ||
| "strings" | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/assert" | ||
|
|
@@ -20,7 +22,7 @@ func Test_loadMailerFrom(t *testing.T) { | |
| SMTPPort: "123", | ||
| }, | ||
| ":123": { | ||
| SMTPAddr: "127.0.0.1", | ||
| SMTPAddr: "", | ||
| SMTPPort: "123", | ||
| }, | ||
| } | ||
|
|
@@ -29,7 +31,14 @@ func Test_loadMailerFrom(t *testing.T) { | |
| cfg, _ := NewConfigProviderFromData("") | ||
| sec := cfg.Section("mailer") | ||
| sec.NewKey("ENABLED", "true") | ||
| sec.NewKey("HOST", host) | ||
| if strings.Contains(host, ":") { | ||
| addr, port, err := net.SplitHostPort(host) | ||
| assert.NoError(t, err) | ||
| sec.NewKey("SMTP_ADDR", addr) | ||
| sec.NewKey("SMTP_PORT", port) | ||
| } else { | ||
| sec.NewKey("SMTP_ADDR", host) | ||
| } | ||
|
Comment on lines
+34
to
+41
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the tests are changed? Does it break?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test was test the legacy configurations. Now the fallback code was removed. So the test was changed to test the new configurations.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then I guess the test cases should be updated, but not change the config code here, unless you could clarify the config test code must be changed.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to your change, the "HOST" key is gone, why you use the trick here to test the non-existing "HOST" config option? |
||
|
|
||
| // Check mailer setting | ||
| loadMailerFrom(cfg) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.