Commit 679e4d78 by Tấn Trần Thanh

show message error if github tk fail

parent 9a616fe2
Pipeline #1597 failed with stages
in 0 seconds
- if result.present?
table[border="1"]
tr.header_table--visible
......@@ -30,7 +29,7 @@
- if i == 0
td.sidebar_visible = result[0][index]
- elsif i == 13
td = result[i][index].html_safe
td.break-line = result[i][index]
- else
td = result[i][index]
- else
......@@ -38,4 +37,4 @@
.mt-10
- if error_links.present?
- error_links.each do |link|
p.red.error_link = link
p.red.error_link.break-line = link
#data_workflow > table, #data_workflow > h1{
#data_workflow > table, #data_workflow > h1 {
width: 100%;
overflow: auto;
height: 100vh;
......@@ -79,7 +79,12 @@ button.export-button {
margin-right: 8px;
}
p.error_link{
p.error_link {
padding: 4px 12px;
color: white;
}
.break-line {
white-space: break-spaces;
}
......@@ -14,7 +14,7 @@ module WorkflowReport
error_links = []
result = TABLE_HEADER.length.times.map { [] }
root_ids = WorkflowReportIssue.find_root_ids(year, month, project_ids)
return unless root_ids.length.positive?
return { workflow_report: [], error_links: [] } if root_ids.empty?
sum_hours_records = WorkflowReportIssue.find_sum_hours_records(root_ids)
raw_tasks = WorkflowReportIssue.raw_tasks_records(root_ids)
......@@ -52,7 +52,7 @@ module WorkflowReport
if journals.length.positive?
number_of_est_changes = journals.count { |j| !j[1].nil? } || ''
est_changes = journals.reject { |j| j[1].nil? }.select { |e| e[4].present? }
notes = est_changes.inject('') { |all, i| "#{all}<p> - #{i[4]}.</p> " } || ''
notes = est_changes.inject('') { |all, i| "#{all}- #{i[4]}.\r\n" } || ''
original_est_hours = journals.group_by(&:shift).inject(0) { |sum, i| sum + i[1][0][1].to_f unless i.nil? } || ''
result[11] << original_est_hours
result[12] << number_of_est_changes
......@@ -101,10 +101,9 @@ module WorkflowReport
if jp_request_arr.length >= 4 && jp_request_arr[3].to_i.positive?
issue_detail = github.issues.find user: jp_request_arr[0], repo: jp_request_arr[1], number: jp_request_arr[3]
result[33].push(issue_detail.success? ? issue_detail.comments : '')
end
rescue => e
error_links << "Error occurred during the build with the ISSUE link: #{jp_request}"
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('')
end
else
......@@ -131,7 +130,7 @@ module WorkflowReport
pr[:pr_changed_files] += pr_detail.changed_files
end
rescue => e
error_links << "Error occurred during the build with the PR link: #{link}"
error_links << "##{root_id} Error occurred during the build with the PR link:\r\n - #{link} \r\n - #{e.message.gsub(/(?<=access_token=).*/, '123')}"
end
end
end
......
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