Defect #23151

done_ratio calculation with multi-level sub tasks and estimated hours

Added by Gregor Schmidt over 1 year ago. Updated 5 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Issues
Target version:-
Resolution:Duplicate Affected version:3.2.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.

test.rb Magnifier - Test file highlighting the problem (2.42 KB) Gregor Schmidt, 2016-06-23 15:25


Related issues

Duplicates Redmine - Defect #23511: Progress of parent task should be calculated using total ... Closed

History

#1 Updated by Gregor Schmidt over 1 year ago

I can try to work on a fix, once we know, how Redmine should behave in the second case.

#2 Updated by Toshi MARUYAMA over 1 year ago

Is this issue related with #22504?

#3 Updated by Go MAEDA 5 months ago

  • Duplicates Defect #23511: Progress of parent task should be calculated using total estimated hours of children added

#4 Updated by Go MAEDA 5 months 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

Also available in: Atom PDF