From 4f64703d5a2bf50b6d0959b6a9d472fd3be9730f Mon Sep 17 00:00:00 2001 From: hardy Date: Tue, 4 May 2021 14:28:39 +0200 Subject: [PATCH] adding review form column to dashb --- ci-scripts/ran_dashboard.py | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/ci-scripts/ran_dashboard.py b/ci-scripts/ran_dashboard.py index 601cda1722..4f18638e68 100644 --- a/ci-scripts/ran_dashboard.py +++ b/ci-scripts/ran_dashboard.py @@ -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