diff options
author | 2016-02-12 23:41:24 +0100 | |
---|---|---|
committer | 2016-02-12 23:41:24 +0100 | |
commit | fb308a94d6fd8690d3e82f8fe833bbe93791ec39 (patch) | |
tree | 0e76a14596d6bb6b60de25bc64697ebeb4ebf738 | |
parent | update buildinfo to packages typo fix (diff) | |
download | tinderbox-cluster-www-fb308a94d6fd8690d3e82f8fe833bbe93791ec39.tar.gz tinderbox-cluster-www-fb308a94d6fd8690d3e82f8fe833bbe93791ec39.tar.bz2 tinderbox-cluster-www-fb308a94d6fd8690d3e82f8fe833bbe93791ec39.zip |
redo the add buildinfo to packages
-rw-r--r-- | python/tbc_www/views.py | 114 | ||||
-rw-r--r-- | python/templates/includes/frontpage/new_logs | 26 | ||||
-rw-r--r-- | python/templates/pages/new/logs/build/index.html | 28 | ||||
-rw-r--r-- | python/templates/pages/packages/category/index.html | 13 | ||||
-rw-r--r-- | python/templates/pages/packages/ebuilds/ebuild/index.html | 39 | ||||
-rw-r--r-- | python/templates/pages/packages/ebuilds/index.html | 5 |
6 files changed, 136 insertions, 89 deletions
diff --git a/python/tbc_www/views.py b/python/tbc_www/views.py index c1124ff..b47cd88 100644 --- a/python/tbc_www/views.py +++ b/python/tbc_www/views.py @@ -44,20 +44,7 @@ def home(request): adict2['SummeryText'] = BL.SummeryText adict2['Fail'] = BL.Fail if BL.Fail: - 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 + adict2['BE_tmp'] = BuildLogsErrors.objects.filter(BuildLogId = BL.BuildLogId) alist.append(adict2) TmpDict['BL'] = alist adict = {} @@ -121,24 +108,28 @@ def packages(request, category_id): adict['Package'] = PM.PackageId.Package adict['Descriptions'] = PM.Descriptions adict['Commitlog'] =PM.Gitlog + adict['Repoman'] = False + adict['Qa'] = False + adict['Bl'] = False + adict['Blo'] = False + adict['Blb'] = False PR = PackagesRepoman.objects.filter(PackageId__PackageId = PM.PackageId.PackageId) if PR.exists(): adict['Repoman'] = True - else: - adict['Repoman'] = False BLQ = BuildLogsQa.objects.filter(BuildLogId__EbuildId__PackageId__PackageId = PM.PackageId.PackageId).filter(BuildLogId__EbuildId__Active = True) if BLQ.exists(): adict['Qa'] = True - else: - adict['Qa'] = False - BL = BuildLogs.objects.filter(EbuildId__PackageId__PackageId = PM.PackageId.PackageId).filter(EbuildId__Active = True) - if BL.exists(): + BL_tmp = BuildLogs.objects.filter(EbuildId__PackageId__PackageId = PM.PackageId.PackageId).filter(EbuildId__Active = True) + if BL_tmp.exists(): adict['Bl'] = True - adict['Blf'] = False - if BL.filter(Fail = True).exists(): - adict['Blf'] = True - else: - adict['Bl'] = False + if BL_tmp.filter(Fail = True).exists(): + for BL in BL_tmp: + BE_tmp = BuildLogsErrors.objects.filter(BuildLogId = BL.BuildLogId) + for BE in BE_tmp: + if BE.ErrorId.ErrorId == 3: + adict['Blo'] = True + if BE.ErrorId.ErrorId >= 4: + adict['Blb'] = True ebuilds = [] for E in Ebuilds.objects.filter(Active = True).filter(PackageId__Package = PM.PackageId.Package): ebuilds.append(E.Version + '::' + E.PackageId.RepoId.Repo + '\n') @@ -181,8 +172,17 @@ def ebuilds(request, package_id): adict = {} adict['EbuildId'] = EM.EbuildId.EbuildId adict['fail'] = False + adict['Blo'] = False + adict['Blb'] = False if BLe.filter(Fail = True).exists(): adict['fail'] = True + for BL in BLe: + BE_tmp = BuildLogsErrors.objects.filter(BuildLogId = BL.BuildLogId) + for BE in BE_tmp: + if BE.ErrorId.ErrorId == 3: + adict['Blo'] = True + if BE.ErrorId.ErrorId >= 4: + adict['Blb'] = True adict['repoman'] = False BLRe = BuildLogsRepoman.objects.filter(BuildLogId__EbuildId__EbuildId = EM.EbuildId.EbuildId).filter(BuildLogId__EbuildId__Active = True) if BLRe.exists(): @@ -192,6 +192,7 @@ def ebuilds(request, package_id): if BLQe.exists(): adict['qa'] = True alist.append(adict) + print(alist) TmpDict['fi_tmp'] = alist return render(request, 'pages/' + pagerequest + '/ebuilds/index.html', TmpDict) @@ -203,12 +204,30 @@ def ebuild(request, ebuild_id): TmpDict['EK_tmp'] = EbuildsKeywords.objects.filter(EbuildId__EbuildId = ebuild_id) BL_tmp = BuildLogs.objects.filter(EbuildId__EbuildId = ebuild_id) TmpDict['BL_tmp'] = BL_tmp + alist = [] + for BL in BL_tmp: + adict = {} + adict['BuildLogId'] = BL.BuildLogId + adict['repoman'] = False + adict['qa'] = False + adict['Blo'] = False + adict['Blb'] = False + if BL.Fail: + adict['fail'] = True + BE_tmp = BuildLogsErrors.objects.filter(BuildLogId__BuildLogId = BL.BuildLogId) + for BE in BE_tmp: + if BE.ErrorId.ErrorId == 1: + adict['repoman'] = True + if BE.ErrorId.ErrorId == 2: + adict['qa'] = True + if BE.ErrorId.ErrorId == 3: + adict['Blo'] = True + if BE.ErrorId.ErrorId >= 4: + adict['Blb'] = True + alist.append(adict) + TmpDict['fi_tmp'] = alist TmpDict['EU_tmp'] = EbuildsIuse.objects.filter(EbuildId__EbuildId = ebuild_id) TmpDict['ER_tmp'] = EbuildsRestrictions.objects.filter(EbuildId__EbuildId = ebuild_id) - BLQ_tmp = BuildLogsQa.objects.filter(BuildLogId__EbuildId__EbuildId = ebuild_id).filter(BuildLogId__EbuildId__Active = True) - TmpDict['BLQ_tmp'] = BLQ_tmp - BLR_tmp = BuildLogsRepoman.objects.filter(BuildLogId__EbuildId__EbuildId = ebuild_id).filter(BuildLogId__EbuildId__Active = True) - TmpDict['BLR_tmp']= BLR_tmp return render(request, 'pages/' + pagerequest + '/ebuilds/ebuild/index.html', TmpDict) @@ -226,22 +245,13 @@ def new_main(request): adict2['V'] = BL.EbuildId.Version adict2['R'] = BL.EbuildId.PackageId.RepoId.Repo adict2['Fail'] = BL.Fail + adict2['FailB'] = False adict2['SummeryText'] = BL.SummeryText if BL.Fail: - 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 + adict2['BE_tmp'] = BuildLogsErrors.objects.filter(BuildLogId = BL.BuildLogId) + for BE in adict2['BE_tmp']: + if BE.ErrorId.ErrorId >= 3: + adict2['FailB'] = True alist.append(adict2) TmpDict['BL'] = alist adict = {} @@ -329,8 +339,6 @@ def new_logs_build(request, buildlog_id): BLI['PD'] = EM.Descriptions BLI['PC'] = PM.Gitlog BLI['Fail'] = B.Fail - if B.Fail: - BLI['BE_tmp'] = BuildLogsErrors.objects.filter(BuildLogId = buildlog_id) BLI['Summery_text'] = B.SummeryText if B.BugId == "0": BLI['BugId'] = False @@ -362,6 +370,22 @@ def new_logs_build(request, buildlog_id): BLI['use_enable'] = use_enable if not use_disable == []: BLI['use_disable'] = use_disable + adict = {} + adict['repoman'] = False + adict['qa'] = False + adict['Blo'] = False + adict['Blb'] = False + BE_tmp = BuildLogsErrors.objects.filter(BuildLogId__BuildLogId = buildlog_id) + for BE in BE_tmp: + if BE.ErrorId.ErrorId == 1: + adict['repoman'] = True + if BE.ErrorId.ErrorId == 2: + adict['qa'] = True + if BE.ErrorId.ErrorId == 3: + adict['Blo'] = True + if BE.ErrorId.ErrorId >= 4: + adict['Blb'] = True + TmpDict['FI'] = adict try: BRQ = BuildLogsQa.objects.get(BuildLogId = B.BuildLogId) BLI['QA'] = BRQ.SummeryText diff --git a/python/templates/includes/frontpage/new_logs b/python/templates/includes/frontpage/new_logs index 1acbbc2..bb97536 100644 --- a/python/templates/includes/frontpage/new_logs +++ b/python/templates/includes/frontpage/new_logs @@ -6,19 +6,23 @@ <td><p title="{{ B.SummeryText }}">{{ B.SummeryText|truncatewords:3 }}</p> <td class="text-right"> {% if B.Fail %} - {% if B.FailCode == 'OTHERS' %} - <span class="label label-info">{{ B.FailCode }}</span> - {% else %} - <span class="label label-danger">{{ B.FailCode }}</span> + {% 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> + {% endif %} + {% if BE.ErrorId.ErrorId == 3 %} + <span class="label label-info">{{ BE.ErrorId.ErrorName|upper }}</span> + {% elif BE.ErrorId.ErrorId > 3 %} + <span class="label label-danger">{{ BE.ErrorId.ErrorName|upper }}</span> + {% endif %} + {% endif %} + {% endfor %} + {% if not B.FailB %} + <span class="label label-success">BUILD</span> {% endif %} {% else %} - <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> + <span class="label label-success">Ok</span> {% endif %} </td> </td> diff --git a/python/templates/pages/new/logs/build/index.html b/python/templates/pages/new/logs/build/index.html index 5c2a9b6..a79e54a 100644 --- a/python/templates/pages/new/logs/build/index.html +++ b/python/templates/pages/new/logs/build/index.html @@ -2,20 +2,24 @@ {% block content %} <div class="row"> <h2>{{ BLI.C }}/{{ BLI.P }}-{{ BLI.V }}::{{ BLI.R }} - {% if BLI.Fail %} - {% for BE in BLI.BE_tmp %} - {% if BE.ErrorId.ErrorId == 1 %} - <span class="label label-warning">{{ BE.ErrorId.ErrorName|upper }}</span> - {% elif 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> + {% if FI.Blo %} + <span class="label label-info">Others</span> + {% else %} + {% if FI.qa %} + <span class="label label-warning">Qa</span> {% else %} - <span class="label label-danger">{{ BE.ErrorId.ErrorName|upper }}</span> + <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.Blb %} + <span class="label label-danger">Build</span> + {% else %} + <span class="label label-success">Build</span> {% endif %} - {% endfor %} - {% else %} - <span class="label label-success">OK</span> {% endif %} </h2> </div> diff --git a/python/templates/pages/packages/category/index.html b/python/templates/pages/packages/category/index.html index d86b3cb..c6903f0 100644 --- a/python/templates/pages/packages/category/index.html +++ b/python/templates/pages/packages/category/index.html @@ -16,16 +16,19 @@ {% if PM.Repoman %} <a class="btn btn-warning btn-xs" href="/repoman/{{PM.PackageId }}/">Repoman</a> {% endif %} - {% if PM.Qa %} - <a class="btn btn-warning btn-xs" >Qa</a> - {% endif %} {% if PM.Bl %} - {% if PM.Blf %} + {% if PM.Qa %} + <a class="btn btn-warning btn-xs" >Qa</a> + {% endif %} + {% if PM.Blo %} + <a class="btn btn-info btn-xs">Others</a> + {% endif %} + {% if PM.Blb %} <a class="btn btn-danger btn-xs"> {% else %} <a class="btn btn-success btn-xs"> {% endif %} - Build</a> + Build</a> {% endif %} </p> </td> diff --git a/python/templates/pages/packages/ebuilds/ebuild/index.html b/python/templates/pages/packages/ebuilds/ebuild/index.html index 6f2166a..49ad3e5 100644 --- a/python/templates/pages/packages/ebuilds/ebuild/index.html +++ b/python/templates/pages/packages/ebuilds/ebuild/index.html @@ -41,21 +41,30 @@ {% for BL in BL_tmp %} <tr> <td class="frontpage-table-package-atom"> - {% if BL.Fail %} - <span class="label label-danger">Build</span> - {% else %} - <span class="label label-success">Build</span> - {% endif %} - {% for BLR in BLR_tmp %} - {% if BLR.BuildLogId.BuildLogId == BL.BuildLogId%} - <span class="label label-warning">Repoman</span> - {% endif %} - {% endfor %} - {% for BLQ in BLQ_tmp %} - {% if BLQ.BuildLogId.BuildLogId == BL.BuildLogId%} - <span class="label label-warning">Qa</span> - {% endif %} - {% endfor %} + {% for FI in fi_tmp %} + {% if FI.BuildLogId == BL.BuildLogId %} + {% if FI.Blo %} + <span class="label label-info">Others</span> + {% else %} + {% 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.Blb %} + <span class="label label-danger">Build</span> + {% else %} + <span class="label label-success">Build</span> + {% endif %} + {% endif %} + {% endif %} + {% endfor %} <a class="btn btn-default btn-xs" href="/new/logs/build/{{ BL.BuildLogId }}/">More info</a> </td> </tr> diff --git a/python/templates/pages/packages/ebuilds/index.html b/python/templates/pages/packages/ebuilds/index.html index 0107d0b..77bd8eb 100644 --- a/python/templates/pages/packages/ebuilds/index.html +++ b/python/templates/pages/packages/ebuilds/index.html @@ -23,7 +23,10 @@ {% else %} <span class="label label-success">Repoman</span> {% endif %} - {% if FI.fail %} + {% if FI.Blo %} + <span class="label label-info">Others</span> + {% endif %} + {% if FI.Blb %} <span class="label label-danger">Build</span> {% else %} <span class="label label-success">Build</span> |