likyh commented on code in PR #3892:
URL:
https://github.com/apache/incubator-devlake/pull/3892#discussion_r1044139668
##########
plugins/github/api/blueprint_v200.go:
##########
@@ -123,39 +125,37 @@ func makeDataSourcePipelinePlanV200(
// construct task options for github
op := &tasks.GithubOptions{
- ConnectionId: githubRepo.ConnectionId,
- TransformationRuleId: githubRepo.TransformationRuleId,
- Owner: githubRepo.OwnerLogin,
- Repo: githubRepo.Name,
- }
- options, err := tasks.ValidateAndEncodeTaskOptions(op)
- if err != nil {
- return nil, err
+ ConnectionId: githubRepo.ConnectionId,
+ ScopeId: bpScope.Id,
}
-
- var transformationRuleMap map[string]interface{}
- err = errors.Convert(mapstructure.Decode(transformationRule,
&transformationRuleMap))
+ options, err := tasks.EncodeTaskOptions(op)
if err != nil {
return nil, err
}
- options["transformationRules"] = transformationRuleMap
stage, err = addGithub(subtaskMetas, connection,
bpScope.Entities, stage, options)
if err != nil {
return nil, err
}
+ ownerRepo := strings.Split(githubRepo.Name, "/")
+ if len(ownerRepo) != 2 {
+ return nil, errors.Default.New("Fail to parse
githubRepo.Name")
+ }
+ op.Owner = ownerRepo[0]
+ op.Repo = ownerRepo[1]
// add gitex stage and add repo to scopes
if utils.StringsContains(bpScope.Entities,
core.DOMAIN_TYPE_CODE) {
- repo, err = memorizedGetApiRepo(repo, op, apiClient)
+ repoRes, err = memorizedGetApiRepo(repoRes, op,
apiClient)
if err != nil {
return nil, err
}
- stage, err = addGitex(bpScope.Entities, connection,
repo, stage)
+ stage, err = addGitex(bpScope.Entities, connection,
repoRes, stage)
if err != nil {
return nil, err
}
}
plan[i] = stage
}
+ fmt.Println(plan)
Review Comment:
delete debug code
--
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]