abeizn commented on code in PR #5956:
URL:
https://github.com/apache/incubator-devlake/pull/5956#discussion_r1305426857
##########
backend/plugins/zentao/tasks/shared.go:
##########
@@ -179,29 +179,29 @@ func ignoreHTTPStatus404(res *http.Response) errors.Error
{
return nil
}
-func getProductIterator(taskCtx plugin.SubTaskContext) (dal.Rows,
*api.DalCursorIterator, errors.Error) {
- data := taskCtx.GetData().(*ZentaoTaskData)
- db := taskCtx.GetDal()
- clauses := []dal.Clause{
- dal.Select("id"),
- dal.From(&models.ZentaoProductSummary{}),
- dal.Where(
- "project_id = ? AND connection_id = ?",
- data.Options.ProjectId, data.Options.ConnectionId,
- ),
- }
-
- cursor, err := db.Cursor(clauses...)
- if err != nil {
- return nil, nil, err
- }
- iterator, err := api.NewDalCursorIterator(db, cursor,
reflect.TypeOf(input{}))
- if err != nil {
- cursor.Close()
- return nil, nil, err
- }
- return cursor, iterator, nil
-}
+//func getProductIterator(taskCtx plugin.SubTaskContext) (dal.Rows,
*api.DalCursorIterator, errors.Error) {
Review Comment:
If you really don't need it, delete it, don't comment it out
##########
backend/plugins/zentao/tasks/bug_collector.go:
##########
@@ -32,23 +32,53 @@ const RAW_BUG_TABLE = "zentao_api_bugs"
var _ plugin.SubTaskEntryPoint = CollectBug
+var CollectBugMeta = plugin.SubTaskMeta{
+ Name: "collectBug",
+ EntryPoint: CollectBug,
+ EnabledByDefault: true,
+ Description: "Collect Bug data from Zentao api",
+ DomainTypes: []string{plugin.DOMAIN_TYPE_TICKET},
+}
+
+type collectBugInput struct {
+ Path string
+ ProjectId int64
+ ProductId int64
+ ExecutionId int64
+}
+
func CollectBug(taskCtx plugin.SubTaskContext) errors.Error {
data := taskCtx.GetData().(*ZentaoTaskData)
- cursor, iterator, err := getProductIterator(taskCtx)
Review Comment:
Is there really no need to get bugs from product anymore? Or it needs to be
obtained from product, and it needs to be obtained from project?
--
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]