diff options
author | James Laska <jlaska@redhat.com> | 2011-06-07 10:03:37 -0400 |
---|---|---|
committer | James Laska <jlaska@redhat.com> | 2011-06-07 10:03:37 -0400 |
commit | db95dfce58f3ca27df7fae564f9448be3fbb7a18 (patch) | |
tree | 9ad9996b768785196c514b50bfdbe2bd1d43bc06 | |
parent | ca59d12f120ddd6eedf6425e08c3378de8507614 (diff) | |
download | scripts-db95dfce58f3ca27df7fae564f9448be3fbb7a18.tar.gz scripts-db95dfce58f3ca27df7fae564f9448be3fbb7a18.tar.xz scripts-db95dfce58f3ca27df7fae564f9448be3fbb7a18.zip |
Remove duplicate tracking code and present helpful links next to each bug for builds, updates, bugs etc...
-rwxr-xr-x | update-blocker-wiki | 107 |
1 files changed, 44 insertions, 63 deletions
diff --git a/update-blocker-wiki b/update-blocker-wiki index c367c3a..68d14f5 100755 --- a/update-blocker-wiki +++ b/update-blocker-wiki @@ -65,7 +65,7 @@ def wikitable_bugs(bugs_by_component, bugs_by_id): components = sorted(bugs_by_component.keys()) if len(components) > 0: buf = '''{| class="wikitable sortable" -! Bug !! Component !! Status !! Description +! Bug !! Component !! Status !! Description !! Links |- \n''' for component in components: @@ -73,8 +73,13 @@ def wikitable_bugs(bugs_by_component, bugs_by_id): bugs = sorted(bugs_by_component.get(component,[])) for b in bugs: b = bugs_by_id[b] - buf += '| [https://bugzilla.redhat.com/show_bug.cgi?id=%s %s] || %s || %s || %s\n' % (b.bug_id, b.bug_id, component, b.bug_status, b.short_desc) - buf += '|-\n' + buf += '| [http://bugzilla.redhat.com/show_bug.cgi?id=%s %s] || %s ' % (b.bug_id, b.bug_id, component) + buf += '|| %s || %s || ' % (b.bug_status, b.short_desc,) + buf += '[[Image:Infra-icon_koji.png|link=http://koji.fedoraproject.org/koji/search?type=package&match=glob&terms=%s|alt=Build Status]] ' % (component) + buf += '[[Image:Infra-icon_bodhi.png|link=http://admin.fedoraproject.org/updates/%s|alt=Update Status]] ' % (component) + buf += '[[Image:Infra-icon_cvssource.png|link=http://pkgs.fedoraproject.org/gitweb/?p=%s.git|alt=Package Source]] ' % (component) + buf += '[[Image:Infra-icon_bugzilla.png|link=http://admin.fedoraproject.org/pkgdb/acls/bugs/%s|alt=Bug Reports]] ' % (component) + buf += '\n|-\n' # End table row buf += '|}\n' return buf @@ -187,6 +192,9 @@ if __name__ == '__main__': if not opts.nth.isdigit(): opts.nth = bz.getbug(opts.nth).id + # Track all bug lists in a single dictionary + bugs_by_tracker = dict() + # Get a list of accepted blocker bugs if opts.verbose: print 'Querying accepted blocker bugs ...' q = {'bug_status': BUG_STATUS, @@ -194,7 +202,7 @@ if __name__ == '__main__': 'type0-0-0': 'anywords', 'field0-0-0': 'blocked'} q.update(BLOCKER_ACCEPTED) - accepted_blockers = flatten_bug_list(q) + bugs_by_tracker['accepted_blockers'] = flatten_bug_list(q) # Get a list of proposed blocker bugs if opts.verbose: print 'Querying proposed blocker bugs ...' @@ -203,7 +211,7 @@ if __name__ == '__main__': 'type0-0-0': 'anywords', 'field0-0-0': 'blocked'} q.update(BLOCKER_PROPOSED) - proposed_blockers = flatten_bug_list(q) + bugs_by_tracker['proposed_blockers'] = flatten_bug_list(q) # Get a list of accepted NTH bugs if opts.verbose: print 'Querying accepted nice-to-have bugs ...' @@ -212,7 +220,7 @@ if __name__ == '__main__': 'type0-0-0': 'anywords', 'field0-0-0': 'blocked'} q.update(NTH_ACCEPTED) - accepted_nths = flatten_bug_list(q) + bugs_by_tracker['accepted_nths'] = flatten_bug_list(q) # Get a list of proposed NTH bugs if opts.verbose: print 'Querying proposed nice-to-have bugs ...' @@ -221,55 +229,28 @@ if __name__ == '__main__': 'type0-0-0': 'anywords', 'field0-0-0': 'blocked'} q.update(NTH_PROPOSED) - proposed_nths = flatten_bug_list(q) + bugs_by_tracker['proposed_nths'] = flatten_bug_list(q) # Organize bugs for later reference if opts.verbose: print 'Organizing bugs ...' bugs_by_id = dict() - # walk accepted blockers - accepted_blocker_by_component = dict() - for b in accepted_blockers: - # Skip Tracking bugs - if 'Tracking' in b.keywords: - continue - if not accepted_blocker_by_component.has_key(b.component): - accepted_blocker_by_component[b.component] = list() - accepted_blocker_by_component[b.component].append(b.bug_id) - bugs_by_id[b.bug_id] = b - - # walk proposed blockers - proposed_blocker_by_component = dict() - for b in proposed_blockers: - # Skip Tracking bugs - if 'Tracking' in b.keywords: - continue - if not proposed_blocker_by_component.has_key(b.component): - proposed_blocker_by_component[b.component] = list() - proposed_blocker_by_component[b.component].append(b.bug_id) - bugs_by_id[b.bug_id] = b - - # walk accepted nths - accepted_nth_by_component = dict() - for b in accepted_nths: - # Skip Tracking bugs - if 'Tracking' in b.keywords: - continue - if not accepted_nth_by_component.has_key(b.component): - accepted_nth_by_component[b.component] = list() - accepted_nth_by_component[b.component].append(b.bug_id) - bugs_by_id[b.bug_id] = b - - # walk proposed nths - proposed_nth_by_component = dict() - for b in proposed_nths: - # Skip Tracking bugs - if 'Tracking' in b.keywords: - continue - if not proposed_nth_by_component.has_key(b.component): - proposed_nth_by_component[b.component] = list() - proposed_nth_by_component[b.component].append(b.bug_id) - bugs_by_id[b.bug_id] = b + bugs_by_component = dict() + for tracker, blocker_bugs in bugs_by_tracker.items(): + bugs_by_component[tracker] = dict() + for b in blocker_bugs: + # Skip Tracking bugs + if 'Tracking' in b.keywords: + continue + # Convert component(s) from list to string + if isinstance(b.component, list): + b.component = ','.join(b.component) + # Organize by component + if not bugs_by_component[tracker].has_key(b.component): + bugs_by_component[tracker][b.component] = list() + bugs_by_component[tracker][b.component].append(b.bug_id) + # Remember this bug id in the master list of bugs + bugs_by_id[b.bug_id] = b # Generate page content page_content = ''' @@ -280,7 +261,7 @@ if __name__ == '__main__': # Display hotdog if requested, or if no blockers (approved or proposed) exist if opts.hotdog or \ - (not accepted_blocker_by_component and not proposed_blocker_by_component): + (not bugs_by_component['accepted_blockers'] and not bugs_by_component['proposed_blockers']): page_content += '[[File:Hotdog.gif|right]]' # Otherwise, display release logo else: @@ -300,10 +281,10 @@ if __name__ == '__main__': The following list of bugs are approved blockers that must be resolved. There {{plural:%(bug_count)s|is|are}} %(bug_count)s bug{{plural:%(bug_count)s||s}} affecting %(component_count)s component{{plural:%(component_count)s||s}}. -''' % dict (bug_count=len(join_lists(accepted_blocker_by_component.values())), - component_count=len(accepted_blocker_by_component)) +''' % dict (bug_count=len(join_lists(bugs_by_component['accepted_blockers'].values())), + component_count=len(bugs_by_component['accepted_blockers'])) # Sorted list of approved bugs - page_content += wikitable_bugs(accepted_blocker_by_component, bugs_by_id) + page_content += wikitable_bugs(bugs_by_component['accepted_blockers'], bugs_by_id) # Display proposed blockers page_content += ''' @@ -313,10 +294,10 @@ The following list of bugs are not yet approved to block the release. There affecting %(component_count)s component{{plural:%(component_count)s||s}}. For guidance on reviewing the following bugs, refer to [[QA:SOP_blocker_bug_process]]. -''' % dict (bug_count=len(join_lists(proposed_blocker_by_component.values())), - component_count=len(proposed_blocker_by_component)) +''' % dict (bug_count=len(join_lists(bugs_by_component['proposed_blockers'].values())), + component_count=len(bugs_by_component['proposed_blockers'])) # Sorted list of proposed bugs - page_content += wikitable_bugs(proposed_blocker_by_component, bugs_by_id) + page_content += wikitable_bugs(bugs_by_component['proposed_blockers'], bugs_by_id) # Display approved nths page_content += ''' @@ -325,11 +306,11 @@ The following list of of bugs are approved nice-to-have. Fixes for nice-to-have bugs will be accepted during the freeze. There {{plural:%(bug_count)s|is|are}} %(bug_count)s bug{{plural:%(bug_count)s||s}} affecting %(component_count)s component{{plural:%(component_count)s||s}}. -''' % dict (bug_count=len(join_lists(accepted_nth_by_component.values())), - component_count=len(accepted_nth_by_component)) +''' % dict (bug_count=len(join_lists(bugs_by_component['accepted_nths'].values())), + component_count=len(bugs_by_component['accepted_nths'])) # Sorted list of approved bugs - page_content += wikitable_bugs(accepted_nth_by_component, bugs_by_id) + page_content += wikitable_bugs(bugs_by_component['accepted_nths'], bugs_by_id) # Display proposed nths page_content += ''' @@ -339,11 +320,11 @@ fixes for approved nice-to-have bugs will be accepted during the freeze. There {{plural:%(bug_count)s|is|are}} %(bug_count)s bug{{plural:%(bug_count)s||s}} affecting %(component_count)s component{{plural:%(component_count)s||s}}. For guidance on reviewing the following bugs, refer to [[QA:SOP_nth_bug_process]]. -''' % dict (bug_count=len(join_lists(proposed_nth_by_component.values())), - component_count=len(proposed_nth_by_component)) +''' % dict (bug_count=len(join_lists(bugs_by_component['proposed_nths'].values())), + component_count=len(bugs_by_component['proposed_nths'])) # Sorted list of proposed bugs - page_content += wikitable_bugs(proposed_nth_by_component, bugs_by_id) + page_content += wikitable_bugs(bugs_by_component['proposed_nths'], bugs_by_id) # Create mediawiki handle if opts.verbose: print 'Connecting to mediawiki ...' |