Skip to content

fix: pr timeline#88

Merged
waltergalvao merged 3 commits intomainfrom
fix/pr-timeline
Feb 22, 2026
Merged

fix: pr timeline#88
waltergalvao merged 3 commits intomainfrom
fix/pr-timeline

Conversation

@waltergalvao
Copy link
Copy Markdown
Contributor

@waltergalvao waltergalvao commented Feb 22, 2026

Greptile Summary

Fixed personal metrics date range calculations and PR timeline rendering issues. Changed SQL queries to use NOW() instead of CURRENT_DATE for more accurate time-based filtering, switched from createdAt to mergedAt for PR size metrics, fixed cycleTime display condition to properly handle 0 values, and updated approval badge variant for better UX.

Key changes:

  • Switched date interval calculations from CURRENT_DATE to NOW() with 30-day periods (previously 29 days)
  • Changed PR size metrics to filter by mergedAt instead of createdAt for more accurate merged PR counts
  • Fixed cycleTime conditional rendering using !!cycleTime to properly handle 0 values
  • Changed approval badge from 'warning' to 'default' variant when timeToFirstApproval is null

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • All changes are bug fixes with clear intent - date range calculations are corrected, timeline rendering handles edge cases properly, and badge variants are appropriately adjusted. No breaking changes or risky logic introduced.
  • No files require special attention

Important Files Changed

Filename Overview
apps/api/src/app/metrics/services/personal-metrics.service.ts Changed date calculations from CURRENT_DATE to NOW() and from createdAt to mergedAt for PR size metrics
apps/web/src/components/card-pull-request/timeline-pull-request.tsx Fixed falsy check for cycleTime using !! to properly handle 0 values
apps/web/src/components/card-pull-request/use-badges.tsx Changed approval badge variant from 'warning' to 'default' when no timeToFirstApproval exists

Last reviewed commit: 59341b6

@dev-sweetr-dev dev-sweetr-dev Bot added the tiny Tiny PR - Quick and easy to review label Feb 22, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 22, 2026

Walkthrough

Small UI adjustments and backend metric query changes: cycleTime rendering boolean coercion and approval badge variant change in the PR card UI; metrics service switches date/timestamp boundaries and uses mergedAt for several PR metrics, plus added console logging.

Changes

Cohort / File(s) Summary
Pull Request Card UI
apps/web/src/components/card-pull-request/timeline-pull-request.tsx, apps/web/src/components/card-pull-request/use-badges.tsx
Adjusted cycleTime rendering to use explicit boolean coercion and changed approval badge variant from warning to default when time-to-first-approval is missing.
Personal Metrics Service (API)
apps/api/src/app/metrics/services/personal-metrics.service.ts
Switched date boundary semantics from CURRENT_DATE to NOW() with 30/60-day windows, changed PR counts to use mergedAt instead of createdAt for several metrics, and added console.log statements for result/workspaceId/personId.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

small

Suggested reviewers

  • sweetrdev
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: pr timeline' directly matches the main changes—two focused UI bug fixes in the PR timeline component without covering all implementation details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description accurately describes the changeset, detailing fixes for cycle time rendering and approval badge variants across three modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/pr-timeline

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 and usage tips.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

coderabbitai[bot]
coderabbitai Bot previously approved these changes Feb 22, 2026
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment thread apps/api/src/app/metrics/services/personal-metrics.service.ts Outdated
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/api/src/app/metrics/services/personal-metrics.service.ts">

<violation number="1" location="apps/api/src/app/metrics/services/personal-metrics.service.ts:110">
P2: Remove the debug console.log or replace it with the service’s structured logger if needed.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread apps/api/src/app/metrics/services/personal-metrics.service.ts Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/api/src/app/metrics/services/personal-metrics.service.ts`:
- Line 110: Remove the debug console.log that prints raw results and user-scoped
identifiers: delete the line console.log("result", result, workspaceId,
personId) from the PersonalMetricsService method (the function that computes
personal metrics—compare to getCodeReviewMetrics which has no log). If you need
logging, use the service's structured logger (e.g., processLogger / this.logger)
and log only non-PII summaries (counts/aggregates) rather than workspaceId,
personId or raw query results.

Comment thread apps/api/src/app/metrics/services/personal-metrics.service.ts Outdated
@waltergalvao waltergalvao merged commit 421ab47 into main Feb 22, 2026
10 checks passed
@waltergalvao waltergalvao deleted the fix/pr-timeline branch March 15, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tiny Tiny PR - Quick and easy to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants