Skip to content
Permalink
Browse files

Tweak rhbz fixedin handling (again)

This is the third and hopefully final time.

We got pinged by some Red Hatters who say that there's a precedent for handling
that field in a particular way.  This should hopefully meet that criteria.

Fixes #531.
  • Loading branch information...
ralphbean committed Sep 9, 2015
1 parent 18e6b77 commit 066093ca0642256f23a3cd508613a133b6c7069a
Showing with 14 additions and 11 deletions.
  1. +9 −4 bodhi/bugs.py
  2. +3 −6 bodhi/models/models.py
  3. +2 −1 bodhi/tests/test_masher.py
@@ -101,13 +101,18 @@ def close(self, bug_id, versions):
if bug.component in versions:
version = versions[bug.component]
# Get the existing list
fixedin = [v.strip() for v in bug.fixed_in.split(',')]
# Strip out any empty strings
fixedin = [v for v in fixedin if v.strip()]
fixedin = [v.strip() for v in bug.fixed_in.split()]
# Strip out any empty strings (already stripped)
fixedin = [v for v in fixedin if v]
# And add our build if its not already there
if version not in fixedin:
fixedin.append(version)
args['fixedin'] = ", ".join(fixedin)

# There are Red Hat preferences to how this field should be
# structured. We should use:
# - the full NVR as it appears in koji
# - space-separated if there's more than one.
args['fixedin'] = " ".join(fixedin)

bug.close('NEXTRELEASE', **args)
except xmlrpclib.Fault:
@@ -1960,12 +1960,9 @@ def testing(self, update):
def close_bug(self, update):
# Build a mapping of package names to build versions
# so that .close() can figure out which build version fixes which bug.
versions = dict([(
get_nvr(b.nvr)[0],
# Strip off the .fc23 at the end of the nvr to try and match the
# way the anaconda team uses the fixedin field.
b.nvr.rsplit('.', 1)[0]
) for b in update.builds])
versions = dict([
(get_nvr(b.nvr)[0], b.nvr) for b in update.builds
])
bugtracker.close(self.bug_id, versions=versions)

def modified(self, update):
@@ -731,7 +731,8 @@ def test_modify_stable_bugs(self, close, comment, *args):
t.db = session
t.work()
t.db = None
close.assert_called_with(12345, versions=dict(bodhi=u'bodhi-2.0-1'))
close.assert_called_with(
12345, versions=dict(bodhi=u'bodhi-2.0-1.fc17'))
comment.assert_called_with(12345, u'bodhi-2.0-1.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report.')

@mock.patch(**mock_taskotron_results)

0 comments on commit 066093c

Please sign in to comment.
You can’t perform that action at this time.