I'm considering writing a generic ticket attribute propagation plugin. This would implement a configurable Ticket Change listener capabale of doing the updates described above. Configuration might look like:
[attribute_propagate]
parent.fields=start, finish, estimate, work
parent.start.method=min
parent.finish.method=max
parent.estimate.method=sum
parent.work.method=sum
Which means: when a ticket changes, if the parent field is not empty, use it to find another ticket and update its start, finish, estimate, and work fields. Start is updated as the minimum of the current ticket's start and the other ticket's start. Finish as a max. The other ticket's estimate would be it's value minus the current ticket's old value plus the current ticket's new value. I hope you get the idea.
This doesn't seem too complex and I'm ready to dig in but if there's a plugin that does something like this already, I'd rather same the time. Any thoughts?
Chris
--
Christopher Nelson, Software Engineering Manager
SIXNET - Solutions for Your Industrial Networking Challenges
331 Ushers Road, Ballston Lake, NY 12019
Tel: +1.518.877.5173, Fax: +1.518.877.8346 www.sixnet.com
--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-...@googlegroups.com.
To unsubscribe from this group, send email to trac-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.
As I developed the concept, I realized this might apply to
MasterTickets, too. My plan was to have a list of ticket "link" fields
(e.g., parents for Subtickets or parent for ChildTickets, blockedby for
Master Tickets, etc.) so you could configure what fields to look at.
The plugin would do something like:
get ticket's dependent (parent, predecessor, successor, etc.)
if dependent != None:
for field in rollup.fields:
if current's old value and new value differ:
get dependent's value for field
switch rollup.%s.method % field:
case 'min':
if dependent's value > current's new value:
set dependent's value to current's new value
case 'max':
if dependent's value < current's new value:
set dependent's value to current's new value
case 'sum':
dependent's value = dependent's value -
current's old value +
current's new value
> In the TimingAndEstimation case, and presumably others, propagation
> could lead to misleading reports -- e.g. doubling the estimated time
> for a set of tickets by counting the fields twice. Solving that
> automatically and in a generic way seems hard. The user can probably
> deal with that (and I bet a sufficiently clever SQL report could
> account for it).
I'm not sure how that's going to work. One answer would be to only
query leaf nodes for that kind of report. OTOH, if you're looking at a
top-level ticket, the values were already rolled up so you can just look
at it and no report is needed.
> In the TimingAndEstimation case, and presumably others, propagation
> could lead to misleading reports -- e.g. doubling the estimated timeI'm not sure how that's going to work. One answer would be to only
> for a set of tickets by counting the fields twice. Solving that
> automatically and in a generic way seems hard. The user can probably
> deal with that (and I bet a sufficiently clever SQL report could
> account for it).
query leaf nodes for that kind of report.
OTOH, if you're looking at a
top-level ticket, the values were already rolled up so you can just look
at it and no report is needed.
I think you're right. What it should do is:
subtract current's old value from old dependant's value then add
current's new value to new dependant's value. If the dependant (e.g.,
parent) didn't change, this reduces to the calcuation I illustrated.
> As I'm thinking about it, some other potential uses occur to me that
> I've sometimes wanted -- closing child tasks when I close the parent
> ticket;
Which would be some operation to propagate the status field.
> making the parent ticket's priority or severity the max of
> the child tickets';
Actually, I think that's wrong. I have a long analysis of how to
propagate priority but it's wiki formatted and hard to post here.
> bubbling keywords across related tickets.
I can see that.
> I think some of those could be covered by min/max/sum, but not sure
> they'd all be handled. You might want to end up with two pluggable
> interfaces, one for defining link types and another for defining
> rollup methods. Then other plugins could be built to extend it with
> custom propagation methods and/or to interface with other
> ticket-relationship-defining systems. (I like when Trac plugins are
> pluggable.)
That'd be awesome. I'm not sure I'm that smart. ;-)