You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/11/15 08:20:50 UTC

[GitHub] [incubator-devlake] klesh commented on a diff in pull request #3679: feat: add project to support resource classification

klesh commented on code in PR #3679:
URL: https://github.com/apache/incubator-devlake/pull/3679#discussion_r1022467000


##########
plugins/tapd/impl/impl.go:
##########
@@ -37,6 +37,8 @@ var _ core.PluginMeta = (*Tapd)(nil)
 var _ core.PluginInit = (*Tapd)(nil)
 var _ core.PluginTask = (*Tapd)(nil)
 var _ core.PluginApi = (*Tapd)(nil)
+var _ core.PluginModel = (*Tapd)(nil)
+var _ core.PluginMetric = (*Tapd)(nil)

Review Comment:
   no



##########
plugins/webhook/impl/impl.go:
##########
@@ -43,6 +45,35 @@ func (plugin Webhook) Init(config *viper.Viper, logger core.Logger, db *gorm.DB)
 	return nil
 }
 
+func (plugin Webhook) RequiredDataEntities() (data []map[string]interface{}, err errors.Error) {
+	return []map[string]interface{}{

Review Comment:
   No, this is not a metric plugin



##########
plugins/refdiff/refdiff.go:
##########
@@ -44,10 +46,31 @@ func (plugin RefDiff) Description() string {
 	return "Calculate commits diff for specified ref pairs based on `commits` and `commit_parents` tables"
 }
 
+func (plugin RefDiff) RequiredDataEntities() (data []map[string]interface{}, err errors.Error) {
+	return []map[string]interface{}{}, nil
+}
+
 func (plugin RefDiff) GetTablesInfo() []core.Tabler {
 	return []core.Tabler{}
 }
 
+func (plugin RefDiff) IsProjectMetric() bool {
+	return false
+}
+
+func (plugin RefDiff) RunAfter() ([]string, errors.Error) {
+	return []string{

Review Comment:
   no, let it empty at this point



##########
plugins/starrocks/starrocks.go:
##########
@@ -27,6 +27,12 @@ import (
 
 type StarRocks string
 
+// make sure interface is implemented
+var _ core.PluginMeta = (*StarRocks)(nil)
+var _ core.PluginTask = (*StarRocks)(nil)
+var _ core.PluginModel = (*StarRocks)(nil)
+var _ core.PluginMetric = (*StarRocks)(nil)

Review Comment:
   no



##########
plugins/jira/impl/impl.go:
##########
@@ -37,6 +38,8 @@ var _ core.PluginMeta = (*Jira)(nil)
 var _ core.PluginInit = (*Jira)(nil)
 var _ core.PluginTask = (*Jira)(nil)
 var _ core.PluginApi = (*Jira)(nil)
+var _ core.PluginModel = (*Jira)(nil)
+var _ core.PluginMetric = (*Jira)(nil)

Review Comment:
   no



##########
plugins/jenkins/impl/impl.go:
##########
@@ -36,6 +36,8 @@ var _ core.PluginMeta = (*Jenkins)(nil)
 var _ core.PluginInit = (*Jenkins)(nil)
 var _ core.PluginTask = (*Jenkins)(nil)
 var _ core.PluginApi = (*Jenkins)(nil)
+var _ core.PluginModel = (*Jenkins)(nil)
+var _ core.PluginMetric = (*Jenkins)(nil)

Review Comment:
   no



##########
plugins/org/impl/impl.go:
##########
@@ -31,6 +31,8 @@ import (
 var _ core.PluginMeta = (*Org)(nil)
 var _ core.PluginInit = (*Org)(nil)
 var _ core.PluginTask = (*Org)(nil)
+var _ core.PluginModel = (*Org)(nil)
+var _ core.PluginMetric = (*Org)(nil)

Review Comment:
   no



##########
plugins/icla/plugin_main.go:
##########
@@ -37,6 +37,8 @@ var _ core.PluginMeta = (*Icla)(nil)
 var _ core.PluginInit = (*Icla)(nil)
 var _ core.PluginTask = (*Icla)(nil)
 var _ core.PluginApi = (*Icla)(nil)
+var _ core.PluginModel = (*Icla)(nil)
+var _ core.PluginMetric = (*Icla)(nil)

Review Comment:
   no



##########
plugins/github_graphql/plugin_main.go:
##########
@@ -32,16 +36,15 @@ import (
 	"github.com/spf13/viper"
 	"golang.org/x/oauth2"
 	"gorm.io/gorm"
-	"reflect"
-	"strings"
-	"time"
 )
 
 // make sure interface is implemented
 var _ core.PluginMeta = (*GithubGraphql)(nil)
 var _ core.PluginInit = (*GithubGraphql)(nil)
 var _ core.PluginTask = (*GithubGraphql)(nil)
 var _ core.PluginApi = (*GithubGraphql)(nil)
+var _ core.PluginModel = (*GithubGraphql)(nil)
+var _ core.PluginMetric = (*GithubGraphql)(nil)

Review Comment:
   no



##########
plugins/gitlab/impl/impl.go:
##########
@@ -34,9 +34,10 @@ import (
 
 var _ core.PluginMeta = (*Gitlab)(nil)
 var _ core.PluginInit = (*Gitlab)(nil)
-var _ core.PluginModel = (*Gitlab)(nil)
 var _ core.PluginTask = (*Gitlab)(nil)
 var _ core.PluginApi = (*Gitlab)(nil)
+var _ core.PluginModel = (*Gitlab)(nil)
+var _ core.PluginMetric = (*Gitlab)(nil)

Review Comment:
   no



##########
plugins/gitextractor/gitextractor.go:
##########
@@ -31,13 +31,31 @@ import (
 
 var _ core.PluginMeta = (*GitExtractor)(nil)
 var _ core.PluginTask = (*GitExtractor)(nil)
+var _ core.PluginModel = (*GitExtractor)(nil)
+var _ core.PluginMetric = (*GitExtractor)(nil)

Review Comment:
   no



##########
plugins/feishu/impl/impl.go:
##########
@@ -37,6 +37,8 @@ var _ core.PluginMeta = (*Feishu)(nil)
 var _ core.PluginInit = (*Feishu)(nil)
 var _ core.PluginTask = (*Feishu)(nil)
 var _ core.PluginApi = (*Feishu)(nil)
+var _ core.PluginModel = (*Feishu)(nil)
+var _ core.PluginMetric = (*Feishu)(nil)

Review Comment:
   no



##########
plugins/gitee/impl/impl.go:
##########
@@ -36,6 +36,8 @@ var _ core.PluginMeta = (*Gitee)(nil)
 var _ core.PluginInit = (*Gitee)(nil)
 var _ core.PluginTask = (*Gitee)(nil)
 var _ core.PluginApi = (*Gitee)(nil)
+var _ core.PluginModel = (*Gitee)(nil)
+var _ core.PluginMetric = (*Gitee)(nil)

Review Comment:
   no



##########
plugins/dbt/dbt.go:
##########
@@ -28,8 +28,10 @@ import (
 )
 
 var (
-	_ core.PluginMeta = (*Dbt)(nil)
-	_ core.PluginTask = (*Dbt)(nil)
+	_ core.PluginMeta   = (*Dbt)(nil)
+	_ core.PluginTask   = (*Dbt)(nil)
+	_ core.PluginModel  = (*Dbt)(nil)
+	_ core.PluginMetric = (*Dbt)(nil)

Review Comment:
   no



##########
plugins/bitbucket/impl/impl.go:
##########
@@ -35,6 +35,8 @@ var _ core.PluginMeta = (*Bitbucket)(nil)
 var _ core.PluginInit = (*Bitbucket)(nil)
 var _ core.PluginTask = (*Bitbucket)(nil)
 var _ core.PluginApi = (*Bitbucket)(nil)
+var _ core.PluginModel = (*Bitbucket)(nil)
+var _ core.PluginMetric = (*Bitbucket)(nil)

Review Comment:
   no



##########
plugins/customize/impl/impl.go:
##########
@@ -32,6 +32,8 @@ import (
 var _ core.PluginMeta = (*Customize)(nil)
 var _ core.PluginInit = (*Customize)(nil)
 var _ core.PluginApi = (*Customize)(nil)
+var _ core.PluginModel = (*Customize)(nil)
+var _ core.PluginMetric = (*Customize)(nil)

Review Comment:
   no



##########
plugins/azure/impl/impl.go:
##########
@@ -36,6 +36,8 @@ var _ core.PluginMeta = (*Azure)(nil)
 var _ core.PluginInit = (*Azure)(nil)
 var _ core.PluginTask = (*Azure)(nil)
 var _ core.PluginApi = (*Azure)(nil)
+var _ core.PluginModel = (*Azure)(nil)
+var _ core.PluginMetric = (*Azure)(nil)

Review Comment:
   no



##########
plugins/core/plugin_metric.go:
##########
@@ -0,0 +1,46 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package core
+
+import (
+	"github.com/apache/incubator-devlake/errors"
+)
+
+/*
+ */
+type Tabler interface {

Review Comment:
   move it back to `plugin_model.go`



##########
plugins/ae/impl/impl.go:
##########
@@ -35,6 +35,8 @@ var _ core.PluginMeta = (*AE)(nil)
 var _ core.PluginInit = (*AE)(nil)
 var _ core.PluginTask = (*AE)(nil)
 var _ core.PluginApi = (*AE)(nil)
+var _ core.PluginModel = (*AE)(nil)
+var _ core.PluginMetric = (*AE)(nil)

Review Comment:
   no



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org