Skip to content

Commit

Permalink
refactor: unify plugin type to struct{}
Browse files Browse the repository at this point in the history
  • Loading branch information
klesh committed Oct 18, 2023
1 parent f0882c8 commit 1cdaf64
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion backend/plugins/bitbucket/impl/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var _ interface {
plugin.PluginSource
} = (*Bitbucket)(nil)

type Bitbucket string
type Bitbucket struct{}

func (p Bitbucket) Connection() dal.Tabler {
return &models.BitbucketConnection{}
Expand Down
2 changes: 1 addition & 1 deletion backend/plugins/gitee/impl/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var _ interface {

var _ plugin.PluginSource = (*Gitee)(nil)

type Gitee string
type Gitee struct{}

func (p Gitee) Connection() dal.Tabler {
return &models.GiteeConnection{}
Expand Down
2 changes: 1 addition & 1 deletion backend/plugins/gitlab/impl/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var _ interface {
plugin.CloseablePluginTask
} = (*Gitlab)(nil)

type Gitlab string
type Gitlab struct{}

func init() {
// check subtask meta loop when init subtask meta
Expand Down
2 changes: 1 addition & 1 deletion backend/plugins/starrocks/impl/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/apache/incubator-devlake/plugins/starrocks/tasks"
)

type StarRocks string
type StarRocks struct{}

// make sure interface is implemented
var _ interface {
Expand Down
8 changes: 4 additions & 4 deletions backend/plugins/table_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ func Test_GetPluginTablesInfo(t *testing.T) {
})
checker.FeedIn("ae/models", ae.AE{}.GetTablesInfo)
checker.FeedIn("bamboo/models", bamboo.Bamboo{}.GetTablesInfo)
checker.FeedIn("bitbucket/models", bitbucket.Bitbucket("").GetTablesInfo)
checker.FeedIn("bitbucket/models", bitbucket.Bitbucket{}.GetTablesInfo)
checker.FeedIn("customize/models", customize.Customize{}.GetTablesInfo)
checker.FeedIn("dbt", dbt.Dbt{}.GetTablesInfo)
checker.FeedIn("dora/models", dora.Dora{}.GetTablesInfo)
checker.FeedIn("feishu/models", feishu.Feishu{}.GetTablesInfo)
checker.FeedIn("gitee/models", gitee.Gitee("").GetTablesInfo)
checker.FeedIn("gitee/models", gitee.Gitee{}.GetTablesInfo)
checker.FeedIn("gitextractor/models", gitextractor.GitExtractor{}.GetTablesInfo)
checker.FeedIn("github/models", github.Github{}.GetTablesInfo)
checker.FeedIn("github_graphql", githubGraphql.GithubGraphql{}.GetTablesInfo)
checker.FeedIn("gitlab/models", gitlab.Gitlab("").GetTablesInfo)
checker.FeedIn("gitlab/models", gitlab.Gitlab{}.GetTablesInfo)
checker.FeedIn("icla/models", icla.Icla{}.GetTablesInfo)
checker.FeedIn("jenkins/models", jenkins.Jenkins{}.GetTablesInfo)
checker.FeedIn("jira/models", jira.Jira{}.GetTablesInfo)
Expand All @@ -75,7 +75,7 @@ func Test_GetPluginTablesInfo(t *testing.T) {
checker.FeedIn("refdiff/models", refdiff.RefDiff{}.GetTablesInfo)
checker.FeedIn("slack/models", slack.Slack{}.GetTablesInfo)
checker.FeedIn("sonarqube/models", sonarqube.Sonarqube{}.GetTablesInfo)
checker.FeedIn("starrocks", starrocks.StarRocks("").GetTablesInfo)
checker.FeedIn("starrocks", starrocks.StarRocks{}.GetTablesInfo)
checker.FeedIn("tapd/models", tapd.Tapd{}.GetTablesInfo)
checker.FeedIn("teambition/models", teambition.Teambition{}.GetTablesInfo)
checker.FeedIn("trello/models", trello.Trello{}.GetTablesInfo)
Expand Down
2 changes: 1 addition & 1 deletion backend/test/e2e/manual/gitlab/gitlab_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestGitlabPlugin(t *testing.T) {
DropDb: false,
TruncateDb: true,
Plugins: []plugin.PluginMeta{
gitlab.Gitlab(""),
gitlab.Gitlab{},
gitextractor.GitExtractor{},
},
})
Expand Down
11 changes: 6 additions & 5 deletions backend/test/e2e/services/server_startup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ limitations under the License.
package services

import (
"testing"

"github.com/apache/incubator-devlake/core/plugin"
ae "github.com/apache/incubator-devlake/plugins/ae/impl"
bamboo "github.com/apache/incubator-devlake/plugins/bamboo/impl"
Expand Down Expand Up @@ -47,7 +49,6 @@ import (
zentao "github.com/apache/incubator-devlake/plugins/zentao/impl"
"github.com/apache/incubator-devlake/test/helper"
"github.com/stretchr/testify/require"
"testing"
)

func TestStartup(t *testing.T) {
Expand All @@ -60,16 +61,16 @@ func loadGoPlugins() []plugin.PluginMeta {
return []plugin.PluginMeta{
ae.AE{},
bamboo.Bamboo{},
bitbucket.Bitbucket(""),
bitbucket.Bitbucket{},
customize.Customize{},
dbt.Dbt{},
dora.Dora{},
feishu.Feishu{},
gitee.Gitee(""),
gitee.Gitee{},
gitextractor.GitExtractor{},
github.Github{},
githubGraphql.GithubGraphql{},
gitlab.Gitlab(""),
gitlab.Gitlab{},
icla.Icla{},
jenkins.Jenkins{},
jira.Jira{},
Expand All @@ -78,7 +79,7 @@ func loadGoPlugins() []plugin.PluginMeta {
refdiff.RefDiff{},
slack.Slack{},
sonarqube.Sonarqube{},
starrocks.StarRocks(""),
starrocks.StarRocks{},
tapd.Tapd{},
teambition.Teambition{},
trello.Trello{},
Expand Down

0 comments on commit 1cdaf64

Please sign in to comment.