likyh commented on code in PR #4373:
URL:
https://github.com/apache/incubator-devlake/pull/4373#discussion_r1106608781
##########
backend/plugins/bitbucket/impl/impl.go:
##########
@@ -166,3 +222,54 @@ func (p Bitbucket) Close(taskCtx plugin.TaskContext)
errors.Error {
data.ApiClient.Release()
return nil
}
+
+func EnrichOptions(taskCtx plugin.TaskContext,
+ op *tasks.BitbucketOptions,
+ apiClient *helper.ApiClient) errors.Error {
+ var repo models.BitbucketRepo
+ // validate the op and set name=owner/repo if this is from advanced
mode or bpV100
+ err := tasks.ValidateTaskOptions(op)
+ if err != nil {
+ return err
+ }
+ logger := taskCtx.GetLogger()
+ // for advanced mode or others which we only have name, for bp v200, we
have githubId
+ err = taskCtx.GetDal().First(&repo, dal.Where(
+ "connection_id = ? AND bitbucket_id = ?",
+ op.ConnectionId, op.FullName))
+ if err == nil {
+ if op.TransformationRuleId == 0 {
+ op.TransformationRuleId = repo.TransformationRuleId
+ }
+ } else {
+ if taskCtx.GetDal().IsErrorNotFound(err) && op.FullName != "" {
+ var repo *tasks.BitbucketApiRepo
Review Comment:
request repo from bitbucket api
--
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]