Re: Freeze break request: Add diversity-bot to ircbot.py

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 01, 2016 at 11:14:57PM -0400, Justin W. Flory wrote:
> Hi all,
> 
> This is my first time submitting a patch to a repo or during a freeze
> break - if I missed a step or did something wrong, feel free to correct
> me. :) I didn't see a SOP in infra-docs so I just followed the format of
> past freeze break requests.
> 
> This is a quick patch to add a new bot to ircbot.py for the
> #fedora-diversity team. I copied the commopswatch bot and made slight
> modifications. But I would appreciate it were reviewed for accuracy in
> case I missed something.
> 
> Patch is below and also attached to the email.
> 
> 
> 
> From 1b182e380e10d978c4daa7f01d859916d5675b78 Mon Sep 17 00:00:00 2001
> From: "Justin W. Flory" <git@xxxxxx>
> Date: Thu, 1 Sep 2016 23:07:04 -0400
> Subject: [PATCH] Add #fedora-diversity to ircbot.py for notifications
> related
>  to diversity
> 
> ---
>  roles/fedmsg/irc/templates/ircbot.py | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/roles/fedmsg/irc/templates/ircbot.py
> b/roles/fedmsg/irc/templates/ircbot.py
> index 2bb4c03..3f3931b 100644
> --- a/roles/fedmsg/irc/templates/ircbot.py
> +++ b/roles/fedmsg/irc/templates/ircbot.py
> @@ -363,6 +363,27 @@ config = dict(
>                  body=['^((?!(modularity|Modularity)).)*$'],
>              ),
>          ),
> +
> +        # And #fedora-diversity wanted in too
> +        dict(
> +            network='chat.freenode.net',
> +            port=6667,
> +            make_pretty=True,
> +            make_terse=True,
> +
> +            {% if env == 'staging' %}
> +            nickname='diversity-bot-s',
> +            {% else %}
> +            nickname='diversity-bot',
> +            {% endif %}
> +            channel='fedora-diversity',
> +            filters=dict(
> +                topic=[
> +
> '(planet|meetbot\.meeting\.item\.help|meetbot\.meeting|fedocal\.meeting\.new|fedocal\.meeting\.update|fedocal\.meeting\.delete|fedocal\.calendar|fas\.group\.member\.sponsor|pagure\.project\.new|askbot\.post\.flag_offensive)',
> +                ],
> +                body=['^((?!diversity).)*$'],
> +            ),
> +        ),
>      ],
> 
>      ### Possible colors are ###
> -- 
> 2.7.4

My reading of this (the way the patch is written) is:

    "Messages forwarded to #fedora-diversity *may not* include planet
    messages, or meetbot.meeting messages, or fedocal messages, or fas
    group sponsorship messages.  They must also include the term
    'diversity'."

I think you probably wanted the opposite with respect to topic.  You
*only* want planet, meetbot, fedocal, and fas messages.. right?

If that's the case, you need the "negative lookahead" wrapped around
your topic expression.

-Ralph

Attachment: signature.asc
Description: PGP signature

_______________________________________________
infrastructure mailing list
infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
https://lists.fedoraproject.org/admin/lists/infrastructure@xxxxxxxxxxxxxxxxxxxxxxx

[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux