Skip to content

Commit

Permalink
Merge pull request #224 from fedora-infra/ci
Browse files Browse the repository at this point in the history
Fix showing the CI rules in the UI
  • Loading branch information
jeremycline committed Aug 17, 2017
2 parents 4429003 + 9a56164 commit 2cc949e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions fmn/rules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
from fmn.rules.bodhi import *
from fmn.rules.bugzilla import *
from fmn.rules.buildsys import *
from fmn.rules.ci import *
from fmn.rules.compose import *
from fmn.rules.coprs import *
from fmn.rules.faf import *
Expand Down
16 changes: 8 additions & 8 deletions fmn/rules/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def ci_package_test_complete(config, message):
'ci.pipeline.package.test.functional.complete')


@hint(topics=[_('ci.pipeline.compose.test.integration.queued')])
@hint(topics=[_('ci.pipeline.compose.test.integration.queued')], invertible=False)
def ci_compose_test_queued(config, message):
""" Integration tests queued for a compose
Expand All @@ -153,7 +153,7 @@ def ci_compose_test_queued(config, message):
'ci.pipeline.package.test.functional.queued')


@hint(topics=[_('ci.pipeline.compose.test.integration.running')])
@hint(topics=[_('ci.pipeline.compose.test.integration.running')], invertible=False)
def ci_compose_test_running(config, message):
""" Integration tests are running for a compose
Expand All @@ -165,7 +165,7 @@ def ci_compose_test_running(config, message):
'ci.pipeline.package.test.functional.running')


@hint(topics=[_('ci.pipeline.compose.test.integration.complete')])
@hint(topics=[_('ci.pipeline.compose.test.integration.complete')], invertible=False)
def ci_compose_test_complete(config, message):
""" Integration tests completed for a compose
Expand Down Expand Up @@ -203,7 +203,7 @@ def ci_image_test_complete(config, message):

# More interesting rules

@hint(topics=[_('ci.pipeline.image.test.smoke.complete')])
@hint(topics=[_('ci.pipeline.image.test.smoke.complete')], invertible=False)
def ci_test_passed(config, message):
""" Any of the tests run passed the CI pipeline
Expand All @@ -220,16 +220,16 @@ def ci_test_passed(config, message):
):
return False

return message['msg'].get('status', '').lower() == 'success'
return message.get('msg', {}).get('status', '').lower() == 'success'


@hint(topics=[_('ci.pipeline.image.test.smoke.complete')])
@hint(topics=[_('ci.pipeline.image.test.smoke.complete')], invertible=False)
def ci_step_complete(config, message):
""" Any steps of the CI pipeline completed successfully
Adding this rule will trigger notifications when any of the steps of
the `CI pipeline
<https://fedoraproject.org/wiki/FedoraAtomicCI/pipeline>`_ completed.
"""
return message['topic'].split(',')[3] == 'ci' \
and message['msg'].get('status', '').lower() == 'success'
return message['topic'].split('.')[3] == 'ci' \
and message.get('msg', {}).get('status', '').lower() == 'success'

0 comments on commit 2cc949e

Please sign in to comment.