diff options
Diffstat (limited to 'developer_dashboard_generate.py')
-rwxr-xr-x | developer_dashboard_generate.py | 45 |
1 files changed, 41 insertions, 4 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']="<a href="+lnk+">res</a>" lnk=ci_url_job+pjt_infos['project_name']+"/"+str(pjt_infos['lastCompletedBuild']['number'])+"/console" - ret_attr['text']=ret_attr['text'] + " / " + "<a href="+lnk+">console</a>" + ret_attr['text']+=" / <a href="+lnk+">console</a>" + + 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']="<a href="+lnk+">build</a>" + + lnk=ci_url+pjt_infos['lastForcedBuild']['upstreamUrl']+str(pjt_infos['lastForcedBuild']['upstreamBuild']) + ret_attr['text']+="/ <a href="+lnk+">bisect</a>" + + 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']+=" / <a href="+lnk+">regression</a>" elif attr_name=="result_file": lnk=ci_url_job+pjt_infos['project_name']+"/"+str(pjt_infos['lastCompletedBuild']['number'])+"/artifact/artifacts/results/*view*/" |