Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/plugins/gitlab/e2e/pipelines_detail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func TestGitlabPipelineDetailDataFlow(t *testing.T) {
dataflowTester.ImportCsvIntoTabler("./raw_tables/_tool_gitlab_projects.csv", &models.GitlabProject{})
dataflowTester.FlushTabler(&devops.CICDPipeline{})
dataflowTester.FlushTabler(&devops.CiCDPipelineCommit{})
dataflowTester.Subtask(tasks.ConvertPipelineMeta, taskData)
dataflowTester.Subtask(tasks.ConvertDetailPipelineMeta, taskData)
dataflowTester.Subtask(tasks.ConvertPipelineCommitMeta, taskData)
dataflowTester.VerifyTableWithOptions(&devops.CICDPipeline{}, e2ehelper.TableOptions{
CSVRelPath: "./snapshot_tables/cicd_pipelines.csv",
Expand Down
5 changes: 3 additions & 2 deletions backend/plugins/gitlab/tasks/mr_comment_convertor.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ limitations under the License.
package tasks

import (
"reflect"

"github.com/apache/incubator-devlake/core/dal"
"github.com/apache/incubator-devlake/core/errors"
"github.com/apache/incubator-devlake/core/models/domainlayer"
Expand All @@ -26,7 +28,6 @@ import (
"github.com/apache/incubator-devlake/core/plugin"
helper "github.com/apache/incubator-devlake/helpers/pluginhelper/api"
"github.com/apache/incubator-devlake/plugins/gitlab/models"
"reflect"
)

func init() {
Expand All @@ -43,7 +44,7 @@ var ConvertMrCommentMeta = plugin.SubTaskMeta{
}

func ConvertMergeRequestComment(taskCtx plugin.SubTaskContext) errors.Error {
rawDataSubTaskArgs, data := CreateRawDataSubTaskArgs(taskCtx, RAW_PROJECT_TABLE)
rawDataSubTaskArgs, data := CreateRawDataSubTaskArgs(taskCtx, RAW_MERGE_REQUEST_NOTES_TABLE)
db := taskCtx.GetDal()
clauses := []dal.Clause{
dal.From(&models.GitlabMrComment{}),
Expand Down
2 changes: 1 addition & 1 deletion backend/plugins/gitlab/tasks/pipeline_commit_convertor.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var ConvertPipelineCommitMeta = plugin.SubTaskMeta{
EnabledByDefault: true,
Description: "Convert tool layer table gitlab_pipeline_project into domain layer table pipeline",
DomainTypes: []string{plugin.DOMAIN_TYPE_CICD},
Dependencies: []*plugin.SubTaskMeta{&ConvertPipelineMeta},
Dependencies: []*plugin.SubTaskMeta{&ConvertDetailPipelineMeta},
}

func ConvertPipelineCommits(taskCtx plugin.SubTaskContext) errors.Error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ import (
)

func init() {
RegisterSubtaskMeta(&ConvertPipelineMeta)
RegisterSubtaskMeta(&ConvertDetailPipelineMeta)
}

var ConvertPipelineMeta = plugin.SubTaskMeta{
Name: "convertPipelines",
EntryPoint: ConvertPipelines,
var ConvertDetailPipelineMeta = plugin.SubTaskMeta{
Name: "convertDetailPipelines",
EntryPoint: ConvertDetailPipelines,
EnabledByDefault: true,
Description: "Convert tool layer table gitlab_pipeline into domain layer table pipeline",
Description: "Convert tool layer table gitlab_detail_pipeline into domain layer table pipeline",
DomainTypes: []string{plugin.DOMAIN_TYPE_CICD},
Dependencies: []*plugin.SubTaskMeta{&ConvertCommitsMeta},
}

func ConvertPipelines(taskCtx plugin.SubTaskContext) errors.Error {
func ConvertDetailPipelines(taskCtx plugin.SubTaskContext) errors.Error {
db := taskCtx.GetDal()
data := taskCtx.GetData().(*GitlabTaskData)

Expand All @@ -68,7 +68,7 @@ func ConvertPipelines(taskCtx plugin.SubTaskContext) errors.Error {
ConnectionId: data.Options.ConnectionId,
ProjectId: data.Options.ProjectId,
},
Table: RAW_PIPELINE_TABLE,
Table: RAW_PIPELINE_DETAILS_TABLE,
},
Convert: func(inputRow interface{}) ([]interface{}, errors.Error) {
gitlabPipeline := inputRow.(*models.GitlabPipeline)
Expand Down