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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
16 deletions
+20
-16
plugins/workflow_report/lib/workflow_report.rb
+20
-16
No files found.
plugins/workflow_report/lib/workflow_report.rb
View file @
b5eef676
...
@@ -66,31 +66,29 @@ module WorkflowReport
...
@@ -66,31 +66,29 @@ module WorkflowReport
jp_request
=
issue
.
jp_request
jp_request
=
issue
.
jp_request
end
end
process
=
get_process
(
issue
.
subject
.
gsub
(
/[^[:print:]]/
,
''
))
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
case
process
when
'1. Requirement'
when
'1. Requirement'
result
[
index_1
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
EST_DETAIL_FIRST_COL
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
index_2
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
result
[
ACTUAL_TIME_DETAIL_FIRST_COL
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
when
'2. Design'
when
'2. Design'
result
[
index_1
+
1
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
EST_DETAIL_FIRST_COL
+
1
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
index_2
+
1
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
result
[
ACTUAL_TIME_DETAIL_FIRST_COL
+
1
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
when
'3. Coding'
when
'3. Coding'
result
[
index_1
+
2
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
EST_DETAIL_FIRST_COL
+
2
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
index_2
+
2
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
result
[
ACTUAL_TIME_DETAIL_FIRST_COL
+
2
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
when
'4. Testing'
when
'4. Testing'
result
[
index_1
+
3
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
EST_DETAIL_FIRST_COL
+
3
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
index_2
+
3
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
result
[
ACTUAL_TIME_DETAIL_FIRST_COL
+
3
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
when
'5. Bug fixing'
when
'5. Bug fixing'
result
[
index_1
+
4
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
EST_DETAIL_FIRST_COL
+
4
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
index_2
+
4
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
result
[
ACTUAL_TIME_DETAIL_FIRST_COL
+
4
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
when
'6. Release'
when
'6. Release'
result
[
index_1
+
5
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
EST_DETAIL_FIRST_COL
+
5
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
index_2
+
5
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
result
[
ACTUAL_TIME_DETAIL_FIRST_COL
+
5
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
else
else
result
[
index_1
+
6
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
EST_DETAIL_FIRST_COL
+
6
].
push
(
issue
.
estimated_hours
.
present?
?
issue
.
estimated_hours
:
''
)
result
[
index_2
+
6
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
result
[
ACTUAL_TIME_DETAIL_FIRST_COL
+
6
].
push
(
issue
.
spent_hours
.
positive?
?
issue
.
spent_hours
:
''
)
end
end
end
end
if
sum_hours_record
.
nil?
if
sum_hours_record
.
nil?
...
@@ -117,8 +115,12 @@ module WorkflowReport
...
@@ -117,8 +115,12 @@ module WorkflowReport
result
[
32
]
<<
jp_request
result
[
32
]
<<
jp_request
jp_request_arr
=
URI
(
jp_request
).
path
.
split
(
'/'
).
reject
(
&
:blank?
)
jp_request_arr
=
URI
(
jp_request
).
path
.
split
(
'/'
).
reject
(
&
:blank?
)
if
jp_request_arr
.
length
==
4
&&
jp_request_arr
[
3
].
to_i
.
positive?
if
jp_request_arr
.
length
==
4
&&
jp_request_arr
[
3
].
to_i
.
positive?
begin
issue_detail
=
github
.
issues
.
find
user:
jp_request_arr
[
0
],
repo:
jp_request_arr
[
1
],
number:
jp_request_arr
[
3
]
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
:
''
)
result
[
33
].
push
(
issue_detail
.
success?
?
issue_detail
.
comments
:
''
)
rescue
=>
e
result
[
33
].
push
(
''
)
end
end
end
else
else
result
[
32
]
<<
''
result
[
32
]
<<
''
...
@@ -138,6 +140,7 @@ module WorkflowReport
...
@@ -138,6 +140,7 @@ module WorkflowReport
pr_link_arr
=
URI
(
link
.
strip
).
path
.
split
(
'/'
).
compact_blank
pr_link_arr
=
URI
(
link
.
strip
).
path
.
split
(
'/'
).
compact_blank
next
unless
pr_link_arr
.
length
==
4
next
unless
pr_link_arr
.
length
==
4
begin
pr_detail
=
github
.
pull_requests
.
find
user:
pr_link_arr
[
0
],
repo:
pr_link_arr
[
1
],
number:
pr_link_arr
[
3
]
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?
if
pr_detail
.
success?
pr_comments
+=
pr_detail
.
comments
pr_comments
+=
pr_detail
.
comments
...
@@ -147,6 +150,7 @@ module WorkflowReport
...
@@ -147,6 +150,7 @@ module WorkflowReport
pr_deletions
+=
pr_detail
.
deletions
pr_deletions
+=
pr_detail
.
deletions
pr_changed_files
+=
pr_detail
.
changed_files
pr_changed_files
+=
pr_detail
.
changed_files
end
end
end
result
[
34
]
<<
pr_comments
result
[
34
]
<<
pr_comments
result
[
35
]
<<
pr_review_comments
result
[
35
]
<<
pr_review_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