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
b5eef676
Commit
b5eef676
authored
Nov 25, 2023
by
Tấn Trần Thanh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
REDMINE cover case github token did not access to repo
parent
aa117c95
Pipeline
#1587
failed with stages
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
26 deletions
+30
-26
plugins/workflow_report/lib/workflow_report.rb
+30
-26
No files found.
plugins/workflow_report/lib/workflow_report.rb
View file @
b5eef676
...
...
@@ -66,31 +66,29 @@ module WorkflowReport
jp_request
=
issue
.
jp_request
end
process
=
get_process
(
issue
.
subject
.
gsub
(
/[^[:print:]]/
,
''
))
index_1
=
EST_DETAIL_FIRST_COL
# first index for estimation detail
index_2
=
ACTUAL_TIME_DETAIL_FIRST_COL
# first index for actual detail
case
process
when
'1. Requirement'
result
[
index_1
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
index_2
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
result
[
EST_DETAIL_FIRST_COL
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
ACTUAL_TIME_DETAIL_FIRST_COL
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
when
'2. Design'
result
[
index_1
+
1
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
index_2
+
1
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
result
[
EST_DETAIL_FIRST_COL
+
1
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
ACTUAL_TIME_DETAIL_FIRST_COL
+
1
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
when
'3. Coding'
result
[
index_1
+
2
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
index_2
+
2
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
result
[
EST_DETAIL_FIRST_COL
+
2
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
ACTUAL_TIME_DETAIL_FIRST_COL
+
2
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
when
'4. Testing'
result
[
index_1
+
3
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
index_2
+
3
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
result
[
EST_DETAIL_FIRST_COL
+
3
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
ACTUAL_TIME_DETAIL_FIRST_COL
+
3
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
when
'5. Bug fixing'
result
[
index_1
+
4
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
index_2
+
4
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
result
[
EST_DETAIL_FIRST_COL
+
4
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
ACTUAL_TIME_DETAIL_FIRST_COL
+
4
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
when
'6. Release'
result
[
index_1
+
5
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
index_2
+
5
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
result
[
EST_DETAIL_FIRST_COL
+
5
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
ACTUAL_TIME_DETAIL_FIRST_COL
+
5
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
else
result
[
index_1
+
6
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
index_2
+
6
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
result
[
EST_DETAIL_FIRST_COL
+
6
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
ACTUAL_TIME_DETAIL_FIRST_COL
+
6
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
end
end
if
sum_hours_record
.
nil?
...
...
@@ -117,8 +115,12 @@ module WorkflowReport
result
[
32
]
<<
jp_request
jp_request_arr
=
URI
(
jp_request
).
path
.
split
(
'/'
).
reject
(
&
:blank?
)
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
:
''
)
begin
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
:
''
)
rescue
=>
e
result
[
33
].
push
(
''
)
end
end
else
result
[
32
]
<<
''
...
...
@@ -138,14 +140,16 @@ module WorkflowReport
pr_link_arr
=
URI
(
link
.
strip
).
path
.
split
(
'/'
).
compact_blank
next
unless
pr_link_arr
.
length
==
4
pr_detail
=
github
.
pull_requests
.
find
user:
pr_link_arr
[
0
],
repo:
pr_link_arr
[
1
],
number:
pr_link_arr
[
3
]
if
pr_detail
.
success?
pr_comments
+=
pr_detail
.
comments
pr_review_comments
+=
pr_detail
.
review_comments
pr_commits
+=
pr_detail
.
commits
pr_additions
+=
pr_detail
.
additions
pr_deletions
+=
pr_detail
.
deletions
pr_changed_files
+=
pr_detail
.
changed_files
begin
pr_detail
=
github
.
pull_requests
.
find
user:
pr_link_arr
[
0
],
repo:
pr_link_arr
[
1
],
number:
pr_link_arr
[
3
]
if
pr_detail
.
success?
pr_comments
+=
pr_detail
.
comments
pr_review_comments
+=
pr_detail
.
review_comments
pr_commits
+=
pr_detail
.
commits
pr_additions
+=
pr_detail
.
additions
pr_deletions
+=
pr_detail
.
deletions
pr_changed_files
+=
pr_detail
.
changed_files
end
end
result
[
34
]
<<
pr_comments
...
...
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