Edgewall Software
Modify

Opened 19 years ago

Closed 18 years ago

Last modified 6 years ago

#1038 closed enhancement (fixed)

Support custom milestone ordering.

Reported by: otavio@… Owned by: Christian Boos
Priority: high Milestone: 0.9.4
Component: roadmap Version: 0.8
Severity: minor Keywords: roadmap, milestone, version
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Should be interesting if roadmap module support ordering using some code to handle alfa, beta, pre and so on.

For example:

1.0 alfa
1.0 pre
1.0

Attachments (4)

natural_order_sort_for_milestones.diff (3.3 KB ) - added by Christian Boos 18 years ago.
Use natural ordering for Milestones in the roadmap view
natural_order_sort_for_milestones.2.diff (4.3 KB ) - added by Christian Boos 18 years ago.
Updated patch in order to take the completed and due date into account.
milestone_sort_dsu.diff (3.4 KB ) - added by Matthew Good 18 years ago.
sort milestones using DSU idiom
milestone_sort_dsu.2.diff (3.8 KB ) - added by Christian Boos 18 years ago.
Updated mgood's patch so that it applies on top of r2758

Download all attachments as: .zip

Change History (21)

comment:1 by Christopher Lenz, 19 years ago

I don't think we can possibly support all different naming conventions for milestones. Note that some projects may not use terms like alpha or beta at all.

Currently, milestones are ordered primarily by date, and second alphabetically by name. It may make sense to support manual ordering of milestones so that the admin could simply say at what position a particular milestone should appear relative to the other ones. JIRA supports that, for example.

comment:2 by Christopher Lenz, 19 years ago

Severity: minorenhancement

comment:3 by Christopher Lenz, 19 years ago

Milestone: 0.9
Summary: Should order milestone versions supporting common names like alfa, beta, pre, rc...Support custom milestone ordering

Not for 0.9.

comment:4 by anonymous, 18 years ago

Milestone: 0.10
Priority: lownormal

I think you may want to include this in some milestone, particularly in light of how the Roadmap looks since the addition of the 0.10 - 0.12 milestones. They appear to be scheduled before 0.9.4 which I'm fairly certain is not the intent.

I'm suggesting 0.10 should be the target milestone for this, but I certainly have no idea if that is realistic

comment:5 by Christian Boos, 18 years ago

Owner: changed from Christopher Lenz to Christian Boos
Priority: normalhigh
Severity: normalminor

Natural sort ordering for milestone names?

(as in source:trunk/trac/versioncontrol/web_ui/browser.py@latest#L33)

by Christian Boos, 18 years ago

Use natural ordering for Milestones in the roadmap view

comment:6 by Christian Boos, 18 years ago

Status: newassigned

See attachment:natural_order_sort_for_milestones.diff

That could be also ported to 0.9-stable, in order to correctly show Trac's own milestones, for the next upgrade.

comment:7 by anonymous, 18 years ago

Nice patch :-)

Please check in, and I'd be +1 on porting to 0.9-stable.

comment:8 by Christopher Lenz, 18 years ago

(and that was me forgetting to login :-P )

comment:9 by Christopher Lenz, 18 years ago

Hold on, actually that breaks the ordering by due date.

The ordering should ideally be:

  1. completed date (already completed first, completed earlier first)
  2. due date (due date set first, due date earlier first)
  3. name (natural order)

in that order.

comment:10 by Christopher Lenz, 18 years ago

See also #2209.

Note that the due date sorting is already performed in the SQL query.

by Christian Boos, 18 years ago

Updated patch in order to take the completed and due date into account.

comment:11 by Christian Boos, 18 years ago

See updated patch (attachment:natural_order_sort_for_milestones.2.diff).

I think this would also partially do what's requested in #2209 (what's left to be done would be the ordering in the query listing).

But in the meantime you can already check the Roadmap's ordering for correctness.

comment:12 by Christopher Lenz, 18 years ago

This should be moved to the Milestone class so that the ordering is consistent.

by Matthew Good, 18 years ago

Attachment: milestone_sort_dsu.diff added

sort milestones using DSU idiom

comment:13 by Christian Boos, 18 years ago

Milestone: 0.100.9.4
Resolution: fixed
Status: assignedclosed

Finalized version of the patch committed as r2758 and r2759.

(would be nice to be able to set two milestones, btw)

comment:14 by Matthew Good, 18 years ago

Using "sorted" with the "key" parameter in Python 2.4, or the "decorate-sort-undecorate" (DSU) idiom in earlier versions is a cleaner and faster way to sort values than using comparators. I've added a patch to do the milestone natual-ordering using the built-in sorted, or a small compatibility method to simulate it using DSU. It still needs ported to the browser ordering, but that's a little more convoluted, so I'll have to revisit it after work.

by Christian Boos, 18 years ago

Attachment: milestone_sort_dsu.2.diff added

Updated mgood's patch so that it applies on top of r2758

comment:15 by Matthew Good, 18 years ago

added the DSU idiom in [2760] and [2761]

comment:16 by anonymous, 18 years ago

Summary: Support custom milestone orderingSupport custom milestone ordering.

in reply to:  9 comment:17 by anonymous, 6 years ago

Replying to Christopher Lenz:

Hold on, actually that breaks the ordering by due date.

The ordering should ideally be:

  1. completed date (already completed first, completed earlier first)
  2. due date (due date set first, due date earlier first)
  3. name (natural order)

in that order.

I think that the first two sorting criteria is quite natural.

However the third criteria which often arise when a milestone has no due date (and is not completed). For me it would be nice to be able to have control over the sort criteria then.

Consider for example having the milestones "Near future", "Distant future" and "Probably never" (with no due date). The intuitive sort order would be just that, but the natural sort order would be something completely different.

Currently a workaround if you want to have the intuitive sort order would be to prefix the names or setting an artificial due date to sort by.

A proposal would be to introduce an additional field to be used as a third criterion before sorting on name. This would be similar to the method used to sort ticket fields or workflow transition ordering. Then the ordering should be:

  1. completed date
  2. due date
  3. new additional field
  4. name

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.