Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-RAN
Commits
4f64703d
Commit
4f64703d
authored
May 04, 2021
by
hardy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding review form column to dashb
parent
cf1822be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
4 deletions
+28
-4
ci-scripts/ran_dashboard.py
ci-scripts/ran_dashboard.py
+28
-4
No files found.
ci-scripts/ran_dashboard.py
View file @
4f64703d
...
...
@@ -40,6 +40,8 @@ import shlex #lexical analysis
import
json
#json structures
import
datetime
#now() and date formating
from
datetime
import
datetime
import
re
import
gitlab
#-----------------------------------------------------------
# Class Declaration
...
...
@@ -79,7 +81,7 @@ class gDashboard:
#line 2 empty
#line 3 is for the column names
i
=
3
row
=
[
"MR"
,
"Created_at"
,
"Author"
,
"Title"
,
"Assignee"
,
"Reviewer"
,
"CAN START"
,
"IN PROGRESS"
,
"COMPLETED"
,
"OK MERGE"
,
"Merge conflicts"
]
row
=
[
"MR"
,
"Created_at"
,
"Author"
,
"Title"
,
"Assignee"
,
"Reviewer"
,
"CAN START"
,
"IN PROGRESS"
,
"COMPLETED"
,
"
Review Form"
,
"
OK MERGE"
,
"Merge conflicts"
]
self
.
sheet
.
insert_row
(
row
,
index
=
i
,
value_input_option
=
'RAW'
)
#line 4 onward, MR data lines
...
...
@@ -120,10 +122,32 @@ class gDashboard:
else
:
conflicts
=
""
#add a column flagging that the review form is present
#we use gitlab API to parse the MR notes
gl
=
gitlab
.
Gitlab
.
from_config
(
'OAI'
)
project_id
=
223
project
=
gl
.
projects
.
get
(
project_id
)
#get the opened MR in the project
mrs
=
project
.
mergerequests
.
list
(
state
=
'opened'
)
for
m
in
range
(
0
,
len
(
mrs
)):
if
mrs
[
m
].
iid
==
self
.
d
[
x
][
'iid'
]:
#check the iid is the one we are on
mr_notes
=
mrs
[
m
].
notes
.
list
(
all
=
True
)
n
=
0
found
=
False
review_form
=
""
while
found
==
False
and
n
<
len
(
mr_notes
):
res
=
re
.
search
(
'Code Review by'
,
mr_notes
[
n
].
body
)
#this is the marker we are looking for in all notes
if
res
!=
None
:
review_form
=
"X"
found
=
True
n
+=
1
#build final row to be inserted, the first column is left empty for now, will be filled afterward with hyperlinks to gitlab MR
row
=
[
""
,
str
(
date_time_obj
.
date
()),
str
(
self
.
d
[
x
][
'author'
][
'name'
]),
str
(
self
.
d
[
x
][
'title'
]),
\
assignee
,
reviewer
,
\
milestone1
,
milestone2
,
milestone3
,
milestone4
,
conflicts
]
milestone1
,
milestone2
,
milestone3
,
review_form
,
milestone4
,
conflicts
]
#insert the row to worksheet
self
.
sheet
.
insert_row
(
row
,
index
=
i
,
value_input_option
=
'RAW'
)
...
...
@@ -246,10 +270,10 @@ class gDashboard:
"sheetId"
:
sheetId
,
"dimension"
:
"COLUMNS"
,
"startIndex"
:
6
,
"endIndex"
:
1
0
"endIndex"
:
1
1
},
"properties"
:
{
"pixelSize"
:
1
35
"pixelSize"
:
1
20
},
"fields"
:
"pixelSize"
}
...
...
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