fix(dashboard): correct double count in OSS Contributions and Issue Discoveries pools#1181
Open
blinkeye-lcm wants to merge 1 commit into
Open
Conversation
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
The OSS Contributions and Issue Discoveries overview cards on the dashboard were double counting PRs.
getPrOverviewMetricsin src/pages/dashboard/dashboardData.ts ran three independentifbranches against the created, merged, and closed timestamps, incrementing separate counters in each branch. A PR created and merged in the same window therefore contributed +1 to Open, +1 to Merged, and +2 to Total. The Open tile also incremented for every PR created in the window regardless of its terminal state, so merged or closed PRs inflated the Open count too.The fix classifies each PR once via
getPrStatusLabel, pairs it with the timestamp that produced its terminal state (mergedAtfor Merged,closedAt ?? prCreatedAtfor Closed,prCreatedAtfor Open), and increments exactly one bucket. Total becomes the sum of the three buckets by construction, so the donut segments partition the window relevant PRs cleanly andTotal === Merged + Open + Closedis structurally enforced.The
closedAt ?? prCreatedAtfallback (carried over from the previous logic) is preserved so closed PRs are still tracked while the API does not returnclosedAt. The return shape is unchanged, so the chart center label (Merged / (Merged + Closed)) and the delta arrows on both pools continue to work without modification.Related Issues
Fixes #1180
Type of Change
Screenshots
Not applicable. No rendering code changed, only the counts feeding the existing tiles and donut chart.
Checklist
npm run formatandnpm run lint:fixhave been runnpm run buildpasses