You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by zh...@apache.org on 2023/06/14 08:26:27 UTC

[incubator-devlake] branch release-v0.17 updated: fix: jira server failed on deleted epic (#5482)

This is an automated email from the ASF dual-hosted git repository.

zhangliang2022 pushed a commit to branch release-v0.17
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/release-v0.17 by this push:
     new 86fadfa70 fix: jira server failed on deleted epic (#5482)
86fadfa70 is described below

commit 86fadfa70c58b568c2e0850c3a5f705ec54f7977
Author: Klesh Wong <zh...@merico.dev>
AuthorDate: Wed Jun 14 16:26:22 2023 +0800

    fix: jira server failed on deleted epic (#5482)
---
 backend/plugins/jira/tasks/epic_collector.go | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/backend/plugins/jira/tasks/epic_collector.go b/backend/plugins/jira/tasks/epic_collector.go
index 73d897dbe..2404366bf 100644
--- a/backend/plugins/jira/tasks/epic_collector.go
+++ b/backend/plugins/jira/tasks/epic_collector.go
@@ -26,6 +26,7 @@ import (
 	"github.com/apache/incubator-devlake/core/errors"
 	"github.com/apache/incubator-devlake/core/plugin"
 	"github.com/apache/incubator-devlake/helpers/pluginhelper/api"
+	"github.com/apache/incubator-devlake/plugins/jira/models"
 
 	"encoding/json"
 	"io"
@@ -48,7 +49,11 @@ var CollectEpicsMeta = plugin.SubTaskMeta{
 func CollectEpics(taskCtx plugin.SubTaskContext) errors.Error {
 	db := taskCtx.GetDal()
 	data := taskCtx.GetData().(*JiraTaskData)
-	epicIterator, err := GetEpicKeysIterator(db, data, 100)
+	batchSize := 100
+	if data.JiraServerInfo.DeploymentType == models.DeploymentServer && len(data.JiraServerInfo.VersionNumbers) == 3 && data.JiraServerInfo.VersionNumbers[0] <= 8 {
+		batchSize = 1
+	}
+	epicIterator, err := GetEpicKeysIterator(db, data, batchSize)
 	if err != nil {
 		return err
 	}
@@ -96,6 +101,8 @@ func CollectEpics(taskCtx plugin.SubTaskContext) errors.Error {
 			}
 			return data.Issues, nil
 		},
+		// Jira Server returns 400 if the epic is not found
+		AfterResponse: ignoreHTTPStatus400,
 	})
 	if err != nil {
 		return err