klesh commented on code in PR #4026:
URL:
https://github.com/apache/incubator-devlake/pull/4026#discussion_r1057169310
##########
plugins/dora/tasks/cicd_task_env_enricher.go:
##########
@@ -37,49 +33,5 @@ var EnrichTaskEnvMeta = core.SubTaskMeta{
}
func EnrichTasksEnv(taskCtx core.SubTaskContext) (err errors.Error) {
- db := taskCtx.GetDal()
- data := taskCtx.GetData().(*DoraTaskData)
- projectName := data.Options.ProjectName
-
- productionNamePattern := data.Options.ProductionPattern
- productionNameRegexp, err :=
errors.Convert01(regexp.Compile(productionNamePattern))
- if err != nil {
- return err
- }
-
- cursor, err := db.Cursor(
- dal.From(`cicd_tasks ct`),
- dal.Join("left join project_mapping pm on pm.row_id =
ct.cicd_scope_id"),
- dal.Where(`pm.project_name = ? and pm.table = ?`, projectName,
"cicd_scopes"),
- )
-
- if err != nil {
- return err
- }
-
- defer cursor.Close()
- converter, err := helper.NewDataConverter(helper.DataConverterArgs{
- RawDataSubTaskArgs: helper.RawDataSubTaskArgs{
- Ctx: taskCtx,
- Params: DoraApiParams{
- ProjectName: projectName,
- },
- Table: "cicd_tasks",
- },
- InputRowType: reflect.TypeOf(devops.CICDTask{}),
- Input: cursor,
- Convert: func(inputRow interface{}) ([]interface{},
errors.Error) {
- cicdTask := inputRow.(*devops.CICDTask)
- if productionNamePattern == "" ||
productionNameRegexp.FindString(cicdTask.Name) != "" {
- cicdTask.Environment = devops.PRODUCTION
- return []interface{}{cicdTask}, nil
- }
- return nil, nil
- },
- })
- if err != nil {
- return err
- }
-
- return converter.Execute()
+ return nil
Review Comment:
Please add a comment to mention that the enrichment was moved to data source
plugins
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]