Defect #20995

Automatic done ratio calculation in issue tree is wrong in some cases

Added by Felix Schäfer over 2 years ago. Updated over 2 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Issues
Target version:3.2.0
Resolution:Fixed Affected version:

Description

Currently the done ratio of parent issues in an issue tree is calculated based on the average of done ratios of the leaves bellow that issue source:/tags/3.1.1/app/models/issue.rb#L1491. This however can lead to inconsistencies in the automatically calculated done ratios.

For example: issue C with a done ratio of 50% and an open status, which is a subtask of issue B with a done ratio of 70% automatically set by its (open) status, which itself is a subtask of issue A, with a status that doesn't automatically set the done ratio. In that case, A will have an automatically calculated done ratio of 50% because it will be calculated based on the leaf's done ratios, i.e. from C, although its only direct child has a done ratio of 70%.

Is there any rationale to keeping the calculation of the done ratio based on the leaves? I would like to change it to be calculated based on the done ratios of the direct children. If this is an acceptable change I can work on a patch.

calculate_done_ratio_from_children_20995.diff Magnifier (2.31 KB) Jens Krämer, 2015-10-21 10:19


Related issues

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

Associated revisions

Revision 14875
Added by Jean-Philippe Lang over 2 years ago

Calculate done_ratio based on children instead of leaves (#20995).

Patch by Jens Krämer.

History

#1 Updated by Felix Schäfer over 2 years ago

As a side-note: I'm aware of #6609, this is not directly related though.

#2 Updated by Jens Krämer over 2 years ago

here's a patch switching done ratio calculation from the leaves to direct children, and a test illustrating the problem.

#3 Updated by Toshi MARUYAMA over 2 years ago

  • Target version set to 3.2.0

#4 Updated by Jean-Philippe Lang over 2 years ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

#5 Updated by Toshi MARUYAMA almost 2 years ago

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

Also available in: Atom PDF