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
c67f1814
Commit
c67f1814
authored
Dec 08, 2023
by
Tấn Trần Thanh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
case user not input a link
parent
e074c4a1
Pipeline
#1600
failed with stages
in 0 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
plugins/workflow_report/lib/workflow_report.rb
+12
-10
No files found.
plugins/workflow_report/lib/workflow_report.rb
View file @
c67f1814
module
WorkflowReport
TABLE_HEADER
=
[
'root_id'
,
'project'
,
'subject'
,
'target_version'
,
'created_on '
,
'closed_on '
,
'due_date '
,
'status '
,
'Estimated_hours (*final version)'
,
'Actual time'
,
'Diff'
,
'Estimated_hours (*Initial version)'
,
'Number of estimation changes'
,
'Note of estimation changes'
,
'1. Requirement'
,
'2. Design'
,
'3. Coding'
,
'4. Testing'
,
'5. Bug fixing'
,
'6. Release'
,
'Others'
,
'1. Requirement'
,
'2. Design'
,
'3. Coding'
,
'4. Testing'
,
'5. Bug fixing'
,
'6. Release'
,
'Others'
,
'testcases'
,
'vn STG bug'
,
'Jp STG bug'
,
'Production'
,
'Issue'
,
'Issue comment'
,
'PR comment'
,
'Review comment'
,
'Commits'
,
'File changed'
,
'Addtion'
,
'Deletetion'
]
'4. Testing'
,
'5. Bug fixing'
,
'6. Release'
,
'Others'
,
'testcases'
,
'vn STG bug'
,
'Jp STG bug'
,
'Production'
,
'Issue'
,
'Issue comment'
,
'PR comment'
,
'Review comment'
,
'Commits'
,
'File changed'
,
'Addtion'
,
'Deletetion'
]
.
freeze
EST_DETAIL_FIRST_COL
=
14
ACTUAL_TIME_DETAIL_FIRST_COL
=
21
PR_CMT_COL
=
34
PROCESS
=
[
'1. Requirement'
,
'2. Design'
,
'3. Coding'
,
'4. Testing'
,
'5. Bug fixing'
,
'6. Release'
,
''
]
BUGS
=
{
testcases:
28
,
bugs:
29
,
stg_bugs:
30
,
prod_bugs:
31
}
PROCESS
=
[
'1. Requirement'
,
'2. Design'
,
'3. Coding'
,
'4. Testing'
,
'5. Bug fixing'
,
'6. Release'
,
''
]
.
freeze
BUGS
=
{
testcases:
28
,
bugs:
29
,
stg_bugs:
30
,
prod_bugs:
31
}
.
freeze
class
<<
self
def
build_report
(
year
,
month
,
project_ids
)
...
...
@@ -93,7 +93,10 @@ module WorkflowReport
result
[
column
].
push
(
sum_hours_record
[
status
].
to_i
>=
0
?
sum_hours_record
[
status
]
:
''
)
end
end
if
jp_request
.
present?
if
jp_request
.
strip
.
blank?
result
[
32
]
<<
''
result
[
33
]
<<
''
else
jp_request
=
jp_request
.
strip
result
[
32
]
<<
jp_request
begin
...
...
@@ -101,14 +104,13 @@ 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
:
''
)
else
result
[
33
].
push
(
''
)
if
result
[
33
][
result
[
0
].
length
-
1
].
nil?
end
rescue
=>
e
rescue
StandardError
=>
e
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
(
''
)
result
[
33
].
push
(
''
)
if
result
[
33
][
result
[
0
].
length
-
1
].
nil?
end
else
result
[
32
]
<<
''
result
[
33
]
<<
''
end
# pr detail
pr
=
{
pr_comments:
0
,
pr_review_comments:
0
,
pr_commits:
0
,
pr_changed_files:
0
,
pr_additions:
0
,
pr_deletions:
0
}
...
...
@@ -129,7 +131,7 @@ module WorkflowReport
pr
[
:pr_deletions
]
+=
pr_detail
.
deletions
pr
[
:pr_changed_files
]
+=
pr_detail
.
changed_files
end
rescue
=>
e
rescue
StandardError
=>
e
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
...
...
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