%YAML 1.2 --- # This is some metadata about the badge name: If you build it... (Koji Success I) description: Successfully completed a koji build. creator: ralph # This is a link to the discussion about adopting this as a for-real badge. discussion: https://github.com/oddshocks/badges/pull/2 # A link to the image for the badge image_url: https://badges.fedoraproject.org/pngs/koji-if-you-build-it-01.png # That's us! issuer_id: fedora-project # We'll perform our more costly check (defined below) only when # we receive messages that match this 'trigger' trigger: all: - topic: buildsys.build.state.change - lambda: msg.get('msg', {}).get('new', None) is 1 # Once the check has been triggered, this defines what we actually check. criteria: datanommer: filter: topics: - "%(topic)s" # The topic of the message that triggered us. users: - "%(msg.owner)s" # The user that was created. rows_per_page: 9999999 operation: lambda: sum(1 for msg in query.all() if msg.msg['new'] is 1) condition: greater than or equal to: 1 recipient: "%(msg.owner)s"