perf(dashboard): replace timelineItems with top-level updatedAt to reduce API calls#5537
perf(dashboard): replace timelineItems with top-level updatedAt to reduce API calls#5537q404365631 wants to merge 3 commits into
Conversation
❌ Deploy Preview for asyncapi-website failed.Built without sensitive environment variables
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughReplaces nested ChangesDashboard updatedAt field simplification
🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/dashboard/build-dashboard.test.ts`:
- Around line 502-513: The object literals recentDiscussion and olderDiscussion
are malformed due to extra closing braces/commas after the updatedAt properties;
open the objects defined by recentDiscussion and olderDiscussion (referencing
the constants recentDiscussion and olderDiscussion in build-dashboard.test.ts),
remove the stray "}," that closes the object early, and ensure each object
contains all intended spread properties, id (for olderDiscussion), and updatedAt
followed by a single closing brace and comma separating declarations so the test
file parses correctly.
In `@tests/fixtures/dashboardData.ts`:
- Line 18: The fixture objects for the discussion entries are malformed due to
an extra closing brace placed immediately after the updatedAt property (e.g.,
the line containing "updatedAt: new Date().toISOString() }"), which prematurely
ends the object and leaves the reviews array outside the literal; remove that
stray "}" so the object contains updatedAt and reviews together (ensure the
object opening brace that defines the discussion fixture and its closing brace
encompass reviews), then run the tests to confirm the fixture parses correctly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f5e6a07e-72bf-4f70-a7fe-5f21ee2270f9
📒 Files selected for processing (6)
docs/DASHBOARD_GITHUB_DATA_COLLECTION.mdscripts/dashboard/build-dashboard.tsscripts/dashboard/issue-queries.tstests/dashboard/build-dashboard.test.tstests/fixtures/dashboardData.tstypes/scripts/dashboard.ts
💤 Files with no reviewable changes (1)
- types/scripts/dashboard.ts
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5537 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 23 23
Lines 931 931
Branches 180 180
=========================================
Hits 931 931 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|



What
Replaces the deeply-nested
timelineItems(first: 1) { updatedAt }GraphQL lookup with the top-levelupdatedAtfield that's already available on every Issue / PullRequest node. This eliminates a separate resource fetch per item.Why
Per #5168,
IssueandPullRequestalready exposeupdatedAtat the top level, so the nestedtimelineItemstraversal was redundant. As the dashboard docstring notes (docs/DASHBOARD_GITHUB_DATA_COLLECTION.md), the script makes 30 timeline lookups per query run — a pure win to drop.Changes
scripts/dashboard/issue-queries.ts: 3 query fragments (PR... on PullRequest, recent discussions, hot discussions) no longer fetchtimelineItems.scripts/dashboard/build-dashboard.ts: Referencesitem.updatedAtdirectly.types/scripts/dashboard.ts: Removed theTimelineItemsinterface and thetimelineItems: TimelineItemsfields onPullRequestById,IssueById,HotDiscussionsIssuesNode,HotDiscussionsPullRequestsNode.tests/fixtures/dashboardData.tsandtests/dashboard/build-dashboard.test.ts: Updated fixtures and test mocks to useupdatedAtdirectly.docs/DASHBOARD_GITHUB_DATA_COLLECTION.md: Updated cost analysis table.Net diff
6 files changed, 10 insertions(+), 27 deletions(-)
Closes #5168
Summary by CodeRabbit
Improvements
Documentation
Refactor