Defect #23151
closeddone_ratio calculation with multi-level sub tasks and estimated hours
0%
Description
Using the Setting parent_issue_done_ratio=derived
and given the following issue hierarchy:
[1_0_0] - (3h) | | | +- [1_1_0] - 1h | +--- [1_2_0] - (2h) | | | +- [1_2_1] - 1h | +--- [1_2_1] - 1h
When I set [1_1_0]
to status closed, the done ratio of [1_0_0]
is recalculated.
Since 1h of 3h of work are done, the derived done ratio of [1_0_0]
should be 33%. In current Redmine trunk r15582 the actual value is 50%, since the done ratio is solely based on the direct children and their estimated hours. The code was introduced with 3.2.0, r14875, #20995.
It gets more complicated when adding estimates on parent nodes (introduced in 3.1.0, r14272, #16092):
[2_0_0] - 1h (Total 5h) | | | +- [2_1_0] - 1h (Total 1h) | +--- [2_2_0] - 1h (Total 3h) | | | +- [2_2_1] - 1h (Total 1h) | +--- [2_2_1] - 1h (Total 1h)
Estimated hours on parent tasks are added to the estimated hours of the issue's sub tasks. The total estimated hours is the sum of all issues within the sub tree.
When I set [2_1_0]
to status closed, the done ratio of [2_0_0]
is recalculated.
Now 1h of 4h of work on the sub tasks are done, the derived done ratio of [2_0_0]
should therefore be 25%. Similarly one could argue that 1h of 5h on the whole issue tree are done, the derived done ratio of [2_0_0]
should therefore be 20%.
But in current Redmine trunk r15582 the actual value is 50%, since the done ratio is solely based on the direct children and their estimated hours.
Attached are some easy tests highlighting the problem.
Files
Related issues
Updated by Gregor Schmidt over 8 years ago
I can try to work on a fix, once we know, how Redmine should behave in the second case.
Updated by Go MAEDA over 7 years ago
- Is duplicate of Defect #23511: Progress of parent task should be calculated using total estimated hours of children added
Updated by Go MAEDA over 7 years ago
- Status changed from New to Closed
- Resolution set to Duplicate
Fixed by #23511 (Redmine 3.4.0).
The following is the result of test.rb.
Redmine 3.4.0:
$ ruby test/unit/test.rb Run options: --seed 56678 # Running: .. Finished in 2.658778s, 0.7522 runs/s, 0.7522 assertions/s. 2 runs, 2 assertions, 0 failures, 0 errors, 0 skips
Redmine 3.4.0 with reverse patching r15802:
$ ruby test/unit/test.rb Run options: --seed 56751 # Running: FF Finished in 3.169551s, 0.6310 runs/s, 0.6310 assertions/s. 1) Failure: IssueSubtaskingTest#test_parent_done_ratio_with_estimated_hours_and_multiple_levels_of_children [test/unit/test.rb:38]: Expected: 33 Actual: 50 2) Failure: IssueSubtaskingTest#test_parent_done_ratio_with_estimated_hours_and_multiple_levels_of_children_part_two [test/unit/test.rb:69]: Expected: 25 Actual: 50 2 runs, 2 assertions, 2 failures, 0 errors, 0 skips