Roundup Tracker - Issues

Message6255

Author rouilj
Recipients austin, rouilj
Date 2018-09-19.21:55:23
Message-id <20180919215445.901974C053B@itserver6.localdomain>
In-reply-to <1537326755.4.0.956365154283.issue2551003@psf.upfronthosting.co.za>
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:24rouiljsetrecipients: + rouilj, austin
2018-09-19 21:55:24rouiljlinkissue2551003 messages
2018-09-19 21:55:23rouiljcreate