[MM-36444] Manage config deprecations for 6.0 (#18035)

* removing deprecated stuff

* removing deprecations and marking others for deprecations

* removing some of the configs

* partially remove ExperimentalChannelOrganization

* fixing merge issues

* moving default permissions to defaultroles function

* removing experimentaltownsquare

* removing old tests and remove legacysidebar config

* fixing test

* removing log

* removing unused variables

* MM-36444: Fix for renamed functions.

* MM-36444: go mod tidy and go mod vendor.

* MM-36444: Vendored go modules.

* MM-36444: Removes UseExperimentalGossip config field from model.

* Fix vendors

* fixing test

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Martin Kraft <martin@upspin.org>
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
Этот коммит содержится в:
Ben Cooke
2021-09-14 13:22:59 -04:00
коммит произвёл GitHub
родитель 0953e3f0cf
Коммит 3b9324b389
22 изменённых файлов: 92 добавлений и 1176 удалений

Просмотреть файл

@@ -814,49 +814,15 @@ func TestListenAddressIsValidated(t *testing.T) {
}
func TestImageProxySettingsSetDefaults(t *testing.T) {
ss := ServiceSettings{
DEPRECATED_DO_NOT_USE_ImageProxyType: NewString(ImageProxyTypeAtmosCamo),
DEPRECATED_DO_NOT_USE_ImageProxyURL: NewString("http://images.example.com"),
DEPRECATED_DO_NOT_USE_ImageProxyOptions: NewString("1234abcd"),
}
t.Run("default, no old settings", func(t *testing.T) {
t.Run("default settings", func(t *testing.T) {
ips := ImageProxySettings{}
ips.SetDefaults(ServiceSettings{})
ips.SetDefaults()
assert.Equal(t, false, *ips.Enable)
assert.Equal(t, ImageProxyTypeLocal, *ips.ImageProxyType)
assert.Equal(t, "", *ips.RemoteImageProxyURL)
assert.Equal(t, "", *ips.RemoteImageProxyOptions)
})
t.Run("default, old settings", func(t *testing.T) {
ips := ImageProxySettings{}
ips.SetDefaults(ss)
assert.Equal(t, true, *ips.Enable)
assert.Equal(t, *ss.DEPRECATED_DO_NOT_USE_ImageProxyType, *ips.ImageProxyType)
assert.Equal(t, *ss.DEPRECATED_DO_NOT_USE_ImageProxyURL, *ips.RemoteImageProxyURL)
assert.Equal(t, *ss.DEPRECATED_DO_NOT_USE_ImageProxyOptions, *ips.RemoteImageProxyOptions)
})
t.Run("not default, old settings", func(t *testing.T) {
url := "http://images.mattermost.com"
options := "aaaaaaaa"
ips := ImageProxySettings{
Enable: NewBool(false),
ImageProxyType: NewString(ImageProxyTypeLocal),
RemoteImageProxyURL: &url,
RemoteImageProxyOptions: &options,
}
ips.SetDefaults(ss)
assert.Equal(t, false, *ips.Enable)
assert.Equal(t, ImageProxyTypeLocal, *ips.ImageProxyType)
assert.Equal(t, url, *ips.RemoteImageProxyURL)
assert.Equal(t, options, *ips.RemoteImageProxyOptions)
})
}
func TestImageProxySettingsIsValid(t *testing.T) {