Including mailing list on pullrequests/comments from Our-Own-Kallithea (OOK)

Mads Kiilerich mads at kiilerich.com
Sat Sep 24 16:09:23 UTC 2016


On 09/24/2016 03:21 PM, Thomas De Schampheleire wrote:
> Hi,
>
> Some of the Kallihea developers have an account on 'our-own-kallithea'
> which they use to publish proposed Kallithea changes via a pull
> request. This is all fine for the regular Kallithea developers that
> also have an account there, but such pull requests are not by default
> advertised to the mailing list.

+1 from me.

Perhaps base it on Dominik's changes for per repo configuration (which 
we really should get around to land ...) so we can upstream it.

/Mads


>
> I wonder if it is much more complex than following code (to be added
> on OOK only):
>
> diff --git a/kallithea/model/notification.py b/kallithea/model/notification.py
> --- a/kallithea/model/notification.py
> +++ b/kallithea/model/notification.py
> @@ -106,6 +106,17 @@ class NotificationModel(BaseModel):
>           if 'threading' in email_kwargs:
>               headers = {'References': ' '.join('<%s>' % x for x in
> email_kwargs['threading'])}
>
> +        # also send to mailing list
> +        if type_ in (Notification.TYPE_PULL_REQUEST,
> Notification.TYPE_PULL_REQUEST_COMMENT,
> Notification.TYPE_CHANGESET_COMMENT):
> +            class DummyUser(object):
> +                """Stub of User class, avoiding add to database"""
> +                def __init__(self, email):
> +                    self.email = email
> +
> +            # TODO check if mailing lists are to be sent for this repo
> +            log.debug('Additionally sending notification (type %s to
> mailing list', type_)
> +            rec_objs.add(DummyUser('kallithea at example.com'))
> +
>           # send email with notification to all other participants
>           for rec in rec_objs:
>               ## this is passed into template
>
>
> Where the TODO needs to be still handled...
>
> Thanks,
> Thomas
> _______________________________________________
> kallithea-general mailing list
> kallithea-general at sfconservancy.org
> http://lists.sfconservancy.org/mailman/listinfo/kallithea-general




More information about the kallithea-general mailing list