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/09/14 08:45:33 UTC

[GitHub] [incubator-devlake] klesh commented on a diff in pull request #3051: feat: add webhook plugin and implement connection save

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


##########
plugins/webhook/api/issue.go:
##########
@@ -0,0 +1,93 @@
+/*
+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 api
+
+import (
+	"github.com/apache/incubator-devlake/errors"
+	"github.com/apache/incubator-devlake/plugins/core"
+	"github.com/apache/incubator-devlake/plugins/webhook/models"
+	"net/http"
+	"time"
+)
+
+type WebhookIssueRequest struct {
+	BoardKey                string     `mapstructure:"board_key" validate:"required"`
+	Url                     string     `mapstructure:"url"`
+	IssueKey                string     `mapstructure:"issue_key" validate:"required"`
+	Title                   string     `mapstructure:"title" validate:"required"`
+	Description             string     `mapstructure:"description"`
+	EpicKey                 string     `mapstructure:"epic_key"`
+	Type                    string     `mapstructure:"type"`
+	Status                  string     `mapstructure:"status" validate:"oneof=TODO DONE IN_PROGRESS"`
+	OriginalStatus          string     `mapstructure:"original_status" validate:"required"`
+	StoryPoint              int64      `mapstructure:"story_point"`
+	ResolutionDate          *time.Time `mapstructure:"resolution_date"`
+	CreatedDate             *time.Time `mapstructure:"created_date" validate:"required"`
+	UpdatedDate             *time.Time `mapstructure:"updated_date"`
+	LeadTimeMinutes         uint       `mapstructure:"lead_time_minutes"`
+	ParentIssueKey          string     `mapstructure:"parent_issue_key"`
+	Priority                string     `mapstructure:"priority"`
+	OriginalEstimateMinutes int64      `mapstructure:"original_estimate_minutes"`
+	TimeSpentMinutes        int64      `mapstructure:"time_spent_minutes"`
+	TimeRemainingMinutes    int64      `mapstructure:"time_remaining_minutes"`
+	CreatorId               string     `mapstructure:"creator_id"`
+	CreatorName             string     `mapstructure:"creator_name"`
+	AssigneeId              string     `mapstructure:"assignee_id"`
+	AssigneeName            string     `mapstructure:"assignee_name"`
+	Severity                string     `mapstructure:"severity"`
+	Component               string     `mapstructure:"component"`
+	//IconURL               string
+	//DeploymentId          string
+}
+
+// PostIssue
+// @Summary receive a record as defined and save it
+// @Description receive a record as follow and save it, example: {"board_key":"DLK","url":"","issue_key":"DLK-1234","title":"a feature from DLK","description":"","epic_key":"","type":"BUG","status":"TODO","original_status":"created","story_point":0,"resolution_date":null,"created_date":"2020-01-01T12:00:00+00:00","updated_date":null,"lead_time_minutes":0,"parent_issue_key":"DLK-1200","priority":"","original_estimate_minutes":0,"time_spent_minutes":0,"time_remaining_minutes":0,"creator_id":"user1131","creator_name":"Nick name 1","assignee_id":"user1132","assignee_name":"Nick name 2","severity":"","component":""}
+// @Tags plugins/webhook
+// @Param body body WebhookPipelineRequest true "json body"
+// @Success 200  {string} noResponse ""
+// @Failure 400  {string} errcode.Error "Bad Request"
+// @Failure 500  {string} errcode.Error "Internal Error"
+// @Router /plugins/webhook/:connectionId/issue [POST]

Review Comment:
   /issues



##########
plugins/webhook/api/issue.go:
##########
@@ -0,0 +1,93 @@
+/*
+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 api
+
+import (
+	"github.com/apache/incubator-devlake/errors"
+	"github.com/apache/incubator-devlake/plugins/core"
+	"github.com/apache/incubator-devlake/plugins/webhook/models"
+	"net/http"
+	"time"
+)
+
+type WebhookIssueRequest struct {
+	BoardKey                string     `mapstructure:"board_key" validate:"required"`
+	Url                     string     `mapstructure:"url"`
+	IssueKey                string     `mapstructure:"issue_key" validate:"required"`
+	Title                   string     `mapstructure:"title" validate:"required"`
+	Description             string     `mapstructure:"description"`
+	EpicKey                 string     `mapstructure:"epic_key"`
+	Type                    string     `mapstructure:"type"`
+	Status                  string     `mapstructure:"status" validate:"oneof=TODO DONE IN_PROGRESS"`
+	OriginalStatus          string     `mapstructure:"original_status" validate:"required"`
+	StoryPoint              int64      `mapstructure:"story_point"`
+	ResolutionDate          *time.Time `mapstructure:"resolution_date"`
+	CreatedDate             *time.Time `mapstructure:"created_date" validate:"required"`
+	UpdatedDate             *time.Time `mapstructure:"updated_date"`
+	LeadTimeMinutes         uint       `mapstructure:"lead_time_minutes"`
+	ParentIssueKey          string     `mapstructure:"parent_issue_key"`
+	Priority                string     `mapstructure:"priority"`
+	OriginalEstimateMinutes int64      `mapstructure:"original_estimate_minutes"`
+	TimeSpentMinutes        int64      `mapstructure:"time_spent_minutes"`
+	TimeRemainingMinutes    int64      `mapstructure:"time_remaining_minutes"`
+	CreatorId               string     `mapstructure:"creator_id"`
+	CreatorName             string     `mapstructure:"creator_name"`
+	AssigneeId              string     `mapstructure:"assignee_id"`
+	AssigneeName            string     `mapstructure:"assignee_name"`
+	Severity                string     `mapstructure:"severity"`
+	Component               string     `mapstructure:"component"`
+	//IconURL               string
+	//DeploymentId          string
+}
+
+// PostIssue
+// @Summary receive a record as defined and save it
+// @Description receive a record as follow and save it, example: {"board_key":"DLK","url":"","issue_key":"DLK-1234","title":"a feature from DLK","description":"","epic_key":"","type":"BUG","status":"TODO","original_status":"created","story_point":0,"resolution_date":null,"created_date":"2020-01-01T12:00:00+00:00","updated_date":null,"lead_time_minutes":0,"parent_issue_key":"DLK-1200","priority":"","original_estimate_minutes":0,"time_spent_minutes":0,"time_remaining_minutes":0,"creator_id":"user1131","creator_name":"Nick name 1","assignee_id":"user1132","assignee_name":"Nick name 2","severity":"","component":""}
+// @Tags plugins/webhook
+// @Param body body WebhookPipelineRequest true "json body"
+// @Success 200  {string} noResponse ""
+// @Failure 400  {string} errcode.Error "Bad Request"
+// @Failure 500  {string} errcode.Error "Internal Error"
+// @Router /plugins/webhook/:connectionId/issue [POST]
+func PostIssue(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error) {
+	connection := &models.WebhookConnection{}
+	err := connectionHelper.First(connection, input.Params)
+	if err != nil {
+		return nil, err
+	}
+	// TODO save issue
+	return &core.ApiResourceOutput{Body: nil, Status: http.StatusOK}, nil
+}
+
+// CloseIssue
+// @Summary set issue's status to DONE
+// @Description set issue's status to DONE
+// @Tags plugins/webhook
+// @Success 200  {string} noResponse ""
+// @Failure 400  {string} errcode.Error "Bad Request"
+// @Failure 500  {string} errcode.Error "Internal Error"
+// @Router /plugins/webhook/:connectionId/issue/:boardKey/:issueId/close [POST]

Review Comment:
   Why do we need boardKey in the URL?



##########
plugins/webhook/impl/impl.go:
##########
@@ -0,0 +1,120 @@
+/*
+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 impl
+
+import (
+	"fmt"
+	"github.com/apache/incubator-devlake/errors"
+	"github.com/apache/incubator-devlake/migration"
+	"github.com/apache/incubator-devlake/plugins/core"
+	"github.com/apache/incubator-devlake/plugins/helper"
+	"github.com/apache/incubator-devlake/plugins/webhook/api"
+	"github.com/apache/incubator-devlake/plugins/webhook/models"
+	"github.com/apache/incubator-devlake/plugins/webhook/models/migrationscripts"
+	"github.com/apache/incubator-devlake/plugins/webhook/tasks"
+	"github.com/spf13/viper"
+	"gorm.io/gorm"
+)
+
+// make sure interface is implemented
+var _ core.PluginMeta = (*Webhook)(nil)
+var _ core.PluginInit = (*Webhook)(nil)
+var _ core.PluginTask = (*Webhook)(nil)

Review Comment:
   No need



##########
plugins/webhook/impl/impl.go:
##########
@@ -0,0 +1,120 @@
+/*
+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 impl
+
+import (
+	"fmt"
+	"github.com/apache/incubator-devlake/errors"
+	"github.com/apache/incubator-devlake/migration"
+	"github.com/apache/incubator-devlake/plugins/core"
+	"github.com/apache/incubator-devlake/plugins/helper"
+	"github.com/apache/incubator-devlake/plugins/webhook/api"
+	"github.com/apache/incubator-devlake/plugins/webhook/models"
+	"github.com/apache/incubator-devlake/plugins/webhook/models/migrationscripts"
+	"github.com/apache/incubator-devlake/plugins/webhook/tasks"
+	"github.com/spf13/viper"
+	"gorm.io/gorm"
+)
+
+// make sure interface is implemented
+var _ core.PluginMeta = (*Webhook)(nil)
+var _ core.PluginInit = (*Webhook)(nil)
+var _ core.PluginTask = (*Webhook)(nil)
+var _ core.PluginApi = (*Webhook)(nil)
+var _ core.PluginBlueprintV100 = (*Webhook)(nil)
+var _ core.CloseablePluginTask = (*Webhook)(nil)
+
+type Webhook struct{}
+
+func (plugin Webhook) Description() string {
+	return "collect some Webhook data"
+}
+
+func (plugin Webhook) Init(config *viper.Viper, logger core.Logger, db *gorm.DB) errors.Error {
+	api.Init(config, logger, db)
+	return nil
+}
+
+func (plugin Webhook) SubTaskMetas() []core.SubTaskMeta {
+	// TODO add your sub task here
+	return []core.SubTaskMeta{}
+}
+
+func (plugin Webhook) PrepareTaskData(taskCtx core.TaskContext, options map[string]interface{}) (interface{}, errors.Error) {

Review Comment:
   No need



##########
plugins/webhook/api/cicd_pipeline.go:
##########
@@ -0,0 +1,58 @@
+/*
+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 api
+
+import (
+	"github.com/apache/incubator-devlake/errors"
+	"github.com/apache/incubator-devlake/plugins/core"
+	"github.com/apache/incubator-devlake/plugins/webhook/models"
+	"net/http"
+	"time"
+)
+
+type WebhookPipelineRequest struct {
+	Id           string     `validate:"required"`
+	Result       string     `validate:"oneof=SUCCESS FAILURE ABORT"`
+	Status       string     `validate:"oneof=IN_PROGRESS DONE"`
+	Type         string     `validate:"oneof=CI CD CI/CD"`
+	CreatedDate  time.Time  `mapstructure:"created_date" validate:"required"`
+	FinishedDate *time.Time `mapstructure:"finished_date"`
+
+	Repo      string `validate:"required"`
+	Branch    string
+	CommitSha string `mapstructure:"commit_sha"`
+}
+
+// PostCicdPipeline

Review Comment:
   what is this?



##########
plugins/webhook/impl/impl.go:
##########
@@ -0,0 +1,120 @@
+/*
+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 impl
+
+import (
+	"fmt"
+	"github.com/apache/incubator-devlake/errors"
+	"github.com/apache/incubator-devlake/migration"
+	"github.com/apache/incubator-devlake/plugins/core"
+	"github.com/apache/incubator-devlake/plugins/helper"
+	"github.com/apache/incubator-devlake/plugins/webhook/api"
+	"github.com/apache/incubator-devlake/plugins/webhook/models"
+	"github.com/apache/incubator-devlake/plugins/webhook/models/migrationscripts"
+	"github.com/apache/incubator-devlake/plugins/webhook/tasks"
+	"github.com/spf13/viper"
+	"gorm.io/gorm"
+)
+
+// make sure interface is implemented
+var _ core.PluginMeta = (*Webhook)(nil)
+var _ core.PluginInit = (*Webhook)(nil)
+var _ core.PluginTask = (*Webhook)(nil)
+var _ core.PluginApi = (*Webhook)(nil)
+var _ core.PluginBlueprintV100 = (*Webhook)(nil)
+var _ core.CloseablePluginTask = (*Webhook)(nil)

Review Comment:
   No need



##########
plugins/webhook/impl/impl.go:
##########
@@ -0,0 +1,120 @@
+/*
+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 impl
+
+import (
+	"fmt"
+	"github.com/apache/incubator-devlake/errors"
+	"github.com/apache/incubator-devlake/migration"
+	"github.com/apache/incubator-devlake/plugins/core"
+	"github.com/apache/incubator-devlake/plugins/helper"
+	"github.com/apache/incubator-devlake/plugins/webhook/api"
+	"github.com/apache/incubator-devlake/plugins/webhook/models"
+	"github.com/apache/incubator-devlake/plugins/webhook/models/migrationscripts"
+	"github.com/apache/incubator-devlake/plugins/webhook/tasks"
+	"github.com/spf13/viper"
+	"gorm.io/gorm"
+)
+
+// make sure interface is implemented
+var _ core.PluginMeta = (*Webhook)(nil)
+var _ core.PluginInit = (*Webhook)(nil)
+var _ core.PluginTask = (*Webhook)(nil)
+var _ core.PluginApi = (*Webhook)(nil)
+var _ core.PluginBlueprintV100 = (*Webhook)(nil)
+var _ core.CloseablePluginTask = (*Webhook)(nil)
+
+type Webhook struct{}
+
+func (plugin Webhook) Description() string {
+	return "collect some Webhook data"
+}
+
+func (plugin Webhook) Init(config *viper.Viper, logger core.Logger, db *gorm.DB) errors.Error {
+	api.Init(config, logger, db)
+	return nil
+}
+
+func (plugin Webhook) SubTaskMetas() []core.SubTaskMeta {

Review Comment:
   No need



##########
plugins/webhook/api/blueprint.go:
##########
@@ -0,0 +1,57 @@
+/*
+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 api
+
+import (
+	"encoding/json"
+	"github.com/apache/incubator-devlake/errors"
+
+	"github.com/apache/incubator-devlake/plugins/core"
+	"github.com/apache/incubator-devlake/plugins/helper"
+	"github.com/apache/incubator-devlake/plugins/webhook/tasks"
+)
+
+func MakePipelinePlan(subtaskMetas []core.SubTaskMeta, connectionId uint64, scope []*core.BlueprintScopeV100) (core.PipelinePlan, errors.Error) {

Review Comment:
   Not needed, webhook should be not a part of the blueprint or pipeline



##########
plugins/webhook/impl/impl.go:
##########
@@ -0,0 +1,120 @@
+/*
+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 impl
+
+import (
+	"fmt"
+	"github.com/apache/incubator-devlake/errors"
+	"github.com/apache/incubator-devlake/migration"
+	"github.com/apache/incubator-devlake/plugins/core"
+	"github.com/apache/incubator-devlake/plugins/helper"
+	"github.com/apache/incubator-devlake/plugins/webhook/api"
+	"github.com/apache/incubator-devlake/plugins/webhook/models"
+	"github.com/apache/incubator-devlake/plugins/webhook/models/migrationscripts"
+	"github.com/apache/incubator-devlake/plugins/webhook/tasks"
+	"github.com/spf13/viper"
+	"gorm.io/gorm"
+)
+
+// make sure interface is implemented
+var _ core.PluginMeta = (*Webhook)(nil)
+var _ core.PluginInit = (*Webhook)(nil)
+var _ core.PluginTask = (*Webhook)(nil)
+var _ core.PluginApi = (*Webhook)(nil)
+var _ core.PluginBlueprintV100 = (*Webhook)(nil)
+var _ core.CloseablePluginTask = (*Webhook)(nil)
+
+type Webhook struct{}
+
+func (plugin Webhook) Description() string {
+	return "collect some Webhook data"
+}
+
+func (plugin Webhook) Init(config *viper.Viper, logger core.Logger, db *gorm.DB) errors.Error {
+	api.Init(config, logger, db)
+	return nil
+}
+
+func (plugin Webhook) SubTaskMetas() []core.SubTaskMeta {
+	// TODO add your sub task here
+	return []core.SubTaskMeta{}
+}
+
+func (plugin Webhook) PrepareTaskData(taskCtx core.TaskContext, options map[string]interface{}) (interface{}, errors.Error) {
+	op, err := tasks.DecodeAndValidateTaskOptions(options)
+	if err != nil {
+		return nil, err
+	}
+	connectionHelper := helper.NewConnectionHelper(
+		taskCtx,
+		nil,
+	)
+	connection := &models.WebhookConnection{}
+	err = connectionHelper.FirstById(connection, op.ConnectionId)
+	if err != nil {
+		return nil, errors.Default.Wrap(err, "unable to get webhook connection by the given connection ID")
+	}
+
+	return &tasks.WebhookTaskData{
+		Options: op,
+	}, nil
+}
+
+// PkgPath information lost when compiled as plugin(.so)
+func (plugin Webhook) RootPkgPath() string {
+	return "github.com/apache/incubator-devlake/plugins/webhook"
+}
+
+func (plugin Webhook) MigrationScripts() []migration.Script {
+	return migrationscripts.All()
+}
+
+func (plugin Webhook) ApiResources() map[string]map[string]core.ApiResourceHandler {
+	return map[string]map[string]core.ApiResourceHandler{
+		"connections": {
+			"POST": api.PostConnections,
+			"GET":  api.ListConnections,
+		},
+		"connections/:connectionId": {
+			"GET":    api.GetConnection,
+			"PATCH":  api.PatchConnection,
+			"DELETE": api.DeleteConnection,
+		},
+		":connectionId/cicd_pipeline": {
+			"POST": api.PostCicdPipeline,
+		},
+		":connectionId/issue": {
+			"POST": api.PostIssue,
+		},
+		":connectionId/issue/:boardKey/:issueId/close": {
+			"POST": api.CloseIssue,
+		},
+	}
+}
+
+func (plugin Webhook) MakePipelinePlan(connectionId uint64, scope []*core.BlueprintScopeV100) (core.PipelinePlan, errors.Error) {

Review Comment:
   No need



##########
plugins/webhook/impl/impl.go:
##########
@@ -0,0 +1,120 @@
+/*
+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 impl
+
+import (
+	"fmt"
+	"github.com/apache/incubator-devlake/errors"
+	"github.com/apache/incubator-devlake/migration"
+	"github.com/apache/incubator-devlake/plugins/core"
+	"github.com/apache/incubator-devlake/plugins/helper"
+	"github.com/apache/incubator-devlake/plugins/webhook/api"
+	"github.com/apache/incubator-devlake/plugins/webhook/models"
+	"github.com/apache/incubator-devlake/plugins/webhook/models/migrationscripts"
+	"github.com/apache/incubator-devlake/plugins/webhook/tasks"
+	"github.com/spf13/viper"
+	"gorm.io/gorm"
+)
+
+// make sure interface is implemented
+var _ core.PluginMeta = (*Webhook)(nil)
+var _ core.PluginInit = (*Webhook)(nil)
+var _ core.PluginTask = (*Webhook)(nil)
+var _ core.PluginApi = (*Webhook)(nil)
+var _ core.PluginBlueprintV100 = (*Webhook)(nil)

Review Comment:
   No need



##########
plugins/webhook/tasks/task_data.go:
##########
@@ -0,0 +1,48 @@
+/*
+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 tasks

Review Comment:
   No need



-- 
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