warren830 commented on code in PR #4446:
URL:
https://github.com/apache/incubator-devlake/pull/4446#discussion_r1111454408
##########
backend/plugins/bamboo/impl/impl.go:
##########
@@ -108,6 +110,43 @@ func (p Bamboo) PrepareTaskData(taskCtx
plugin.TaskContext, options map[string]i
return nil, errors.Default.Wrap(err, "unable to get Bamboo API
client instance")
}
+ if op.ProjectKey != "" {
+ var scope *models.BambooProject
+ // support v100 & advance mode
+ // If we still cannot find the record in db, we have to request
from remote server and save it to db
+ db := taskCtx.GetDal()
+ err = db.First(&scope, dal.Where("connection_id = ? AND key =
?", op.ConnectionId, op.ProjectKey))
+ if err != nil && db.IsErrorNotFound(err) {
+ apiProject, err := api.GetApiProject(op.ProjectKey,
apiClient)
+ if err != nil {
+ return nil, err
+ }
+ logger.Debug(fmt.Sprintf("Current project: %s",
apiProject.Key))
+ scope.Convert(apiProject)
Review Comment:
If you have func `scope.Convert`, I think you can delete func
`ConvertProject` in project_extractor
--
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]