This is an automated email from the ASF dual-hosted git repository.
zhangliang2022 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new f55affa1 refactor: accelerate jira changelog collecting (#1967)
f55affa1 is described below
commit f55affa1a192a1f01e62868dbae5ab3ead810b5a
Author: mindlesscloud <[email protected]>
AuthorDate: Mon May 23 13:26:21 2022 +0800
refactor: accelerate jira changelog collecting (#1967)
---
plugins/jira/tasks/changelog_collector.go | 11 ++++++-----
plugins/jira/tasks/issue_extractor.go | 3 +++
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/plugins/jira/tasks/changelog_collector.go
b/plugins/jira/tasks/changelog_collector.go
index a2bc4df6..bd3f37bf 100644
--- a/plugins/jira/tasks/changelog_collector.go
+++ b/plugins/jira/tasks/changelog_collector.go
@@ -75,11 +75,12 @@ func CollectChangelogs(taskCtx core.SubTaskContext) error {
},
Table: RAW_CHANGELOG_TABLE,
},
- ApiClient: data.ApiClient,
- PageSize: 50,
- Incremental: true,
- Input: iterator,
- UrlTemplate: "api/3/issue/{{ .Input.IssueId }}/changelog",
+ ApiClient: data.ApiClient,
+ PageSize: 50,
+ Incremental: true,
+ GetTotalPages: GetTotalPagesFromResponse,
+ Input: iterator,
+ UrlTemplate: "api/3/issue/{{ .Input.IssueId }}/changelog",
Query: func(reqData *helper.RequestData) (url.Values, error) {
query := url.Values{}
query.Set("startAt", fmt.Sprintf("%v",
reqData.Pager.Skip))
diff --git a/plugins/jira/tasks/issue_extractor.go
b/plugins/jira/tasks/issue_extractor.go
index d82c3c45..17882df8 100644
--- a/plugins/jira/tasks/issue_extractor.go
+++ b/plugins/jira/tasks/issue_extractor.go
@@ -124,6 +124,9 @@ func ExtractIssues(taskCtx core.SubTaskContext) error {
issue.StdType = getStdType(issue.Type)
issue.StdStatus = getStdStatus(issue.StatusKey)
issue.SpentMinutes = issue.AggregateEstimateMinutes -
issue.RemainingEstimateMinutes
+ if len(changelogs) < 100 {
+ issue.ChangelogUpdated = &row.CreatedAt
+ }
results = append(results, issue)
for _, worklog := range worklogs {
results = append(results, worklog)