From 4e0555f5806d57a5ec244a5d84d82597d5e17e56 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sun, 29 May 2016 17:10:34 +0200 Subject: reproducible debian: create page with oldest logs --- bin/reproducible_html_dashboard.sh | 6 +++++- bin/reproducible_html_live_status.py | 35 +++++++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/bin/reproducible_html_dashboard.sh b/bin/reproducible_html_dashboard.sh index 0897f643..acb3b6ad 100755 --- a/bin/reproducible_html_dashboard.sh +++ b/bin/reproducible_html_dashboard.sh @@ -591,7 +591,11 @@ create_performance_page() { write_page "

" done # the end - write_page "Daily individual build node performance stats are available too.

" + write_page "Daily individual build node performance stats are available as well as views of oldest results for" + for ARCH in ${ARCHS} ; do + write_page " $ARCH" + done + write_page ".

" write_page_footer publish_page } diff --git a/bin/reproducible_html_live_status.py b/bin/reproducible_html_live_status.py index 07224d95..2fe6b6b9 100755 --- a/bin/reproducible_html_live_status.py +++ b/bin/reproducible_html_live_status.py @@ -1,7 +1,7 @@ #!/usr/bin/python3 # -*- coding: utf-8 -*- # -# Copyright © 2015 Holger Levsen +# Copyright © 2015-2016 Holger Levsen # based on ~jenkins.d.n:~mattia/status.sh by Mattia Rizzolo # Licensed under GPL-2 # @@ -37,7 +37,7 @@ def generate_schedule(arch): html += generate_live_status_table(arch) html += '

\n' + tab html += '' - html += 'n' + html += '\n' bugs = get_bugs() for row in rows: # 0: date_scheduled, 1: suite, 2: arch, 3: pkg name 4: previous status 5: previous build duration 6. avg build duration @@ -95,7 +95,38 @@ def generate_live_status_table(arch): html += '
#scheduled atsuitearchsource packageprevious build statusprevious build durationaverage build duration
archsource packageprevious build statusprevious build durationaverage build duration

\n' return html +def generate_oldies(arch): + log.info('Building the oldies page for ' + arch + '...') + title = 'Oldest results on ' + arch + html = '' + for suite in SUITES: + query = 'SELECT s.suite, s.architecture, s.name, r.status, r.build_date ' + \ + 'FROM results AS r JOIN sources AS s ON r.package_id=s.id ' + \ + 'WHERE s.suite="{suite}" AND s.architecture="{arch}" ' + \ + 'AND r.status != "blacklisted" ' + \ + 'ORDER BY r.build_date LIMIT 15' + text = Template('Oldest results on $suite/$arch:') + rows = query_db(query.format(arch=arch,suite=suite)) + html += build_leading_text_section({'text': text}, rows, suite, arch) + html += '

\n' + tab + html += '' + html += '\n' + bugs = get_bugs() + for row in rows: + # 0: suite, 1: arch, 2: pkg name 3: status 4: build date + pkg = row[2] + html += tab + '' + html += '\n' + html += '
#suitearchsource packagestatusbuild date
 ' + row[0] + '' + row[1] + '' + html += link_package(pkg, row[0], row[1], bugs) + html += ''+convert_into_status_html(str(row[3]))+'' + row[4] + '

\n' + destfile = BASE + '/index_' + arch + '_oldies.html' + desturl = REPRODUCIBLE_URL + '/index_' + arch + '_oldies.html' + write_html_page(title=title, body=html, destfile=destfile, arch=arch, style_note=True, refresh_every=60) + log.info("Page generated at " + desturl) + if __name__ == '__main__': for arch in ARCHS: generate_schedule(arch) + generate_oldies(arch) -- cgit v1.2.3-70-g09d2