Commit 08e3aa3e by Tấn Trần Thanh

Merge branch 'hotfix/workflow-report-plugin' into feature/improve-performance-workflow-report

parents cfcf0b0c c67f1814
...@@ -23,8 +23,11 @@ module WorkflowReport ...@@ -23,8 +23,11 @@ module WorkflowReport
# raw_tasks = WorkflowReportIssue.raw_tasks_records(root_ids) # raw_tasks = WorkflowReportIssue.raw_tasks_records(root_ids)
raw_tasks.group_by(&:root_id).each do |root_id, record| raw_tasks.group_by(&:root_id).each do |root_id, record|
sum_hours_record = sum_hours_records.find { |hr| hr.root_id == root_id }
issue_ids = record.map(&:id) issue_ids = record.map(&:id)
journals = WorkflowReportJournal.find_journal_by_issue_ids(issue_ids).to_a journals = WorkflowReportJournal.find_journal_by_issue_ids(issue_ids).to_a
result[0] << root_id result[0] << root_id
result[1] << record.first.project.name.gsub(/[^[:print:]]/, '') result[1] << record.first.project.name.gsub(/[^[:print:]]/, '')
subject = WorkflowReportIssue.find(record.first.root_id)&.subject || record.first[:subject] subject = WorkflowReportIssue.find(record.first.root_id)&.subject || record.first[:subject]
...@@ -94,7 +97,10 @@ module WorkflowReport ...@@ -94,7 +97,10 @@ module WorkflowReport
result[BUG_COLS + index] << find_max_value_by_custom_field_id(record, custom_id) result[BUG_COLS + index] << find_max_value_by_custom_field_id(record, custom_id)
end end
end end
if jp_request.present? if jp_request.strip.blank?
result[32] << ''
result[33] << ''
else
jp_request = jp_request.strip jp_request = jp_request.strip
result[32] << jp_request result[32] << jp_request
begin begin
...@@ -107,11 +113,8 @@ module WorkflowReport ...@@ -107,11 +113,8 @@ module WorkflowReport
end end
rescue StandardError => e rescue StandardError => e
error_links << "##{root_id} Error occurred during the build with the ISSUE link:\r\n - #{jp_request} \r\n - #{e.message.gsub(/(?<=access_token=).*/, '123')}" error_links << "##{root_id} Error occurred during the build with the ISSUE link:\r\n - #{jp_request} \r\n - #{e.message.gsub(/(?<=access_token=).*/, '123')}"
result[33].push('') result[33].push('') if result[33][result[0].length - 1].nil?
end end
else
result[32] << ''
result[33] << ''
end end
# pr detail # pr detail
pr = { pr_comments: 0, pr_review_comments: 0, pr_commits: 0, pr_changed_files: 0, pr_additions: 0, pr_deletions: 0 } pr = { pr_comments: 0, pr_review_comments: 0, pr_commits: 0, pr_changed_files: 0, pr_additions: 0, pr_deletions: 0 }
...@@ -128,9 +131,9 @@ module WorkflowReport ...@@ -128,9 +131,9 @@ module WorkflowReport
pr[:pr_comments] += pr_detail.comments pr[:pr_comments] += pr_detail.comments
pr[:pr_review_comments] += pr_detail.review_comments pr[:pr_review_comments] += pr_detail.review_comments
pr[:pr_commits] += pr_detail.commits pr[:pr_commits] += pr_detail.commits
pr[:pr_changed_files] += pr_detail.changed_files
pr[:pr_additions] += pr_detail.additions pr[:pr_additions] += pr_detail.additions
pr[:pr_deletions] += pr_detail.deletions pr[:pr_deletions] += pr_detail.deletions
pr[:pr_changed_files] += pr_detail.changed_files
end end
rescue StandardError => e rescue StandardError => e
error_links << "##{root_id} Error occurred during the build with the PR link:\r\n - #{link} \r\n - #{e.message.gsub(/(?<=access_token=).*/, '123')}" error_links << "##{root_id} Error occurred during the build with the PR link:\r\n - #{link} \r\n - #{e.message.gsub(/(?<=access_token=).*/, '123')}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment