From 8974d2683646159b96bc503caa29ffb67ba55e42 Mon Sep 17 00:00:00 2001 From: Laurent Alfonsi Date: Tue, 24 Jan 2023 13:06:36 +0100 Subject: WIP : last force, last_success Change-Id: Idc6bd1d9672e0df2002c97fa1d260650f21092cc --- developer_dashboard_generate.py | 45 ++++++++++++++++++++++--- developer_dashboard_generate/TCWG-for-ci.yaml | 1 + developer_dashboard_generate/TCWG-for-devs.yaml | 7 ++-- developer_dashboard_generate/v1-test.yaml | 16 +++------ 4 files changed, 51 insertions(+), 18 deletions(-) diff --git a/developer_dashboard_generate.py b/developer_dashboard_generate.py index 0c30e63..8efff52 100755 --- a/developer_dashboard_generate.py +++ b/developer_dashboard_generate.py @@ -36,8 +36,9 @@ def days_since(timestamp): ######################################################################################################################## ## CONFIG FILE -ci_url_view="https://ci.linaro.org/view/" -ci_url_job="https://ci.linaro.org/job/" +ci_url="https://ci.linaro.org/" +ci_url_view=ci_url+"view/" +ci_url_job=ci_url+"job/" ci={} """ @@ -177,6 +178,10 @@ def compute_smart_diag(project, build): ret_attr['text']="slowed down" ret_attr['class']='diag' break + elif re.search("speeds up", items): + ret_attr['text']="speeds up" + ret_attr['class']='diag' + break elif re.search("grew in size", items): ret_attr['text']="grew in size" ret_attr['class']='diag' @@ -305,9 +310,12 @@ Retrieve the information from a given project out of the CI server def get_ci_project_infos(pjt_name): ci_pjt={} usual_requests="?tree=number,result,timestamp,displayName,builds[number,result,timestamp,displayName]" + ci_pjt=get_ci_page(ci_url_job+pjt_name, request=usual_requests) ci_pjt['project_name']=pjt_name + if 'builds' not in ci_pjt: return ci_pjt + for bld in ci_pjt['builds']: if 'lastCompletedBuild' not in ci_pjt and bld['result']: ci_pjt['lastCompletedBuild']=bld @@ -317,6 +325,16 @@ def get_ci_project_infos(pjt_name): ci_pjt['lastFailedBuild']=bld if 'lastForcedBuild' not in ci_pjt and re.match('.*-force', bld['displayName']): ci_pjt['lastForcedBuild']=bld + bld=get_ci_page(ci_url_job+pjt_name+"/"+str(bld['number']), request="?tree=actions[causes[upstreamUrl,upstreamBuild]]") + for action in bld['actions']: + if 'causes' in action: + for cause in action['causes']: + if 'upstreamUrl' in cause: + ci_pjt['lastForcedBuild']['upstreamUrl']=cause['upstreamUrl'] + ci_pjt['lastForcedBuild']['upstreamBuild']=cause['upstreamBuild'] + bld=get_ci_page(ci_url+cause['upstreamUrl']+str(cause['upstreamBuild']), request=usual_requests) + ci_pjt['lastForcedBuild']['upstreamBuildName']=bld['displayName'] + return ci_pjt @@ -359,7 +377,7 @@ def get_ci_project_attribute(pjt_infos, attr_name): elif attr_name=="since_last_build": timestamp=pjt_infos['lastCompletedBuild']['timestamp'] - ret_attr['text']=str(days_since(timestamp))# + " days" + ret_attr['text']=str(days_since(timestamp)) + " days" elif attr_name=="since_last_success": timestamp=pjt_infos['lastSuccessfulBuild']['timestamp'] @@ -398,7 +416,26 @@ def get_ci_project_attribute(pjt_infos, attr_name): ret_attr['text']="res" lnk=ci_url_job+pjt_infos['project_name']+"/"+str(pjt_infos['lastCompletedBuild']['number'])+"/console" - ret_attr['text']=ret_attr['text'] + " / " + "console" + ret_attr['text']+=" / console" + + elif attr_name=="last_force": + if 'lastForcedBuild' in pjt_infos: + lnk=ci_url_job+pjt_infos['project_name']+"/"+str(pjt_infos['lastForcedBuild']['number']) + ret_attr['text']="build" + + lnk=ci_url+pjt_infos['lastForcedBuild']['upstreamUrl']+str(pjt_infos['lastForcedBuild']['upstreamBuild']) + ret_attr['text']+="/ bisect" + + bldname=pjt_infos['lastForcedBuild']['upstreamBuildName'] + if re.match(r'.*spurious|.*baseline', bldname): + bldname=re.sub("#([0-9]*)-(.*)-(.*)", r'\2-\3', bldname) + ret_attr['text']+=" / "+bldname + else: + compon=re.sub("#([0-9]*)-(.*)-(.*)", r'\2', bldname) + sha1=re.sub("#([0-9]*)-(.*)-(.*)", r'\3', bldname) + + lnk="https://git.linaro.org/toolchain/ci/interesting-commits.git/tree/%s/sha1/%s"%(compon, sha1) + ret_attr['text']+=" / regression" elif attr_name=="result_file": lnk=ci_url_job+pjt_infos['project_name']+"/"+str(pjt_infos['lastCompletedBuild']['number'])+"/artifact/artifacts/results/*view*/" diff --git a/developer_dashboard_generate/TCWG-for-ci.yaml b/developer_dashboard_generate/TCWG-for-ci.yaml index 7ac9dd9..e588c1c 100644 --- a/developer_dashboard_generate/TCWG-for-ci.yaml +++ b/developer_dashboard_generate/TCWG-for-ci.yaml @@ -33,6 +33,7 @@ format: - since_last_force - nb_force - useful_links + - last_force lines: - "@pattern@.*-build" diff --git a/developer_dashboard_generate/TCWG-for-devs.yaml b/developer_dashboard_generate/TCWG-for-devs.yaml index cf7c6b0..447ea0d 100644 --- a/developer_dashboard_generate/TCWG-for-devs.yaml +++ b/developer_dashboard_generate/TCWG-for-devs.yaml @@ -7,9 +7,9 @@ format: - nb_success - nb_failure - nb_forced - - nb_reducing - - nb_bisected - - nb_aborted + + + lines: - any-date - day-6 @@ -33,6 +33,7 @@ format: - since_last_force - useful_links + - last_force lines: - "@pattern@.*-build" diff --git a/developer_dashboard_generate/v1-test.yaml b/developer_dashboard_generate/v1-test.yaml index 81902e9..431f4af 100644 --- a/developer_dashboard_generate/v1-test.yaml +++ b/developer_dashboard_generate/v1-test.yaml @@ -6,13 +6,12 @@ format: - timelaps - nb_success - nb_failure + - nb_forced - nb_reducing - nb_bisected - - nb_forced - nb_aborted lines: - - all_projects - - last-7-days + - any-date - day-6 - day-5 - day-4 @@ -29,11 +28,13 @@ format: - project - status - since_last_build + - since_last_success - since_last_fail - since_last_force - nb_force - useful_links - - last_title + - last_force + lines: - "@pattern@.*-build" @@ -45,11 +46,4 @@ pattern: - tcwg_bmk-code_speed - tcwg_bmk-code_speed-coremark - tcwg_bmk-code_speed-spec2k6 - - tcwg_bmk-fujitsu_speed - - tcwg_bmk-fujitsu_speed-cpu2017rate - - tcwg_bmk-sve_speed - - tcwg_bmk-sve_speed-cpu2017rate - - tcwg_bmk-vect_speed - - tcwg_bmk-vect_speed-cpu2017 - - tcwg_bmk-vect_speed-spec2k6 -- cgit v1.2.3