From 7f518f0753a9d323c516aa785af8d2311b0fd224 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sat, 28 Mar 2015 00:24:45 +0100 Subject: reproducible: provide suite specific views on issues --- bin/reproducible_common.sh | 3 ++- bin/reproducible_html_notes.py | 52 ++++++++++++++++++++++++++++-------------- 2 files changed, 37 insertions(+), 18 deletions(-) (limited to 'bin') diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh index 30c4dcb0..777c0a67 100755 --- a/bin/reproducible_common.sh +++ b/bin/reproducible_common.sh @@ -54,11 +54,12 @@ declare -A LINKTARGET NOTES_PATH=/var/lib/jenkins/userContent/notes ISSUES_PATH=/var/lib/jenkins/userContent/issues RB_PATH=/var/lib/jenkins/userContent/rb-pkg/ -mkdir -p $NOTES_PATH $ISSUES_PATH $RB_PATH +mkdir -p $NOTES_PATH $RB_PATH # create subdirs for suites for i in $SUITES ; do mkdir -p /var/lib/jenkins/userContent/$i + mkdir -p $ISSUES_PATH/$i done # known package sets diff --git a/bin/reproducible_html_notes.py b/bin/reproducible_html_notes.py index e1b98818..c68694e4 100755 --- a/bin/reproducible_html_notes.py +++ b/bin/reproducible_html_notes.py @@ -120,6 +120,14 @@ issue_html = Template((tab*3).join(""" $issue + + + + Suites: + + + $suite_links + $urls @@ -132,7 +140,7 @@ issue_html = Template((tab*3).join(""" - Packages known to be affected by this issue: + Packages in '$suite' known to be affected by this issue: $affected_pkgs @@ -238,12 +246,21 @@ def gen_html_note(package, note): return note_html.substitute(version='N/A', infos=infos) -def gen_html_issue(issue): +def gen_html_issue(issue, suite): """ Given a issue as input (as a dict: {"issue_identifier": {"description": "blablabla", "url": "blabla"}} ) it returns the html body """ + # links to the issue in other suites + suite_links = '' + for i in SUITES: + if suite_links != '': + suite_links += ' / ' + if i != suite: + suite_links += '' + i + '' + else: + suite_links += '' + i + '' # check for url: if 'url' in issues[issue]: url = issue_html_url.substitute(url=issues[issue]['url']) @@ -252,7 +269,6 @@ def gen_html_issue(issue): # add affected packages: affected = '' try: - suite = 'unstable' arch = 'amd64' for status in ['unreproducible', 'FTBFS', 'not for us', 'blacklisted', 'reproducible']: pkgs = [x[0] for x in all_pkgs if x[1] == status and x[2] == suite and x[3] == arch and x[0] in issues_count[issue]] @@ -280,7 +296,8 @@ def gen_html_issue(issue): desc = url2html.sub(r'\1', desc) desc = desc.replace('\n', '
') return issue_html.substitute(issue=issue, urls=url, description=desc, - affected_pkgs=affected) + affected_pkgs=affected, + suite=suite, suite_links=suite_links) def purge_old_notes(notes): removed_pages = [] @@ -330,19 +347,20 @@ def iterate_over_notes(notes): def iterate_over_issues(issues): num_issues = str(len(issues)) i = 0 - for issue in sorted(issues): - log.debug('iterating over issues... ' + str(i) + '/' + num_issues) - log.debug('\t' + str(issue)) - html = gen_html_issue(issue) - - title = 'Notes about issue ' + issue - destfile = ISSUES_PATH + '/' + issue + '_issue.html' - write_html_page(title=title, body=html, destfile=destfile, - style_note=True) - - desturl = REPRODUCIBLE_URL + ISSUES_URI + '/' + issue + '_issue.html' - log.info("Issue created: " + desturl) - i = i + 1 + for suite in SUITES: + for issue in sorted(issues): + log.debug('iterating over issues in ' + suite +'... ' + str(i) + '/' + num_issues) + log.debug('\t' + str(issue)) + html = gen_html_issue(issue, suite) + + title = 'Notes about issue ' + issue + ' in ' + suite + destfile = ISSUES_PATH + '/' + suite + '/' + issue + '_issue.html' + write_html_page(title=title, body=html, destfile=destfile, + style_note=True) + + desturl = REPRODUCIBLE_URL + ISSUES_URI + '/' + suite + '/' + issue + '_issue.html' + log.info("Issue created: " + desturl) + i = i + 1 def sort_issues(issue): -- cgit v1.2.3-70-g09d2