From 38693e0a39210fd1d21716c0c5a2c74dd4c8a1c2 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sat, 19 May 2012 10:04:01 -0400 Subject: [PATCH] Skip fix committed for some projects. There are a set of projects which release directly from git, so we can just set them directly to fix released. Fixes bug 943413. Change-Id: I0186b67efaa5eee7130ae9d5a677dfb2951a98e8 --- modules/gerrit/files/scripts/update_bug.py | 30 +++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/modules/gerrit/files/scripts/update_bug.py b/modules/gerrit/files/scripts/update_bug.py index f322332d97..da35d12b6b 100755 --- a/modules/gerrit/files/scripts/update_bug.py +++ b/modules/gerrit/files/scripts/update_bug.py @@ -74,12 +74,18 @@ def set_fix_committed(bugtask): bugtask.lp_save() +def set_fix_released(bugtask): + """Set bug fix released""" + + bugtask.status = "Fix Released" + bugtask.lp_save() + + def release_fixcommitted(bugtask): """Set bug FixReleased if it was FixCommitted""" if bugtask.status == u'Fix Committed': - bugtask.status = "Fix Released" - bugtask.lp_save() + set_fix_released(bugtask) def tag_in_branchname(bugtask, branch): @@ -109,16 +115,34 @@ def git2lp(full_project_name): 'openstack/python-quantumclient': 'quantum', 'openstack/openstack-ci-puppet': 'openstack-ci', 'openstack-ci/devstack-gate': 'openstack-ci', + 'openstack-ci/lodgeit': 'openstack-ci', + 'openstack-ci/meetbot': 'openstack-ci', } return project_map.get(full_project_name, short_project(full_project_name)) +def is_direct_release(full_project_name): + """Test against a list of projects who directly release changes.""" + return full_project name in [ + 'openstack-ci/devstack-gate', + 'openstack-ci/lodgeit', + 'openstack-ci/meetbot', + 'openstack-dev/devstack', + 'openstack/openstack-ci', + 'openstack/openstack-ci-puppet', + 'openstack/openstack-manuals', + ] + + def process_bugtask(launchpad, bugtask, git_log, args): """Apply changes to bugtask, based on hook / branch...""" if args.hook == "change-merged": if args.branch == 'master': - set_fix_committed(bugtask) + if is_direct_release(args.project): + set_fix_released(bugtask) + else: + set_fix_committed(bugtask) elif args.branch == 'milestone-proposed': release_fixcommitted(bugtask) else: