Edgewall Software

Ticket #1038 (closed enhancement: fixed)

Opened 4 years ago

Last modified 3 years ago

Support custom milestone ordering.

Reported by: otavio@… Owned by: cboos
Priority: high Milestone: 0.9.4
Component: roadmap Version: 0.8
Severity: minor Keywords: roadmap, milestone, version
Cc:

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

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

Change History

Changed 4 years ago by cmlenz

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.

Changed 4 years ago by cmlenz

  • severity changed from minor to enhancement

Changed 3 years ago by cmlenz

  • summary changed from Should order milestone versions supporting common names like alfa, beta, pre, rc... to Support custom milestone ordering
  • milestone 0.9 deleted

Not for 0.9.

Changed 3 years ago by anonymous

  • priority changed from low to normal
  • milestone set to 0.10

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

Changed 3 years ago by cboos

  • owner changed from cmlenz to cboos
  • priority changed from normal to high
  • severity changed from normal to minor

Natural sort ordering for milestone names?

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

Changed 3 years ago by cboos

Use natural ordering for Milestones in the roadmap view

Changed 3 years ago by cboos

  • status changed from new to assigned

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.

Changed 3 years ago by anonymous

Nice patch :-)

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

Changed 3 years ago by cmlenz

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

Changed 3 years ago by cmlenz

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.

Changed 3 years ago by cmlenz

See also #2209.

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

Changed 3 years ago by cboos

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

Changed 3 years ago by cboos

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.

Changed 3 years ago by cmlenz

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

Changed 3 years ago by mgood

sort milestones using DSU idiom

Changed 3 years ago by cboos

  • status changed from assigned to closed
  • resolution set to fixed
  • milestone changed from 0.10 to 0.9.4

Finalized version of the patch committed as r2758 and r2759.

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

Changed 3 years ago by mgood

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.

Changed 3 years ago by cboos

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

Changed 3 years ago by mgood

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

Changed 3 years ago by anonymous

  • summary changed from Support custom milestone ordering to Support custom milestone ordering.

Add/Change #1038 (Support custom milestone ordering.)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.