Export to GitHub

google-highly-open-participation-psf - issue #255

Update trac to include more ticket fields in outgoing email headers


Posted on Dec 7, 2007 by Helpful Giraffe

Update trac (http://trac.edgewall.org) so that all fields of a ticket, including user-defined fields, are included as headers of outgoing email generated when the ticket is modified.

For example, include the Reporter field value in the X-trac-reporter header and the Component field value in the X-trac-component header. Be aware that some values may span multiple lines, and need to be formatted appropriately to create valid email headers.

It is not clear whether a plugin can implement this change, or if it needs to be handled through a patch. If the work can be done with a plugin, that is preferred.

Completion, plugin:

Attach an archive file (zip, tar.gz, egg, etc.) with the source code for the plugin as a comment on this task. Make sure to include installation and usage instructions.

For extra credit, submit the plugin to Trac Hacks (http://trac-hacks.org) and link to the results here.

Completion, patch:

If it is not possible to implement this change as a plugin, use a patch file as generated by "svn diff". Explain why the patch is required (instead of the plugin) using a comment on this ticket.

For extra credit, submit the patch to the trac team via their ticket system, and link to the ticket here.

Task duration: please complete this task within 5 days (120 hours) of claiming it.

Comment #1

Posted on Dec 10, 2007 by Quick Kangaroo

ICTT (I Claim This Task)

Comment #2

Posted on Dec 10, 2007 by Happy Bear

This task is due December 15, 2007, 18:00 UTC.

Comment #3

Posted on Dec 15, 2007 by Happy Bear

Any progress so far? Your regular 5 days are almost over.

Comment #4

Posted on Dec 15, 2007 by Quick Kangaroo

Sorry for no announcing of my progress... I have read all I had to (creating plugins for trac is really interesting), then it took long my time to make trac usable on my usb (python soft which need easy_install to work can make me really annoyed; it's curious it runs without clearsilver installed) -- but I haven't written any code yet. Despite of that I think I'll do it in time (both patch and plugin I guess) -- it's quite simple task so the few hours can make it...

Thanks for asking.

(qwp0)

Comment #5

Posted on Dec 15, 2007 by Happy Bear

Thanks for the update!

I guess you're using the SVN version of trac, 0.11dev, which doesn't need clearsilver anymore, but uses genshi for templating.

Comment #6

Posted on Dec 15, 2007 by Quick Kangaroo

Comment deleted

Comment #7

Posted on Dec 15, 2007 by Quick Kangaroo

Yes, it's truth -- thanks, Trac Team! Great feature because I hate dependencies of python software on software which must be compiled: this is what I really needed in Trac.

  • one question: In the X-Trac-headers have whole comments to be included too?

Comment #8

Posted on Dec 15, 2007 by Helpful Kangaroo

No, do not include the comments in the headers, just the normal and custom fields. The purpose of the change is to make it easier to automatically filter incoming email based on those headers.

Comment #9

Posted on Dec 15, 2007 by Quick Kangaroo

Yeah, I realise that. I asked just only because there are not many default fields which have multiple lines as described in task description (proper formatting) and I wanted to be sure :-)

I attach output of 'svn diff' to this comment... I'll try to do the plugin too but I don't know if I'll do it till deadline.

As reason for using patch can be that mail headers are not often viewed by users so it won't be user-unfriendly -- on the other hand (as doug.hellmann have said) it can be used for easier parsing of notification mails. Maybe, it's too small thing to make separate plugin for it (despite of that I'll try to make it).

Attachments

Comment #10

Posted on Dec 15, 2007 by Quick Kangaroo

Small edit that makes notification unittests to pass.

Attachments

Comment #11

Posted on Dec 15, 2007 by Helpful Kangaroo

I'll look at this tomorrow.

Comment #12

Posted on Dec 16, 2007 by Quick Kangaroo

As I'm looking at it now, I see that there may rise a conflict between whole-trac header variables (written before my edit) and trac-ticket header variables. I offer two solutions: you can add the conflict keys to the blacklist (what is not very clear) or change preffix (e.g.) to 'X-Trac-Ticket-'...

P.S.: Can I claim another task in GHOP now?

Comment #13

Posted on Dec 16, 2007 by Happy Bear

Only after a reviewer has set the status to Completed. Doug said he'd look at it today, so it won't take too long :).

Comment #14

Posted on Dec 16, 2007 by Helpful Kangaroo

I like your idea of changing the header prefix to "X-Trac-Ticket" to avoid conflicts.

Your method of detecting blacklisted items seems convoluted. You could just write something like:

if key in blacklist: continue

or:

if key not in blacklist: headers[prefix + ckey] ...

Couldn't you?

Comment #15

Posted on Dec 16, 2007 by Helpful Kangaroo

There are 2 notification.py files in the trac source and from the way the patch is constructed I can't tell which one to apply the changes to. Could you build the patch from the root of the svn checkout using svn diff?

Comment #16

Posted on Dec 16, 2007 by Helpful Kangaroo

I'll extend the deadline, since it took me so long to review your initial submission.

Comment #17

Posted on Dec 16, 2007 by Quick Kangaroo

Yes, determining if key is in blacklist is over-complicated, sorry ;-)

I'll post patch soon, Damn Small Linux doesn't support external USB disks with SATA disks and actually I don't have fully-functional system on the hard-disk.

Comment #18

Posted on Dec 17, 2007 by Quick Kangaroo

I have changed the 'wtf' lines in my code, so I attach (the proper, I hope) diff so it can be used as patch.

In addition, I have written special unittest for checking whether X-Trac-Ticket-Headers are set without problem.

And at last I have done the 'extra credit' for patch as written in task description (linked)

Attachments

Comment #19

Posted on Dec 17, 2007 by Helpful Kangaroo

Great, you're done!

What is the ticket number over on the trac site?

Comment #20

Posted on Dec 17, 2007 by Quick Kangaroo

URI of ticket on the trac site is http://trac.edgewall.org/ticket/6516 .

Thanks for help...

Status: Completed

Labels:
thirdparty coding trac ClaimedBy-androsis Due-20071217.1800 near-expiration NeedsReview-doug.hellmann