mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
[MM-19948] Set version on module file and internal paths (#13186)
* [MM-19948] Set version on module file and internal paths * Fixes after merge * Fix i18n checker error
This commit is contained in:
committed by
GitHub
parent
14bcd1f0a1
commit
2259b7f2a8
@@ -8,7 +8,7 @@ import (
|
||||
"net/http"
|
||||
|
||||
plugin "github.com/hashicorp/go-plugin"
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
)
|
||||
|
||||
// The API can be used to retrieve data or perform actions on behalf of the plugin. Most methods
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"go/ast"
|
||||
"go/token"
|
||||
|
||||
"github.com/mattermost/mattermost-server/plugin/checker/internal/asthelpers"
|
||||
"github.com/mattermost/mattermost-server/plugin/checker/internal/version"
|
||||
"github.com/mattermost/mattermost-server/v5/plugin/checker/internal/asthelpers"
|
||||
"github.com/mattermost/mattermost-server/v5/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/plugin/checker/internal/test/valid",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/v5/plugin/checker/internal/test/valid",
|
||||
err: "",
|
||||
},
|
||||
{
|
||||
name: "invalid comments",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/plugin/checker/internal/test/invalid",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/v5/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/plugin/checker/internal/test/missing",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/v5/plugin/checker/internal/test/missing",
|
||||
err: "could not find API interface",
|
||||
},
|
||||
{
|
||||
name: "non-existent package path",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/plugin/checker/internal/test/does_not_exist",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/v5/plugin/checker/internal/test/does_not_exist",
|
||||
err: "could not find API interface",
|
||||
},
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"go/token"
|
||||
"go/types"
|
||||
|
||||
"github.com/mattermost/mattermost-server/plugin/checker/internal/asthelpers"
|
||||
"github.com/mattermost/mattermost-server/plugin/checker/internal/version"
|
||||
"github.com/mattermost/mattermost-server/v5/plugin/checker/internal/asthelpers"
|
||||
"github.com/mattermost/mattermost-server/v5/plugin/checker/internal/version"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
@@ -17,12 +17,12 @@ func TestCheckHelpersVersionComments(t *testing.T) {
|
||||
}{
|
||||
{
|
||||
name: "valid versions",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/plugin/checker/internal/test/valid",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/v5/plugin/checker/internal/test/valid",
|
||||
expected: result{},
|
||||
},
|
||||
{
|
||||
name: "invalid versions",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/plugin/checker/internal/test/invalid",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/v5/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/plugin"
|
||||
const pluginPackagePath = "github.com/mattermost/mattermost-server/v5/plugin"
|
||||
|
||||
type result struct {
|
||||
Warnings []string
|
||||
|
||||
@@ -20,8 +20,8 @@ import (
|
||||
|
||||
"github.com/dyatlov/go-opengraph/opengraph"
|
||||
"github.com/hashicorp/go-plugin"
|
||||
"github.com/mattermost/mattermost-server/mlog"
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
)
|
||||
|
||||
var hookNameToId map[string]int = make(map[string]int)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
"io"
|
||||
"log"
|
||||
|
||||
"github.com/mattermost/mattermost-server/mlog"
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -12,9 +12,9 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/mattermost/mattermost-server/mlog"
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/utils"
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/utils"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/mattermost/mattermost-server/plugin"
|
||||
"github.com/mattermost/mattermost-server/v5/plugin"
|
||||
)
|
||||
|
||||
type HelloWorldPlugin struct {
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/plugin"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/plugin"
|
||||
)
|
||||
|
||||
// configuration represents the configuration for this plugin as exposed via the Mattermost
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/go-hclog"
|
||||
"github.com/mattermost/mattermost-server/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
)
|
||||
|
||||
type hclogAdapter struct {
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/mattermost/mattermost-server/mlog"
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -10,9 +10,9 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/mattermost/mattermost-server/mlog"
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/utils"
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/utils"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -35,7 +35,7 @@ func testPluginHealthCheck_Success(t *testing.T) {
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/mattermost/mattermost-server/plugin"
|
||||
"github.com/mattermost/mattermost-server/v5/plugin"
|
||||
)
|
||||
|
||||
type MyPlugin struct {
|
||||
@@ -76,8 +76,8 @@ func testPluginHealthCheck_Panic(t *testing.T) {
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/plugin"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/plugin"
|
||||
)
|
||||
|
||||
type MyPlugin struct {
|
||||
|
||||
@@ -5,7 +5,7 @@ package plugin
|
||||
|
||||
import (
|
||||
"github.com/blang/semver"
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/utils"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/utils"
|
||||
)
|
||||
|
||||
type ensureBotOptions struct {
|
||||
|
||||
@@ -8,11 +8,11 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/plugin"
|
||||
"github.com/mattermost/mattermost-server/plugin/plugintest"
|
||||
"github.com/mattermost/mattermost-server/plugin/plugintest/mock"
|
||||
"github.com/mattermost/mattermost-server/utils/fileutils"
|
||||
"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/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@ package plugin_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/plugin"
|
||||
"github.com/mattermost/mattermost-server/plugin/plugintest"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/plugin"
|
||||
"github.com/mattermost/mattermost-server/v5/plugin/plugintest"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
)
|
||||
|
||||
// These assignments are part of the wire protocol used to trigger hook events in plugins.
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"net/http"
|
||||
"net/rpc"
|
||||
|
||||
"github.com/mattermost/mattermost-server/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
)
|
||||
|
||||
type httpResponseWriterRPCServer struct {
|
||||
|
||||
@@ -379,7 +379,7 @@ func generateGlue(info *PluginInterfaceInfo) {
|
||||
}
|
||||
|
||||
func getPluginPackageDir() string {
|
||||
dirs, err := goList("github.com/mattermost/mattermost-server/plugin")
|
||||
dirs, err := goList("github.com/mattermost/mattermost-server/v5/plugin")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
} else if len(dirs) != 1 {
|
||||
|
||||
@@ -6,7 +6,7 @@ package plugin_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/mattermost/mattermost-server/testlib"
|
||||
"github.com/mattermost/mattermost-server/v5/testlib"
|
||||
)
|
||||
|
||||
var mainHelper *testlib.MainHelper
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
model "github.com/mattermost/mattermost-server/model"
|
||||
model "github.com/mattermost/mattermost-server/v5/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/plugin/plugintest/mock".
|
||||
// "github.com/mattermost/mattermost-server/v5/plugin/plugintest/mock".
|
||||
package plugintest
|
||||
|
||||
@@ -10,9 +10,9 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/plugin"
|
||||
"github.com/mattermost/mattermost-server/plugin/plugintest"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/plugin"
|
||||
"github.com/mattermost/mattermost-server/v5/plugin/plugintest"
|
||||
)
|
||||
|
||||
type HelloUserPlugin struct {
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
package plugintest
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost-server/model"
|
||||
plugin "github.com/mattermost/mattermost-server/plugin"
|
||||
model "github.com/mattermost/mattermost-server/v5/model"
|
||||
plugin "github.com/mattermost/mattermost-server/v5/plugin"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ import (
|
||||
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
model "github.com/mattermost/mattermost-server/model"
|
||||
model "github.com/mattermost/mattermost-server/v5/model"
|
||||
|
||||
plugin "github.com/mattermost/mattermost-server/plugin"
|
||||
plugin "github.com/mattermost/mattermost-server/v5/plugin"
|
||||
)
|
||||
|
||||
// Hooks is an autogenerated mock type for the Hooks type
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
package scheduler
|
||||
|
||||
import (
|
||||
"github.com/mattermost/mattermost-server/app"
|
||||
tjobs "github.com/mattermost/mattermost-server/jobs/interfaces"
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
tjobs "github.com/mattermost/mattermost-server/v5/jobs/interfaces"
|
||||
)
|
||||
|
||||
type PluginsJobInterfaceImpl struct {
|
||||
|
||||
@@ -6,9 +6,9 @@ package scheduler
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/mattermost/mattermost-server/app"
|
||||
"github.com/mattermost/mattermost-server/mlog"
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
)
|
||||
|
||||
const pluginsJobInterval = 24 * 60 * 60 * time.Second
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
package scheduler
|
||||
|
||||
import (
|
||||
"github.com/mattermost/mattermost-server/app"
|
||||
"github.com/mattermost/mattermost-server/jobs"
|
||||
"github.com/mattermost/mattermost-server/mlog"
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/jobs"
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
)
|
||||
|
||||
type Worker struct {
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
"time"
|
||||
|
||||
plugin "github.com/hashicorp/go-plugin"
|
||||
"github.com/mattermost/mattermost-server/mlog"
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
)
|
||||
|
||||
type supervisor struct {
|
||||
|
||||
@@ -9,9 +9,9 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/mattermost/mattermost-server/mlog"
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/utils"
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/utils"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/mattermost/mattermost-server/plugin"
|
||||
"github.com/mattermost/mattermost-server/v5/plugin"
|
||||
)
|
||||
|
||||
func TestIsValid(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user