Skip to content

Fixed 0.5 day rounding on 0 day round down tasks#5

Open
burrage wants to merge 1 commit into
mainfrom
btt-529
Open

Fixed 0.5 day rounding on 0 day round down tasks#5
burrage wants to merge 1 commit into
mainfrom
btt-529

Conversation

@burrage

@burrage burrage commented Jul 1, 2026

Copy link
Copy Markdown

Round up / round down on calculated days remains the same because of the law of large numbers. However, on 0 day round downs, we want to force a 0.5 days return. SOME effort was made, after all ;-)

Summary by CodeRabbit

  • Bug Fixes
    • Cycle time values now avoid showing 0 and will display 0.5 instead when the rounded result would otherwise be zero.
    • Improves consistency in cycle time reporting for very short durations.

Tasks that would round down to 0 days should be counted as 0.5 days minimum because some effort was expended!
@burrage burrage requested a review from dz4va July 1, 2026 21:01
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 902cf7fe-8ccc-42cc-ad0c-8a221cac1e35

📥 Commits

Reviewing files that changed from the base of the PR and between 1d00719 and fd3126a.

📒 Files selected for processing (1)
  • src/domain/cycleTime.ts

📝 Walkthrough

Walkthrough

The computeCycleTime function in src/domain/cycleTime.ts was modified to store the rounded value in a local variable and return 0.5 instead of 0 when the rounded result equals zero, preventing a zero cycle time value from being returned.

Changes

Cycle Time Rounding Fix

Layer / File(s) Summary
Zero-result guard in computeCycleTime
src/domain/cycleTime.ts
computeCycleTime now assigns roundHalfUp(days) to a local rounded variable and returns 0.5 when rounded === 0, instead of returning roundHalfUp(days) directly.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: tasks that would round down to 0 days now return 0.5 days.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch btt-529

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant