Project

General

Profile

Actions

Defect #23151

closed

done_ratio calculation with multi-level sub tasks and estimated hours

Added by Gregor Schmidt almost 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Issues
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Duplicate
Affected version:

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

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

Related issues

Is duplicate of Redmine - Defect #23511: Progress of parent task should be calculated using total estimated hours of childrenClosedJean-Philippe Lang

Actions
Actions #1

Updated by Gregor Schmidt almost 8 years ago

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

Actions #2

Updated by Toshi MARUYAMA over 7 years ago

Is this issue related with #22504?

Actions #3

Updated by Go MAEDA over 6 years ago

  • Is duplicate of Defect #23511: Progress of parent task should be calculated using total estimated hours of children added
Actions #4

Updated by Go MAEDA over 6 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

Actions

Also available in: Atom PDF