fix(dashboard): use mirror data for issues trend#1001
Open
statxc wants to merge 1 commit intoentrius:testfrom
Open
fix(dashboard): use mirror data for issues trend#1001statxc wants to merge 1 commit intoentrius:testfrom
statxc wants to merge 1 commit intoentrius:testfrom
Conversation
b89ac19 to
3549804
Compare
3549804 to
55bab23
Compare
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 dashboard's "Issues Opened / Resolved" trend graph was sourced from
/issues, which only returns bounty-backed issues. The overview cards right above it use miner aggregates instead, so the two halves of the page disagreed loudly — 33 issues in the chart vs. ~1,000 in the cards.This PR repoints the trend graph at the same population the cards use: a per-miner fan-out to the mirror's
/api/v1/miners/:id/issuesvia the existinguseMinersIssueshelper, flattened and deduped client-side.No backend changes.
Changes
src/api/MinerApi.ts—useMinersIssuesaccepts an optionalsinceISO timestamp, forwarded to the mirror as a query param.src/pages/dashboard/dashboardData.ts—buildDashboardTrendDatanow consumesMinerIssue[]. Two small helpers added:flattenMinerIssues— dedupes responses by(repo, number)so an issue surfaced under multiple miners is counted once.isResolvedMinerIssue—state === 'CLOSED' && state_reason === 'COMPLETED'(NOT_PLANNED / TRANSFERRED are excluded, matching GitHub's "completed" semantic).getMirrorSinceParam— emitssinceonly for theallrange so the cache key stays stable across 1d/7d/35d.src/pages/dashboard/useDashboardData.ts— fans out only to miners with any issue activity to bound the parallel-request count, then flattens throughflattenMinerIssues.src/tests/dashboardIssuesTrend.test.ts— 13 unit tests covering the trend builder, thesincecache-key behavior, dedup across fan-out responses, and the resolved predicate.Known caveat
Aggregates and mirror fan-out won't agree to the last digit. The aggregate counters include issues a miner solved (authored by someone else); the mirror endpoint returns issues a miner authored. The trend graph wants the latter, so this is the right source — but the overview-card totals will still read higher.
Related Issues
Fixes #1000
Type of Change
Screenshots
Checklist
npm run formatandnpm run lint:fixhave been runnpm run buildpasses