Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
redmine_v2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VeNtura
redmine_v2
Commits
9d0bc2a6
Commit
9d0bc2a6
authored
Dec 20, 2023
by
Tấn Trần Thanh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor code
parent
78842d2e
Pipeline
#1616
failed with stages
in 0 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
plugins/workflow_report/lib/workflow_report.rb
+3
-7
No files found.
plugins/workflow_report/lib/workflow_report.rb
View file @
9d0bc2a6
...
@@ -18,7 +18,7 @@ module WorkflowReport
...
@@ -18,7 +18,7 @@ module WorkflowReport
def
build_report
(
year
,
month
,
project_ids
)
def
build_report
(
year
,
month
,
project_ids
)
github
=
Github
.
new
oauth_token:
$workflow_report_config
[
'github_token'
]
github
=
Github
.
new
oauth_token:
$workflow_report_config
[
'github_token'
]
error_links
=
[]
error_links
=
[]
github_links
=
{
prs:
[],
issues:
[]
}
work_queue
=
Queue
.
new
result
=
TABLE_HEADER
.
length
.
times
.
map
{
[]
}
result
=
TABLE_HEADER
.
length
.
times
.
map
{
[]
}
raw_tasks
=
WorkflowReportIssue
.
raw_tasks_records
(
year
,
month
,
project_ids
)
raw_tasks
=
WorkflowReportIssue
.
raw_tasks_records
(
year
,
month
,
project_ids
)
return
{
workflow_report:
[],
error_links:
[]
}
if
raw_tasks
.
empty?
return
{
workflow_report:
[],
error_links:
[]
}
if
raw_tasks
.
empty?
...
@@ -67,8 +67,8 @@ module WorkflowReport
...
@@ -67,8 +67,8 @@ module WorkflowReport
if
issue
.
tracker_id
==
USER_STORY_TRACKER_ID
if
issue
.
tracker_id
==
USER_STORY_TRACKER_ID
pr_links
=
issue
.
custom_values
.
find_by
(
custom_field_id:
PR_FIELD_ID
)
&
.
value
pr_links
=
issue
.
custom_values
.
find_by
(
custom_field_id:
PR_FIELD_ID
)
&
.
value
jp_request
=
issue
.
custom_values
.
find_by
(
custom_field_id:
JP_REQUEST_FIELD_ID
)
&
.
value
jp_request
=
issue
.
custom_values
.
find_by
(
custom_field_id:
JP_REQUEST_FIELD_ID
)
&
.
value
github_links
[
:prs
].
push
({
row:
result
[
0
].
length
-
1
,
links:
pr_links
,
root_id:
root_id
}
)
if
pr_links
.
present?
work_queue
.
push
([
:pr
,
{
row:
result
[
0
].
length
-
1
,
links:
pr_links
,
root_id:
root_id
}]
)
if
pr_links
.
present?
github_links
[
:issues
].
push
({
row:
result
[
0
].
length
-
1
,
links:
jp_request
,
root_id:
root_id
}
)
if
jp_request
.
present?
work_queue
.
push
([
:issue
,
{
row:
result
[
0
].
length
-
1
,
links:
jp_request
,
root_id:
root_id
}]
)
if
jp_request
.
present?
end
end
process
=
get_process
(
issue
.
subject
.
gsub
(
/[^[:print:]]/
,
''
))
process
=
get_process
(
issue
.
subject
.
gsub
(
/[^[:print:]]/
,
''
))
...
@@ -101,10 +101,6 @@ module WorkflowReport
...
@@ -101,10 +101,6 @@ module WorkflowReport
end
end
end
end
work_queue
=
Queue
.
new
github_links
[
:prs
].
each
{
|
prs
|
work_queue
.
push
([
:pr
,
prs
])
}
github_links
[
:issues
].
each
{
|
issues
|
work_queue
.
push
([
:issue
,
issues
])
}
thread_pool
=
Array
.
new
(
QUANTITY_THREAD
)
do
thread_pool
=
Array
.
new
(
QUANTITY_THREAD
)
do
Thread
.
new
do
Thread
.
new
do
until
work_queue
.
empty?
until
work_queue
.
empty?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment