Ticket #1038 (closed enhancement: fixed)
Opened 7 years ago
Last modified 6 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: | |||
| Release Notes: | |||
| API 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
Change History
comment:1 Changed 7 years ago by cmlenz
comment:2 Changed 7 years ago by cmlenz
- Severity changed from minor to enhancement
comment:3 Changed 7 years ago by cmlenz
- Milestone 0.9 deleted
- Summary changed from Should order milestone versions supporting common names like alfa, beta, pre, rc... to Support custom milestone ordering
Not for 0.9.
comment:4 Changed 6 years ago by anonymous
- Milestone set to 0.10
- Priority changed from low to normal
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 Changed 6 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 6 years ago by cboos
- Attachment natural_order_sort_for_milestones.diff added
Use natural ordering for Milestones in the roadmap view
comment:6 Changed 6 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.
comment:7 Changed 6 years ago by anonymous
Nice patch :-)
Please check in, and I'd be +1 on porting to 0.9-stable.
comment:8 Changed 6 years ago by cmlenz
(and that was me forgetting to login :-P )
comment:9 Changed 6 years ago by cmlenz
Hold on, actually that breaks the ordering by due date.
The ordering should ideally be:
- completed date (already completed first, completed earlier first)
- due date (due date set first, due date earlier first)
- name (natural order)
in that order.
comment:10 Changed 6 years ago by cmlenz
See also #2209.
Note that the due date sorting is already performed in the SQL query.
Changed 6 years ago by cboos
- Attachment natural_order_sort_for_milestones.2.diff added
Updated patch in order to take the completed and due date into account.
comment:11 Changed 6 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.
comment:12 Changed 6 years ago by cmlenz
This should be moved to the Milestone class so that the ordering is consistent.
Changed 6 years ago by mgood
- Attachment milestone_sort_dsu.diff added
sort milestones using DSU idiom
comment:13 Changed 6 years ago by cboos
- Milestone changed from 0.10 to 0.9.4
- Resolution set to fixed
- Status changed from assigned to closed
comment:14 Changed 6 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 6 years ago by cboos
- Attachment milestone_sort_dsu.2.diff added
Updated mgood's patch so that it applies on top of r2758
comment:15 Changed 6 years ago by mgood
comment:16 Changed 6 years ago by anonymous
- Summary changed from Support custom milestone ordering to Support custom milestone ordering.



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.