From 1f50d5391bd19b02223fc376b92f8b6b14affbcf Mon Sep 17 00:00:00 2001 From: Thierry Carrez Date: Wed, 14 Nov 2012 15:47:57 +0100 Subject: [PATCH] Do not reopen closed bugs due to bug mentions Do not let update_bug.py reopen a FixCommitted or FixReleased bug just because the bug number was mentioned in a commit message. In most cases that mention is just a simple reference to a closed bug. In the rare cases the committer actually wanted to reopen a closed bug, he should rather have open a specific bug about it anyway. Fixes bug 1078745 Change-Id: I513e6fc73d6bab02de21628e55a5d28189834632 Reviewed-on: https://review.openstack.org/16080 Reviewed-by: Monty Taylor Reviewed-by: Jeremy Stanley Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins --- modules/gerrit/files/scripts/update_bug.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/gerrit/files/scripts/update_bug.py b/modules/gerrit/files/scripts/update_bug.py index 1ff0b3b258..9479a81225 100755 --- a/modules/gerrit/files/scripts/update_bug.py +++ b/modules/gerrit/files/scripts/update_bug.py @@ -138,14 +138,16 @@ def process_bugtask(launchpad, bugtask, git_log, args): if is_direct_release(args.project): set_fix_released(bugtask) else: - set_fix_committed(bugtask) + if bugtask.status != u'Fix Released': + set_fix_committed(bugtask) elif args.branch == 'milestone-proposed': release_fixcommitted(bugtask) elif args.branch.startswith('stable/'): series = args.branch[7:] # Look for a related task matching the series for reltask in bugtask.related_tasks: - if reltask.bug_target_name.endswith("/" + series): + if (reltask.bug_target_name.endswith("/" + series) and + reltask.status != u'Fix Released'): # Use fixcommitted if there is any set_fix_committed(reltask) break @@ -159,11 +161,14 @@ def process_bugtask(launchpad, bugtask, git_log, args): if args.hook == "patchset-created": if args.branch == 'master': - set_in_progress(bugtask, launchpad, args.uploader, args.change_url) + if bugtask.status not in [u'Fix Committed', u'Fix Released']: + set_in_progress(bugtask, launchpad, args.uploader, + args.change_url) elif args.branch.startswith('stable/'): series = args.branch[7:] for reltask in bugtask.related_tasks: - if reltask.bug_target_name.endswith("/" + series): + if (reltask.bug_target_name.endswith("/" + series) and + reltask.status not in [u'Fix Committed', u'Fix Released']): set_in_progress(reltask, launchpad, args.uploader, args.change_url) break