Bogus accounts in patchwork

Jeremy Kerr jk at ozlabs.org
Thu Apr 24 11:57:59 EST 2014


Hi Carl,

> It does seem that it would be convenient if the environment-setup pieces
> there were abstracted someway to make it more convenient to run
> patchwork utility programs.

Yes, that'd be nice. I've just been setting up the environment in my
crontab (as you say, duplicating the stuff in parsemail.sh):

PYTHONPATH=apps:.
DJANGO_SETTINGS_MODULE=settings
*/10 * * * * cd patchwork; python ./apps/patchwork/bin/patchwork-cron.py

> I would have followed up with a patch to the documentation on how to
> setup the cron job, but there are still two things I'm unclear on:
> 
> 1. How should the environment-setup be done. Do we need another shell
>    wrapper (patchwork-cron.sh) looking almost the same as parsemail.sh?
>    It seems silly and fragile to duplicate this stuff.
> 
>    What's a cleaner solution?

I'd prefer not to have another wrapper. I can probably do some cleanups
that mean we don't need PYTHONPATH, but we'll still need the settings
var.

I guess we could assume a reasonable default (= 'settings') if the var
is absent from the environment.

> 2. What is the send_notifications() stuff in the default cron job all
>    about?

There's a setting on each project - current defaults to False - on
whether patchwork should send out notifications to patch submitters,
when their patches have been updated (it's the 'Send notifications'
checkbox on the project settings). Notifications look like this:

  Hello,

  The following patch (submitted by you) has been updated in patchwork:

   * models: Fix HeaderParser import on python 2.4
       - http://patchwork.ozlabs.org/patch/69913/
      was: Under Review
      now: Accepted

  This email is a notification only - you do not need to respond.

  Happy patchworking.

  --

  This is an automated mail sent by the patchwork system at
  patchwork.ozlabs.org. To stop receiving these notifications, edit
  your mail settings at:
    http://patchwork.ozlabs.org/mail/

Currently, none of the public patchwork projects that I host run with
this enabled, as it can get a little noisy. What we really need is a way
for some patchwork updates to be done with notifications suppressed.

If you have had this enabled, but haven't been running the cron script,
you'll have a bunch of notifications queued. You safely delete the
PatchChangeNotification objects:

  DELETE FROM patchwork_patchchangenotification;

Cheers,


Jeremy


More information about the Patchwork mailing list