MM-36271: Bump major version to 6.0 (#17973)

https://mattermost.atlassian.net/browse/MM-36271

```release-note
We bump the major version to 6.0
```
Этот коммит содержится в:
Agniva De Sarker
2021-07-22 12:21:47 +05:30
коммит произвёл GitHub
родитель 33edd645c7
Коммит c4b4e1bc38
899 изменённых файлов: 2383 добавлений и 2384 удалений

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

@@ -9,7 +9,7 @@ import (
plugin "github.com/hashicorp/go-plugin"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v6/model"
)
// The API can be used to retrieve data or perform actions on behalf of the plugin. Most methods

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

@@ -11,8 +11,8 @@ import (
"net/http"
timePkg "time"
"github.com/mattermost/mattermost-server/v5/einterfaces"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v6/einterfaces"
"github.com/mattermost/mattermost-server/v6/model"
)
type apiTimerLayer struct {

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

@@ -8,8 +8,8 @@ import (
"go/ast"
"go/token"
"github.com/mattermost/mattermost-server/v5/plugin/checker/internal/asthelpers"
"github.com/mattermost/mattermost-server/v5/plugin/checker/internal/version"
"github.com/mattermost/mattermost-server/v6/plugin/checker/internal/asthelpers"
"github.com/mattermost/mattermost-server/v6/plugin/checker/internal/version"
)
func checkAPIVersionComments(pkgPath string) (result, error) {

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

@@ -17,24 +17,24 @@ func TestCheckAPIVersionComments(t *testing.T) {
}{
{
name: "valid comments",
pkgPath: "github.com/mattermost/mattermost-server/v5/plugin/checker/internal/test/valid",
pkgPath: "github.com/mattermost/mattermost-server/v6/plugin/checker/internal/test/valid",
err: "",
},
{
name: "invalid comments",
pkgPath: "github.com/mattermost/mattermost-server/v5/plugin/checker/internal/test/invalid",
pkgPath: "github.com/mattermost/mattermost-server/v6/plugin/checker/internal/test/invalid",
expected: result{
Errors: []string{"internal/test/invalid/invalid.go:15:2: missing a minimum server version comment on method InvalidMethod"},
},
},
{
name: "missing API interface",
pkgPath: "github.com/mattermost/mattermost-server/v5/plugin/checker/internal/test/missing",
pkgPath: "github.com/mattermost/mattermost-server/v6/plugin/checker/internal/test/missing",
err: "could not find API interface",
},
{
name: "non-existent package path",
pkgPath: "github.com/mattermost/mattermost-server/v5/plugin/checker/internal/test/does_not_exist",
pkgPath: "github.com/mattermost/mattermost-server/v6/plugin/checker/internal/test/does_not_exist",
err: "could not find API interface",
},
}

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

@@ -11,8 +11,8 @@ import (
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/plugin/checker/internal/asthelpers"
"github.com/mattermost/mattermost-server/v5/plugin/checker/internal/version"
"github.com/mattermost/mattermost-server/v6/plugin/checker/internal/asthelpers"
"github.com/mattermost/mattermost-server/v6/plugin/checker/internal/version"
)
func checkHelpersVersionComments(pkgPath string) (result, error) {

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

@@ -17,12 +17,12 @@ func TestCheckHelpersVersionComments(t *testing.T) {
}{
{
name: "valid versions",
pkgPath: "github.com/mattermost/mattermost-server/v5/plugin/checker/internal/test/valid",
pkgPath: "github.com/mattermost/mattermost-server/v6/plugin/checker/internal/test/valid",
expected: result{},
},
{
name: "invalid versions",
pkgPath: "github.com/mattermost/mattermost-server/v5/plugin/checker/internal/test/invalid",
pkgPath: "github.com/mattermost/mattermost-server/v6/plugin/checker/internal/test/invalid",
expected: result{
Errors: []string{"internal/test/invalid/invalid.go:20:2: documented minimum server version too low on method LowerVersionMethod"},
Warnings: []string{"internal/test/invalid/invalid.go:23:2: documented minimum server version too high on method HigherVersionMethod"},

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

@@ -10,7 +10,7 @@ import (
"strings"
)
const pluginPackagePath = "github.com/mattermost/mattermost-server/v5/plugin"
const pluginPackagePath = "github.com/mattermost/mattermost-server/v6/plugin"
type result struct {
Warnings []string

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

@@ -25,8 +25,8 @@ import (
"github.com/hashicorp/go-plugin"
"github.com/lib/pq"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/shared/mlog"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-server/v6/shared/mlog"
)
var hookNameToId map[string]int = make(map[string]int)

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

@@ -10,8 +10,8 @@ import (
"fmt"
"log"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/shared/mlog"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-server/v6/shared/mlog"
)
func init() {

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

@@ -14,10 +14,10 @@ import (
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/einterfaces"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/shared/mlog"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/mattermost/mattermost-server/v6/einterfaces"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-server/v6/shared/mlog"
"github.com/mattermost/mattermost-server/v6/utils"
)
var ErrNotFound = errors.New("Item not found")

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

@@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v6/model"
)
func TestAvaliablePlugins(t *testing.T) {

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

@@ -7,7 +7,7 @@ import (
"fmt"
"net/http"
"github.com/mattermost/mattermost-server/v5/plugin"
"github.com/mattermost/mattermost-server/v6/plugin"
)
// HelloWorldPlugin implements the interface expected by the Mattermost server to communicate

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

@@ -9,8 +9,8 @@ import (
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/plugin"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-server/v6/plugin"
)
// configuration represents the configuration for this plugin as exposed via the Mattermost

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

@@ -11,7 +11,7 @@ import (
"github.com/hashicorp/go-hclog"
"github.com/mattermost/mattermost-server/v5/shared/mlog"
"github.com/mattermost/mattermost-server/v6/shared/mlog"
)
type hclogAdapter struct {

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

@@ -7,8 +7,8 @@ import (
"sync"
"time"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/shared/mlog"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-server/v6/shared/mlog"
)
const (

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

@@ -12,9 +12,9 @@ import (
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/shared/mlog"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-server/v6/shared/mlog"
"github.com/mattermost/mattermost-server/v6/utils"
)
func TestPluginHealthCheck(t *testing.T) {
@@ -36,7 +36,7 @@ func testPluginHealthCheckSuccess(t *testing.T) {
package main
import (
"github.com/mattermost/mattermost-server/v5/plugin"
"github.com/mattermost/mattermost-server/v6/plugin"
)
type MyPlugin struct {
@@ -78,8 +78,8 @@ func testPluginHealthCheckPanic(t *testing.T) {
package main
import (
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/plugin"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-server/v6/plugin"
)
type MyPlugin struct {

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

@@ -6,7 +6,7 @@ package plugin
import (
"database/sql/driver"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v6/model"
)
// Helpers provide a common patterns plugins use.

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

@@ -9,8 +9,8 @@ import (
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-server/v6/utils"
)
type ensureBotOptions struct {

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

@@ -10,11 +10,11 @@ import (
"github.com/stretchr/testify/assert"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/plugin"
"github.com/mattermost/mattermost-server/v5/plugin/plugintest"
"github.com/mattermost/mattermost-server/v5/plugin/plugintest/mock"
"github.com/mattermost/mattermost-server/v5/utils/fileutils"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-server/v6/plugin"
"github.com/mattermost/mattermost-server/v6/plugin/plugintest"
"github.com/mattermost/mattermost-server/v6/plugin/plugintest/mock"
"github.com/mattermost/mattermost-server/v6/utils/fileutils"
)
func TestEnsureBot(t *testing.T) {

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

@@ -6,8 +6,8 @@ package plugin
import (
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-server/v6/utils"
)
// CheckRequiredServerConfiguration implements Helpers.CheckRequiredServerConfiguration

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

@@ -8,9 +8,9 @@ import (
"github.com/stretchr/testify/assert"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/plugin"
"github.com/mattermost/mattermost-server/v5/plugin/plugintest"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-server/v6/plugin"
"github.com/mattermost/mattermost-server/v6/plugin/plugintest"
)
func TestCheckRequiredServerConfiguration(t *testing.T) {

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

@@ -9,9 +9,9 @@ import (
"github.com/stretchr/testify/assert"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/plugin"
"github.com/mattermost/mattermost-server/v5/plugin/plugintest"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-server/v6/plugin"
"github.com/mattermost/mattermost-server/v6/plugin/plugintest"
)
func TestKVGetJSON(t *testing.T) {

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

@@ -12,7 +12,7 @@ import (
"github.com/blang/semver"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v6/model"
)
// InstallPluginFromURL implements Helpers.InstallPluginFromURL.

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

@@ -13,11 +13,11 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/plugin"
"github.com/mattermost/mattermost-server/v5/plugin/plugintest"
"github.com/mattermost/mattermost-server/v5/plugin/plugintest/mock"
"github.com/mattermost/mattermost-server/v5/utils/fileutils"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-server/v6/plugin"
"github.com/mattermost/mattermost-server/v6/plugin/plugintest"
"github.com/mattermost/mattermost-server/v6/plugin/plugintest/mock"
"github.com/mattermost/mattermost-server/v6/utils/fileutils"
)
func TestInstallPluginFromURL(t *testing.T) {

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

@@ -7,7 +7,7 @@ import (
"io"
"net/http"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v6/model"
)
// These assignments are part of the wire protocol used to trigger hook events in plugins.

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

@@ -11,8 +11,8 @@ import (
"net/http"
timePkg "time"
"github.com/mattermost/mattermost-server/v5/einterfaces"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v6/einterfaces"
"github.com/mattermost/mattermost-server/v6/model"
)
type hooksTimerLayer struct {

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

@@ -12,7 +12,7 @@ import (
"net/http"
"net/rpc"
"github.com/mattermost/mattermost-server/v5/shared/mlog"
"github.com/mattermost/mattermost-server/v6/shared/mlog"
)
type hijackedResponse struct {

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

@@ -373,8 +373,8 @@ import (
"net/http"
timePkg "time"
"github.com/mattermost/mattermost-server/v5/einterfaces"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v6/einterfaces"
"github.com/mattermost/mattermost-server/v6/model"
)
type apiTimerLayer struct {
@@ -415,8 +415,8 @@ import (
"net/http"
timePkg "time"
"github.com/mattermost/mattermost-server/v5/einterfaces"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v6/einterfaces"
"github.com/mattermost/mattermost-server/v6/model"
)
type hooksTimerLayer struct {
@@ -563,7 +563,7 @@ func generatePluginTimerLayer(info *PluginInterfaceInfo) {
}
func getPluginPackageDir() string {
dirs, err := goList("github.com/mattermost/mattermost-server/v5/plugin")
dirs, err := goList("github.com/mattermost/mattermost-server/v6/plugin")
if err != nil {
panic(err)
} else if len(dirs) != 1 {

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

@@ -10,7 +10,7 @@ import (
mock "github.com/stretchr/testify/mock"
model "github.com/mattermost/mattermost-server/v5/model"
model "github.com/mattermost/mattermost-server/v6/model"
)
// API is an autogenerated mock type for the API type

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

@@ -7,5 +7,5 @@
// https://godoc.org/github.com/stretchr/testify/mock
//
// If you need to import the mock package, you can import it with
// "github.com/mattermost/mattermost-server/v5/plugin/plugintest/mock".
// "github.com/mattermost/mattermost-server/v6/plugin/plugintest/mock".
package plugintest

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

@@ -9,7 +9,7 @@ import (
mock "github.com/stretchr/testify/mock"
plugin "github.com/mattermost/mattermost-server/v5/plugin"
plugin "github.com/mattermost/mattermost-server/v6/plugin"
)
// Driver is an autogenerated mock type for the Driver type

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

@@ -13,9 +13,9 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/plugin"
"github.com/mattermost/mattermost-server/v5/plugin/plugintest"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-server/v6/plugin"
"github.com/mattermost/mattermost-server/v6/plugin/plugintest"
)
type HelloUserPlugin struct {

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

@@ -5,8 +5,8 @@
package plugintest
import (
model "github.com/mattermost/mattermost-server/v5/model"
plugin "github.com/mattermost/mattermost-server/v5/plugin"
model "github.com/mattermost/mattermost-server/v6/model"
plugin "github.com/mattermost/mattermost-server/v6/plugin"
mock "github.com/stretchr/testify/mock"
)

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

@@ -10,9 +10,9 @@ import (
mock "github.com/stretchr/testify/mock"
model "github.com/mattermost/mattermost-server/v5/model"
model "github.com/mattermost/mattermost-server/v6/model"
plugin "github.com/mattermost/mattermost-server/v5/plugin"
plugin "github.com/mattermost/mattermost-server/v6/plugin"
)
// Hooks is an autogenerated mock type for the Hooks type

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

@@ -4,8 +4,8 @@
package scheduler
import (
"github.com/mattermost/mattermost-server/v5/app"
tjobs "github.com/mattermost/mattermost-server/v5/jobs/interfaces"
"github.com/mattermost/mattermost-server/v6/app"
tjobs "github.com/mattermost/mattermost-server/v6/jobs/interfaces"
)
type PluginsJobInterfaceImpl struct {

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

@@ -6,9 +6,9 @@ package scheduler
import (
"time"
"github.com/mattermost/mattermost-server/v5/app"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/shared/mlog"
"github.com/mattermost/mattermost-server/v6/app"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-server/v6/shared/mlog"
)
const pluginsJobInterval = 24 * 60 * 60 * time.Second

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

@@ -4,10 +4,10 @@
package scheduler
import (
"github.com/mattermost/mattermost-server/v5/app"
"github.com/mattermost/mattermost-server/v5/jobs"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/shared/mlog"
"github.com/mattermost/mattermost-server/v6/app"
"github.com/mattermost/mattermost-server/v6/jobs"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-server/v6/shared/mlog"
)
type Worker struct {

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

@@ -14,9 +14,9 @@ import (
plugin "github.com/hashicorp/go-plugin"
"github.com/mattermost/mattermost-server/v5/einterfaces"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/shared/mlog"
"github.com/mattermost/mattermost-server/v6/einterfaces"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-server/v6/shared/mlog"
)
type supervisor struct {

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

@@ -12,9 +12,9 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/shared/mlog"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-server/v6/shared/mlog"
"github.com/mattermost/mattermost-server/v6/utils"
)
func TestSupervisor(t *testing.T) {