summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Granberg <zorry@gentoo.org>2016-02-03 23:47:23 +0100
committerMagnus Granberg <zorry@gentoo.org>2016-02-03 23:47:23 +0100
commitc89b5d183a329b65306d22d6e994d5cbd0d00353 (patch)
tree45f653ef34a989c879412c1fadb68a3e01b669fe
parentadd buildinfo to packages (diff)
downloadtinderbox-cluster-www-c89b5d183a329b65306d22d6e994d5cbd0d00353.tar.gz
tinderbox-cluster-www-c89b5d183a329b65306d22d6e994d5cbd0d00353.tar.bz2
tinderbox-cluster-www-c89b5d183a329b65306d22d6e994d5cbd0d00353.zip
update buildinfo to packages
-rw-r--r--python/tbc_www/views.py65
-rw-r--r--python/templates/includes/frontpage/new_logs24
-rw-r--r--python/templates/pages/packages/ebuilds/ebuild/index.html4
-rw-r--r--python/templates/pages/packages/ebuilds/index.html12
4 files changed, 70 insertions, 35 deletions
diff --git a/python/tbc_www/views.py b/python/tbc_www/views.py
index 29fb520..e5b92a0 100644
--- a/python/tbc_www/views.py
+++ b/python/tbc_www/views.py
@@ -32,7 +32,7 @@ def home(request):
pagerequest = 'home'
Lines = 10
TmpDict = default_TmpDict(pagerequest)
- TmpDict['EM'] = EbuildsMetadata.objects.filter(New = True).order_by('-Id')[:Lines]
+ TmpDict['EM'] = EbuildsMetadata.objects.order_by('-Id')[:Lines]
alist = []
for BL in BuildLogs.objects.order_by('-TimeStamp')[:Lines]:
adict2 = {}
@@ -41,10 +41,23 @@ def home(request):
adict2['P'] = BL.EbuildId.PackageId.Package
adict2['V'] = BL.EbuildId.Version
adict2['R'] = BL.EbuildId.PackageId.RepoId.Repo
- adict2['Fail'] = BL.Fail
adict2['SummeryText'] = BL.SummeryText
+ adict2['Fail'] = BL.Fail
if BL.Fail:
- adict2['BE_tmp'] = BuildLogsErrors.objects.filter(BuildLogId = BL.BuildLogId)
+ BE_tmp = BuildLogsErrors.objects.filter(BuildLogId = BL.BuildLogId)
+ for BE in BE_tmp:
+ if BE.ErrorId.ErrorId == 3:
+ adict2['FailCode'] = 'OTHERS'
+ if BE.ErrorId.ErrorId >= 4:
+ adict2['FailCode'] = BE.ErrorId.ErrorName
+ adict2['Repoman'] = False
+ BLRe = BuildLogsRepoman.objects.filter(BuildLogId = BL.BuildLogId)
+ if BLRe.exists():
+ adict2['Repoman'] = True
+ adict2['Qa'] = False
+ BLQe = BuildLogsQa.objects.filter(BuildLogId = BL.BuildLogId)
+ if BLQe.exists():
+ adict2['Qa'] = True
alist.append(adict2)
TmpDict['BL'] = alist
adict = {}
@@ -163,21 +176,22 @@ def ebuilds(request, package_id):
TmpDict['Bl'] = False
alist = []
for EM in TmpDict['EM_tmp']:
- adict = {}
- adict['EbuildId'] = EM.EbuildId.EbuildId
- adict['fail'] = False
BLe = BuildLogs.objects.filter(EbuildId__EbuildId = EM.EbuildId.EbuildId).filter(EbuildId__Active = True)
- if BLe.filter(Fail = True).exists():
- adict['fail'] = True
- adict['repoman'] = False
- BLRe = BuildLogsRepoman.objects.filter(BuildLogId__EbuildId__EbuildId = EM.EbuildId.EbuildId).filter(BuildLogId__EbuildId__Active = True)
- if BLRe.exists():
- adict['repoman'] = True
- adict['qa'] = False
- BLQe = BuildLogsQa.objects.filter(BuildLogId__EbuildId__EbuildId = EM.EbuildId.EbuildId).filter(BuildLogId__EbuildId__Active = True)
- if BLQe.exists():
- adict['qa'] = True
- alist.append(adict)
+ if BLe.exists():
+ adict = {}
+ adict['EbuildId'] = EM.EbuildId.EbuildId
+ adict['fail'] = False
+ if BLe.filter(Fail = True).exists():
+ adict['fail'] = True
+ adict['repoman'] = False
+ BLRe = BuildLogsRepoman.objects.filter(BuildLogId__EbuildId__EbuildId = EM.EbuildId.EbuildId).filter(BuildLogId__EbuildId__Active = True)
+ if BLRe.exists():
+ adict['repoman'] = True
+ adict['qa'] = False
+ BLQe = BuildLogsQa.objects.filter(BuildLogId__EbuildId__EbuildId = EM.EbuildId.EbuildId).filter(BuildLogId__EbuildId__Active = True)
+ if BLQe.exists():
+ adict['qa'] = True
+ alist.append(adict)
TmpDict['fi_tmp'] = alist
return render(request, 'pages/' + pagerequest + '/ebuilds/index.html', TmpDict)
@@ -202,7 +216,7 @@ def new_main(request):
pagerequest = 'new'
Lines = 30
TmpDict = default_TmpDict(pagerequest)
- TmpDict['EM'] = EbuildsMetadata.objects.filter(New = True).order_by('-Id')[:Lines]
+ TmpDict['EM'] = EbuildsMetadata.objects.order_by('-Id')[:Lines]
alist = []
for BL in BuildLogs.objects.order_by('-TimeStamp')[:Lines]:
adict2 = {}
@@ -214,7 +228,20 @@ def new_main(request):
adict2['Fail'] = BL.Fail
adict2['SummeryText'] = BL.SummeryText
if BL.Fail:
- adict2['BE_tmp'] = BuildLogsErrors.objects.filter(BuildLogId = BL.BuildLogId)
+ BE_tmp = BuildLogsErrors.objects.filter(BuildLogId = BL.BuildLogId)
+ for BE in BE_tmp:
+ if BE.ErrorId.ErrorId == 3:
+ adict2['FailCode'] = 'OTHERS'
+ if BE.ErrorId.ErrorId >= 4:
+ adict2['FailCode'] = BE.ErrorId.Error
+ adict2['Repoman'] = False
+ BLRe = BuildLogsRepoman.objects.filter(BuildLogId = BL.BuildLogId)
+ if BLRe.exists():
+ adict2['Repoman'] = True
+ adict2['Qa'] = False
+ BLQe = BuildLogsQa.objects.filter(BuildLogId = BL.BuildLogId)
+ if BLQe.exists():
+ adict2['Qa'] = True
alist.append(adict2)
TmpDict['BL'] = alist
adict = {}
diff --git a/python/templates/includes/frontpage/new_logs b/python/templates/includes/frontpage/new_logs
index a1dd4d2..3b0310c 100644
--- a/python/templates/includes/frontpage/new_logs
+++ b/python/templates/includes/frontpage/new_logs
@@ -6,19 +6,19 @@
<td><p title="{{ B.SummeryText }}">{{ B.SummeryText|truncatewords:3 }}</p>
<td class="text-right">
{% if B.Fail %}
- {% for BE in B.BE_tmp %}
- {% if BE.BuildLogId.BuildLogId == B.BuildLogId %}
- {% if BE.ErrorId.ErrorId == 1 or BE.ErrorId.ErrorId == 2 %}
- <span class="label label-warning">{{ BE.ErrorId.ErrorName|upper }}</span>
- {% elif BE.ErrorId.ErrorId == 3 %}
- <span class="label label-info">OTHERS</span>
- {% else %}
- <span class="label label-danger">{{ BE.ErrorId.ErrorName|upper }}</span>
- {% endif %}
- {% endif %}
- {% endfor %}
+ {% if B.FailCode == 'OTHERS' %}
+ <span class="label label-info">{{ B.FailCode }}</span>
+ {% else %}
+ <span class="label label-info">{{ B.FailCode }}</span>
+ {% endif %}
{% else %}
- <span class="label label-success">OK</span>
+ <span class="label label-success">Build</span>
+ {% endif %}
+ {% if B.Repoman %}
+ <span class="label label-warning">Repoman</span>
+ {% endif %}
+ {% if B.Qa %}
+ <span class="label label-warning">Qa</span>
{% endif %}
</td>
</td>
diff --git a/python/templates/pages/packages/ebuilds/ebuild/index.html b/python/templates/pages/packages/ebuilds/ebuild/index.html
index 4752be1..6f2166a 100644
--- a/python/templates/pages/packages/ebuilds/ebuild/index.html
+++ b/python/templates/pages/packages/ebuilds/ebuild/index.html
@@ -48,12 +48,12 @@
{% endif %}
{% for BLR in BLR_tmp %}
{% if BLR.BuildLogId.BuildLogId == BL.BuildLogId%}
- <span class="label label-danger">Repoman</span>
+ <span class="label label-warning">Repoman</span>
{% endif %}
{% endfor %}
{% for BLQ in BLQ_tmp %}
{% if BLQ.BuildLogId.BuildLogId == BL.BuildLogId%}
- <span class="label label-danger">Qa</span>
+ <span class="label label-warning">Qa</span>
{% endif %}
{% endfor %}
<a class="btn btn-default btn-xs" href="/new/logs/build/{{ BL.BuildLogId }}/">More info</a>
diff --git a/python/templates/pages/packages/ebuilds/index.html b/python/templates/pages/packages/ebuilds/index.html
index a9cef7d..0107d0b 100644
--- a/python/templates/pages/packages/ebuilds/index.html
+++ b/python/templates/pages/packages/ebuilds/index.html
@@ -13,8 +13,16 @@
<td>
{% for FI in fi_tmp %}
{% if FI.EbuildId == E.EbuildId.EbuildId %}
- {% if FI.qa %}<span class="label label-warning">Qa</span>{% endif %}
- {% if FI.repoman %}<span class="label label-warning">Repoman</span>{% endif %}
+ {% if FI.qa %}
+ <span class="label label-warning">Qa</span>
+ {% else %}
+ <span class="label label-success">Qa</span>
+ {% endif %}
+ {% if FI.repoman %}
+ <span class="label label-warning">Repoman</span>
+ {% else %}
+ <span class="label label-success">Repoman</span>
+ {% endif %}
{% if FI.fail %}
<span class="label label-danger">Build</span>
{% else %}