Skip to content
This repository has been archived by the owner on Jul 24, 2018. It is now read-only.

Commit

Permalink
Merge pull request #27 from fedora-infra/feature/further-update-defaults
Browse files Browse the repository at this point in the history
Further update the defaults.
  • Loading branch information
ralphbean committed Jan 13, 2015
2 parents ca8ce4d + 0c105d0 commit 1be4450
Showing 1 changed file with 31 additions and 37 deletions.
68 changes: 31 additions & 37 deletions fmn/lib/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@
# filters)

exclusion_packages = [
# Go ahead and ignore all summershum messages by default. @jwboyer
# complained rightly https://github.com/fedora-infra/fmn/issues/27
'summershum_catchall',
]

exclusion_username = [
# No need to notify about your own askbot activity
'askbot_catchall',

# Don't tell me about my own bodhi activity, but do tell me if other people
# do bodhi stuff to my packages.
'bodhi_buildroot_override_untag',
Expand Down Expand Up @@ -68,19 +74,16 @@
# Ignore all of my own wiki stuff.
'wiki_catchall',

]
exclusion_mutual = [
# This is noisy for admins. Keep only the 'completed' ones which is nice
# for long-running playbooks.
'playbook_started',

# No need to notify about your own askbot activity
'askbot_catchall',

# Ignore the spammy fedbadges stuff, but keep the badge.award message
'fedbadges_person_first_login',
'fedbadges_person_rank_advance',

## Go ahead and ignore all mailman stuff since you should be getting it by
## email anyways.
'mailman_receive',

]
exclusion_mutual = [
# No need to tell me about copr starts, I just want to know about completed
# stuff.
#'copr_build_end',
Expand Down Expand Up @@ -163,10 +166,6 @@
#'koschei_group',
#'koschei_package_state_change',

## Go ahead and ignore all mailman stuff since you should be getting it by
## email anyways.
'mailman_receive',

## I actually want to know about all the nuancier stuff associated with me,
## if I'm ever in an election.
#'nuancier_candidate_new',
Expand All @@ -175,8 +174,6 @@
#'nuancier_candidate_denied',
#'nuancier_election_update',

'planet_post_new',

## Ignore all the compose stuff.. but this can be commented out since
## compose messages are associated with neither a username nor a package.
#'compose_branched_complete',
Expand All @@ -196,10 +193,6 @@
#'compose_rawhide_rsync_complete',
#'compose_branched_rsync_start',
#'compose_rawhide_rsync_start',

# Go ahead and ignore all summershum messages by default too. @jwboyer
# complained rightly https://github.com/fedora-infra/fmn/issues/27
'summershum_catchall',
]


Expand Down Expand Up @@ -243,48 +236,49 @@ def contexts():
pref = fmn.lib.models.Preference.create(
session, user, context, detail_value=value)

# Add a filter that looks for this user
# Add a filter that looks for packages of this user
filt = fmn.lib.models.Filter.create(
session, "Events referring to my username")
session, "Events on packages that I own")
filt.add_rule(session, valid_paths,
"fmn.rules:user_filter", fasnick=nick)
"fmn.rules:user_package_filter", fasnick=nick)

# If this is a message about a package of mine, **and** i'm responsible
# for it, then don't trigger this filter. Rely on the previous one.
filt.add_rule(session, valid_paths,
"fmn.rules:user_filter",
fasnick=nick,
negated=True)

# Right off the bat, ignore all messages from non-primary kojis.
filt.add_rule(session, valid_paths,
"fmn.rules:koji_instance",
instance="ppc,s390,arm",
negated=True)

# And furthermore exclude lots of message types
for code_path in exclusion_username + exclusion_mutual:
# And furthermore, exclude lots of message types
for code_path in exclusion_packages + exclusion_mutual:
filt.add_rule(
session, valid_paths, "fmn.rules:%s" % code_path, negated=True)

pref.add_filter(session, filt, notify=True)
# END "packages I own"


# Add a filter that looks for packages of this user
# Add a filter that looks for this user
filt = fmn.lib.models.Filter.create(
session, "Events on packages that I own")
filt.add_rule(session, valid_paths,
"fmn.rules:user_package_filter", fasnick=nick)

# If this is a message about a package of mine, **and** i'm responsible
# for it, then don't trigger this filter. Rely on the previous one.
session, "Events referring to my username")
filt.add_rule(session, valid_paths,
"fmn.rules:user_filter",
fasnick=nick,
negated=True)
"fmn.rules:user_filter", fasnick=nick)

# Right off the bat, ignore all messages from non-primary kojis.
filt.add_rule(session, valid_paths,
"fmn.rules:koji_instance",
instance="ppc,s390,arm",
negated=True)

# And furthermore, exclude lots of message types
for code_path in exclusion_packages + exclusion_mutual:
# And furthermore exclude lots of message types
for code_path in exclusion_username + exclusion_mutual:
filt.add_rule(
session, valid_paths, "fmn.rules:%s" % code_path, negated=True)

pref.add_filter(session, filt, notify=True)
# END "events references my username"

0 comments on commit 1be4450

Please sign in to comment.