Defect #33576

Done ratio of a parent issue may be shown as 99% even though all subtasks are completed

Added by Go MAEDA 28 days ago. Updated 23 days ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Issues
Target version:4.0.8
Resolution:Fixed Affected version:4.0.0

Description

Due to a rounding error at source:tags/4.1.1/app/models/issue.rb#L1717, a parent task may show 99% done even when all subtasks are 100% done.

irb(main):001:0> 1610 / 16.1
=> 99.99999999999999

Steps to reproduce:

1. Set "% Done" setting (Administration > Settings > Issue tracking) to "Calculated from subtasks"
2. Create a parent task.
3. Create a subtask 1 with 10.0 estimated hours and 100% done ratio
4. Create a subtask 2 with 6.1 estimated hours and 100% done ratio
5. Now the done ratio of the parent task shows 99% instead of 100%

clipboard-202006101529-abpb8.png (53.4 KB) Go MAEDA, 2020-06-10 08:47

fix-33576.patch Magnifier (1.4 KB) Go MAEDA, 2020-06-10 10:18

fix-33576-v2.patch Magnifier (1.94 KB) Go MAEDA, 2020-06-10 11:33


Related issues

Related to Redmine - Defect #27848: The progress exceeding 99.5% is displayed as 100% Closed

Associated revisions

Revision 19818
Added by Go MAEDA 24 days ago

Done ratio of a parent issue may be shown as 99% even though all subtasks are completed (#33576).

Patch by Go MAEDA.

Revision 19819
Added by Go MAEDA 24 days ago

Merged r19818 from trunk to 4.1-stable (#33576).

Revision 19820
Added by Go MAEDA 24 days ago

Merged r19818 from trunk to 4.0-stable (#33576).

History

#1 Updated by Go MAEDA 28 days ago

  • Related to Defect #27848: The progress exceeding 99.5% is displayed as 100% added

#2 Updated by Go MAEDA 28 days ago

  • File fix-33576.patchMagnifier added
  • Target version set to Candidate for next minor release

Attaching a patch that fixes the issue.

#3 Updated by Go MAEDA 28 days ago

Updated the patch not to use Float in the calculation process of a derived done ratio.

#4 Updated by Anonymous 28 days ago

  • File 4.jpg added

#5 Updated by Go MAEDA 28 days ago

  • File deleted (4.jpg)

#6 Updated by Go MAEDA 27 days ago

  • Target version changed from Candidate for next minor release to 4.0.8

Setting the target version to 4.0.8.

#7 Updated by Go MAEDA 24 days ago

  • Subject changed from Parent task may show 99% done even when all subtasks are 100% done to Done ratio of a parent issue may be shown as 99% even though all subtasks are completed
  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch.

#8 Updated by Sebastian Paluch 23 days ago

There are also other issues in Done ration calculation #21449

Also available in: Atom PDF