Skip to content

Commit

Permalink
Merge pull request #385 from msimacek/feature/koschei-collection-argu…
Browse files Browse the repository at this point in the history
…ments

Add collection argument to koschei links
  • Loading branch information
pypingou committed Jun 20, 2016
2 parents 84fee23 + 48bc925 commit bc161aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions fedmsg_meta_fedora_infrastructure/koschei.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ def secondary_icon(self, msg, **config):
def link(self, msg, **config):
baseurl = 'https://apps.fedoraproject.org/koschei'
if 'koschei.package.state.change' in msg['topic']:
return '{baseurl}/package/{name}'.format(baseurl=baseurl,
name=msg['msg']['name'])
url = '{baseurl}/package/{name}'.format(baseurl=baseurl,
name=msg['msg']['name'])
if 'collection' in msg['msg']:
url += '?collection=' + msg['msg']['collection']
return url
else:
raise NotImplementedError("%r" % msg)

Expand Down
2 changes: 1 addition & 1 deletion fedmsg_meta_fedora_infrastructure/tests/koschei.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class TestKoscheiPackageStateChange(Base):

expected_title = "koschei.package.state.change"
expected_subti = "rnv's builds started to fail in Fedora 22 (arm)"
expected_link = 'https://apps.fedoraproject.org/koschei/package/rnv'
expected_link = 'https://apps.fedoraproject.org/koschei/package/rnv?collection=f22'
expected_secondary_icon = \
'https://apps.fedoraproject.org/packages/images/icons/rnv.png'
expected_packages = set(['rnv'])
Expand Down

0 comments on commit bc161aa

Please sign in to comment.