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
78842d2e
Commit
78842d2e
authored
Dec 20, 2023
by
Tấn Trần Thanh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build report all team
parent
cdd50b9a
Pipeline
#1615
failed with stages
in 0 seconds
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
13 deletions
+24
-13
plugins/workflow_report/app/controllers/workflow_report_controller.rb
+7
-2
plugins/workflow_report/app/models/workflow_report_issue.rb
+1
-1
plugins/workflow_report/assets/stylesheets/style.css
+2
-1
plugins/workflow_report/config/settings.yml
+1
-0
plugins/workflow_report/lib/workflow_report.rb
+13
-9
No files found.
plugins/workflow_report/app/controllers/workflow_report_controller.rb
View file @
78842d2e
...
...
@@ -44,8 +44,13 @@ class WorkflowReportController < ApplicationController
def
export
team
=
params
[
:team
]
project_ids
=
$workflow_report_config
[
'teams'
].
select
{
|
hash
|
hash
.
key?
(
team
)
}[
0
][
team
]
result
=
Rails
.
cache
.
fetch
(
"
#{
team
}
_
#{
params
[
:year
]
}
_
#{
params
[
:month
]
}
"
,
expires_in:
1
.
hours
)
do
project_ids
=
if
team
==
'All-team'
$workflow_report_config
[
'teams'
].
map
(
&
:values
).
flatten
.
compact
else
$workflow_report_config
[
'teams'
].
find
{
|
hash
|
hash
.
key?
(
team
)
}[
team
]
end
result
=
Rails
.
cache
.
fetch
(
"
#{
team
}
_
#{
params
[
:year
]
}
_
#{
params
[
:month
]
}
"
,
expires_in:
team
==
'All-team'
?
1
.
hours
:
1
.
days
)
do
WorkflowReport
.
build_report
(
params
[
:year
].
to_i
,
params
[
:month
].
to_i
,
project_ids
)
end
...
...
plugins/workflow_report/app/models/workflow_report_issue.rb
View file @
78842d2e
...
...
@@ -10,6 +10,6 @@ class WorkflowReportIssue < Issue
.
where
(
projects:
{
id:
project_ids
},
enabled_modules:
{
name:
'time_tracking'
})
.
where
([
'((time_entries.spent_on IS NOT NULL AND time_entries.tyear = ? AND time_entries.tmonth = ?) OR (issues.closed_on BETWEEN ? AND ?))'
,
year
,
month
,
DateTime
.
new
(
year
,
month
).
beginning_of_day
,
DateTime
.
new
(
year
,
month
,
-
1
).
end_of_day
])
.
order
(
:root_id
)
.
order
(
Arel
.
sql
(
"FIELD(projects.id,
#{
project_ids
.
join
(
','
)
}
)"
),
:root_id
)
}
end
plugins/workflow_report/assets/stylesheets/style.css
View file @
78842d2e
...
...
@@ -119,7 +119,6 @@ p.error_link {
td
.notes
{
position
:
relative
;
cursor
:
pointer
;
}
.note_est
{
...
...
@@ -127,6 +126,7 @@ td.notes {
}
.over_text
{
cursor
:
pointer
;
overflow
:
hidden
;
display
:
block
;
display
:
-webkit-box
;
...
...
@@ -135,6 +135,7 @@ td.notes {
}
.over_text
::before
{
cursor
:
pointer
;
position
:
absolute
;
right
:
6px
;
top
:
8px
;
...
...
plugins/workflow_report/config/settings.yml
View file @
78842d2e
...
...
@@ -42,3 +42,4 @@ teams:
-
146
-
APW-SUB
:
-
137
-
All-team
:
plugins/workflow_report/lib/workflow_report.rb
View file @
78842d2e
...
...
@@ -12,6 +12,7 @@ module WorkflowReport
COL_REQUIREMENT_TO_RELEASE
=
6
PROCESS
=
[
'1. Requirement'
,
'2. Design'
,
'3. Coding'
,
'4. Testing'
,
'5. Bug fixing'
,
'6. Release'
,
''
].
freeze
BUGS
=
{
testcases:
22
,
bugs:
23
,
stg_bugs:
27
,
prod_bugs:
28
}.
freeze
QUANTITY_THREAD
=
10
class
<<
self
def
build_report
(
year
,
month
,
project_ids
)
...
...
@@ -100,20 +101,23 @@ module WorkflowReport
end
end
threads_pr
=
github_links
[
:prs
].
map
do
|
prs
|
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
.
new
do
find_detail_pr
(
github
,
prs
[
:links
],
error_links
,
result
,
prs
[
:row
],
prs
[
:root_id
])
until
work_queue
.
empty?
type
,
item
=
work_queue
.
pop
(
true
)
rescue
nil
if
type
==
:pr
find_detail_pr
(
github
,
item
[
:links
],
error_links
,
result
,
item
[
:row
],
item
[
:root_id
])
elsif
type
==
:issue
find_detail_issue
(
github
,
result
,
error_links
,
item
[
:links
],
item
[
:row
],
item
[
:root_id
])
end
end
threads_issue
=
github_links
[
:issues
].
map
do
|
issues
|
Thread
.
new
do
find_detail_issue
(
github
,
result
,
error_links
,
issues
[
:links
],
issues
[
:row
],
issues
[
:root_id
])
end
end
threads_issue
.
each
(
&
:join
)
threads_pr
.
each
(
&
:join
)
thread_pool
.
each
(
&
:join
)
{
workflow_report:
result
,
error_links:
error_links
}
end
...
...
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