Roundup Tracker - Issues

Issue 2551003

classification
Title: send email to nosy list after issue created
Type: behavior Severity: normal
Components: Mail interface Versions: 1.6
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: austin, rouilj
Priority: Keywords:

Created on 2018-09-13 03:26 by austin, last changed 2018-09-19 21:55 by rouilj.

Messages
msg6243 Author: [hidden] (austin) Date: 2018-09-13 03:26
Tried to create one issue with an non-empty nosy list, but the issue was not emailed 
to the nosy list.
msg6251 Author: [hidden] (rouilj) Date: 2018-09-18 01:42
Hi Austin:

Do you have the nosyreaction.py file in the detectors subdirectory of
the tracker home directory?
msg6252 Author: [hidden] (austin) Date: 2018-09-18 16:36
Hi John

Yes. I have the  nosyreaction.py and it's working for any updates of every issue.

The only problem is when I create a issue.
Actually, I was creating using roundup-admin with some user in the nosy list.

I can see from the web UI that the issue was created successfully. However the user 
in the nosy list were not notified by email.

BR,Austin
msg6253 Author: [hidden] (rouilj) Date: 2018-09-19 00:44
> Actually, I was creating using roundup-admin with some user in
> the nosy list.

I don't think email is sent unless there is a message. What is the exact
sequence of roundup-admin commands that you used to create the issue?

-- rouilj
msg6254 Author: [hidden] (austin) Date: 2018-09-19 03:12
Hi John,

Below is the procedure to add one issue using cli, how can I trigger one nosy 
message via the roundup-adm cli? Thanks.

def add_merchant(md):
    cmd = [u'roundup-admin',u'-i', ROUNDUPHOME, u'-
u',u'austin:mypassword',u'create',u'issue']
    cmd.append('mid='+md['mid'])
    cmd.append('title='+md['shortname'])
    cmd.append(u'status=contract-not-yet-signed')
    cmd.append('address='+md['address'])
    cmd.append('phone='+md['phone'])
    info="some useful informaiton"]
    cmd.append('info='+info)
    cmd.append('nosy=mike,austin')
    cmd = [cmdele.encode('utf-8') for cmdele in cmd]
    print cmd
    subprocess.call(cmd)

BR,Austin
msg6255 Author: [hidden] (rouilj) Date: 2018-09-19 21:55
Hi Austin:

As I suspected, the issue's message property is not updated when you
create the issue. The way the current reactor is written, nosy
messages are not sent unless a message is added.

See below for more details.

In message <1537326755.4.0.956365154283.issue2551003@psf.upfronthosting.co.za>,
austin writes:
>Below is the procedure to add one issue using cli, how can I trigger one nosy 
>message via the roundup-adm cli? Thanks.
>
>def add_merchant(md):
>    cmd = [u'roundup-admin',u'-i', ROUNDUPHOME,
>        u'-u',u'austin:mypassword',u'create',u'issue']
>    cmd.append('mid='+md['mid'])
>    cmd.append('title='+md['shortname'])
>    cmd.append(u'status=contract-not-yet-signed')
>    cmd.append('address='+md['address'])
>    cmd.append('phone='+md['phone'])
>    info="some useful informaiton"]
>    cmd.append('info='+info)
>    cmd.append('nosy=mike,austin')
>    cmd = [cmdele.encode('utf-8') for cmdele in cmd]
>    print cmd
>    subprocess.call(cmd)

The key component of the nosy reactor is:

   # send a copy of all new messages to the nosy list
   for msgid in determineNewMessages(cl, nodeid, oldvalues):
       try:
           cl.nosymessage(nodeid, msgid, oldvalues)
       except roundupdb.MessageSendError as message:
           raise roundupdb.DetectorError(message)

This code will do nothing if the message property is not changed (that
is a new message was added). In your code above, I don't see any
change to the message property. As a result no nosy message.

You can modify the nosy reactor by doing something similar to:

  http://www.roundup-tracker.org/cgi-bin/moin.cgi/NosyMessagesAllTheTime

so you get a nosy email sent even if no message was entered.

Also if you are writing in python you probably should use the roundup
python library to do the work. It is easier than using roundup-admin. See:

  https://sourceforge.net/p/roundup/code/ci/default/tree/scripts/add-issue

(also in the source tarball in the scripts subdirectory) for an
example of how to create a roundup issue using python.

To make this work using the roundup-admin command line, create a new
message first. Then set the messages property of a newly created issue
to the number of the new message. Note that creating messages is kind of
a pain as there is no way to import the message content/body from a
file or from stdin. I thought there used to be a mechanism to do this
but I haven't found it.

Have a great day.
History
Date User Action Args
2018-09-19 21:55:24rouiljsetstatus: open -> closed
messages: + msg6255
2018-09-19 03:12:35austinsetmessages: + msg6254
2018-09-19 00:44:57rouiljsetmessages: + msg6253
2018-09-18 16:36:27austinsetmessages: + msg6252
2018-09-18 01:43:37rouiljsetstatus: new -> open
type: behavior
components: + Mail interface
versions: + 1.6
2018-09-18 01:42:48rouiljsetnosy: + rouilj
messages: + msg6251
2018-09-13 03:26:34austincreate