warren830 commented on code in PR #3892:
URL: 
https://github.com/apache/incubator-devlake/pull/3892#discussion_r1044195376


##########
plugins/github_graphql/impl/impl.go:
##########
@@ -178,6 +178,49 @@ func (plugin GithubGraphql) PrepareTaskData(taskCtx 
core.TaskContext, options ma
        }, nil
 }
 
+func EnrichOptions(taskCtx core.TaskContext,
+       op *githubTasks.GithubOptions,
+       connection *models.GithubConnection) (*models.GithubRepo, errors.Error) 
{
+       var githubRepo models.GithubRepo
+       var err errors.Error
+       log := taskCtx.GetLogger()
+       // for advanced mode or others which we already set value to onwer/repo
+       if op.Owner != "" && op.Repo != "" {
+               err := taskCtx.GetDal().First(&githubRepo, dal.Where(
+                       "connection_id = ? AND name = ? AND owner_login = ?",
+                       op.ConnectionId, op.Repo, op.Owner))
+               if err != nil {
+                       return nil, errors.Default.Wrap(err, fmt.Sprintf("fail 
to find repo %s/%s", op.Owner, op.Repo))
+               }
+               op.TransformationRuleId = githubRepo.TransformationRuleId
+       }
+       // for bp v200 which we only set ScopeId for options
+       if &githubRepo == nil && op.ScopeId != "" {

Review Comment:
   > It looks like `&githubRepo == nil` always true.
   
   yes, already fixed



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

Reply via email to