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_html_indexes.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'bin/reproducible_html_indexes.py') 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