From f5a6ff341efc9edfabe8e565e88209af582e902d Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Tue, 10 Mar 2015 01:04:23 +0100 Subject: reproducible: merge suite specific schedule pages into single global one --- bin/reproducible_common.py | 2 +- bin/reproducible_common.sh | 2 +- bin/reproducible_html_indexes.py | 45 +++++++++++++++++++++++----------------- 3 files changed, 28 insertions(+), 21 deletions(-) (limited to 'bin') diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py index 7dc0e21b..e33d24f8 100755 --- a/bin/reproducible_common.py +++ b/bin/reproducible_common.py @@ -151,6 +151,7 @@ html_head_page = Template((tab*2).join("""
  • issues
  • packages with notes
  • package without notes
  • +
  • currently scheduled
  • $links
  • repositories overview
  • reproducible stats
  • @@ -185,7 +186,6 @@ def print_critical_message(msg): def _gen_links(suite, arch): links = [ - ('scheduled', '
  • currently scheduled
  • '), ('last_24h', '
  • packages tested in the last 24h
  • '), ('last_48h', '
  • packages tested in the last 48h
  • '), ('all_abc', '
  • all tested packages (sorted alphabetically)
  • '), diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh index c096ac36..3e17d793 100755 --- a/bin/reproducible_common.sh +++ b/bin/reproducible_common.sh @@ -77,7 +77,7 @@ init_html() { MAINVIEW="stats" ALLSTATES="reproducible FTBR FTBFS 404 not_for_us blacklisted" ALLVIEWS="issues notes no_notes scheduled last_24h last_48h all_abc dd-list pkg_sets suite_stats repo_stats stats" - GLOBALVIEWS="issues notes no_notes repo_stats stats" + GLOBALVIEWS="issues notes no_notes scheduled repo_stats stats" SUITEVIEWS="dd-list suite_stats" SPOKENTARGET["issues"]="issues" SPOKENTARGET["notes"]="packages with notes" diff --git a/bin/reproducible_html_indexes.py b/bin/reproducible_html_indexes.py index d68aea9d..9230fc08 100755 --- a/bin/reproducible_html_indexes.py +++ b/bin/reproducible_html_indexes.py @@ -44,7 +44,7 @@ section must have at least a `query` defining what to file in. queries = { 'count_total': 'SELECT COUNT(*) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite="{suite}" AND s.architecture="{arch}"', - 'scheduled': 'SELECT s.name FROM schedule AS p JOIN sources AS s ON p.package_id=s.id WHERE s.suite="{suite}" AND s.architecture="{arch}" ORDER BY p.date_scheduled', + 'scheduled': 'SELECT (select count(*) from schedule as sch_b where sch.id >= sch_b.id), s.suite, s.architecture, s.name FROM schedule AS sch JOIN sources AS s ON sch.package_id=s.id WHERE sch.date_build_started = "" ORDER BY sch.date_scheduled', 'reproducible_all': 'SELECT s.name 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="reproducible" ORDER BY r.build_date DESC', 'reproducible_last24h': 'SELECT s.name 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="reproducible" AND r.build_date > datetime("now", "-24 hours") ORDER BY r.build_date DESC', 'reproducible_last48h': 'SELECT s.name 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="reproducible" AND r.build_date > datetime("now", "-48 hours") ORDER BY r.build_date DESC', @@ -126,16 +126,6 @@ pages = { } ] }, - 'scheduled': { - 'title': 'Packages in {suite}/{arch} currently scheduled for testing for build reproducibility', - 'body': [ - { - 'query': 'scheduled', - 'text': Template('$tot packages are currently scheduled for testing in $suite/$arch:'), - 'bottom': 'A full scheduling overview is also available.' - } - ] - }, 'all_abc': { 'title': 'Overview of reproducible builds in {suite}/{arch} of all tested packages (sorted alphabetically)', 'body': [ @@ -249,7 +239,7 @@ global_pages = { 'body': [ { 'query': 'scheduled', - 'text': Template('$tot packages are currently scheduled for testing in $suite/$arch:') + 'text': Template('$tot packages are currently scheduled for testing:') } ] } @@ -304,19 +294,34 @@ def build_page_section(page, section, suite, arch): if not rows and page != 'scheduled': # there are no package in this set return (html, footnote) # do not output anything on the page. html += build_leading_text_section(section, rows, suite, arch) - html += '

    \n' + tab + '\n' + if page == 'scheduled': + html += '

    \n' + tab + '\n' + else: + html += '

    \n' + tab + '\n' for row in rows: - pkg = row[0] - url = RB_PKG_URI + '/' + suite + '/' + arch + '/' + pkg + '.html' - html += tab*2 + '' + pkg + '' - html += get_trailing_icon(pkg, bugs) + '\n' - html += tab + '\n' - html += '

    ' + html += get_trailing_icon(pkg, bugs) + if page == 'scheduled': + html += '
    ' + html += '\n' + if page == 'scheduled': + html += '
    #suitearchpackage

    \n' + else: + html += tab + '\n' + html += '

    ' if section.get('bottom'): html += section['bottom'] html = (tab*2).join(html.splitlines(True)) @@ -344,6 +349,8 @@ def build_page(page, suite=None, arch=None): for lsuite in SUITES: for larch in ARCHES: html += build_page_section(page, section, lsuite, larch)[0] + if page == 'scheduled': + break footnote = True else: html1, footnote1 = build_page_section(page, section, suite, arch) -- cgit v1.2.3-54-g00ecf