From 323c0efceddad42ed939d9f66d14338cf15dd686 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Mon, 11 May 2015 15:45:11 +0200 Subject: reproducible: split notes and no_notes pages into suite specific ones --- bin/reproducible_common.py | 4 ++-- bin/reproducible_common.sh | 2 +- bin/reproducible_html_indexes.py | 16 +++++++++------- 3 files changed, 12 insertions(+), 10 deletions(-) (limited to 'bin') diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py index 6dedc05a..b937d72f 100755 --- a/bin/reproducible_common.py +++ b/bin/reproducible_common.py @@ -155,8 +155,8 @@ html_head_page = Template((tab*2).join("""
  • issues
  • -
  • packages with notes
  • -
  • package without notes
  • +
  • packages with notes
  • +
  • packages without notes
  • currently scheduled
  • $links
  • repositories overview
  • diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh index d40c1a82..5ffc22f2 100755 --- a/bin/reproducible_common.sh +++ b/bin/reproducible_common.sh @@ -160,7 +160,7 @@ write_page_header() { 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 repositories stats" - GLOBALVIEWS="issues notes no_notes scheduled repositories stats" + GLOBALVIEWS="issues scheduled repositories 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 0d86db9e..1810877c 100755 --- a/bin/reproducible_html_indexes.py +++ b/bin/reproducible_html_indexes.py @@ -40,6 +40,7 @@ Reference doc for the folowing lists: - the query also takes the value "status" - if "nosuite" is True, then suite and arch are meant to be the default values specified in _common.py, and they will not iterate over the suites + + notes: if true the query also takes the value "status" Technically speaking, a page can be empty (we all love nonsense) but every section must have at least a `query` defining what to file in. @@ -254,10 +255,10 @@ pages = { ] }, 'notes': { - 'global': True, + 'notes': True, 'title': 'Packages with notes', - 'header': '

    There are {tot} packages with notes.

    ', - 'header_query': 'SELECT count(*) FROM (SELECT * FROM sources AS s JOIN notes AS n ON n.package_id=s.id GROUP BY s.name) AS tmp', + 'header': '

    There are {tot} packages with notes in {suite}/{arch}.

    ', + 'header_query': 'SELECT count(*) FROM (SELECT * FROM sources AS s JOIN notes AS n ON n.package_id=s.id WHERE s.suite="{suite}" AND s.architecture="{arch}" GROUP BY s.name) AS tmp', 'body': [ { 'icon_status': 'FTBR', @@ -302,10 +303,10 @@ pages = { ] }, 'no_notes': { - 'global': True, + 'notes': True, 'title': 'Packages without notes', - 'header': '

    There are {tot} faulty packages without notes, in all suites. These are the packages with failures that still need to be investigated.

    ', - 'header_query': 'SELECT COUNT(*) FROM (SELECT s.id FROM sources AS s JOIN results AS r ON r.package_id=s.id WHERE r.status IN ("unreproducible", "FTBFS", "blacklisted") AND s.id NOT IN (SELECT package_id FROM notes))', + 'header': '

    There are {tot} faulty packages without notes in {suite}/{arch}. These are the packages with failures that still need to be investigated.

    ', + 'header_query': 'SELECT COUNT(*) FROM (SELECT s.id FROM sources AS s JOIN results AS r ON r.package_id=s.id WHERE r.status IN ("unreproducible", "FTBFS", "blacklisted") AND s.id NOT IN (SELECT package_id FROM notes) AND s.suite="{suite}" AND s.architecture="{arch}")', 'body': [ { 'icon_status': 'FTBR', @@ -375,6 +376,7 @@ def build_page_section(page, section, suite, arch): if pages[page].get('global') and pages[page]['global']: suite = defaultsuite if not suite else suite arch = defaultarch if not arch else arch + if pages[page].get('notes') and pages[page]['notes']: query = queries[section['query']].format( status=section['db_status'], suite=suite, arch=arch) else: @@ -423,7 +425,7 @@ def build_page(page, suite=None, arch=None): if pages[page].get('header'): if pages[page].get('header_query'): html += pages[page]['header'].format( - tot=query_db(pages[page]['header_query'])[0][0]) + tot=query_db(pages[page]['header_query'].format(suite=suite, arch=arch))[0][0], suite=suite, arch=arch) else: html += pages[page].get('header') for section in page_sections: -- cgit v1.2.3-70-g09d2