Skip to content

Add PR dashboard backfill cap#46

Merged
trask merged 1 commit into
open-telemetry:mainfrom
trask:rate-limit
Jul 8, 2026
Merged

Add PR dashboard backfill cap#46
trask merged 1 commit into
open-telemetry:mainfrom
trask:rate-limit

Conversation

@trask

@trask trask commented Jul 8, 2026

Copy link
Copy Markdown
Member

(hopefully) resolves #40

Add a bounded PR dashboard backfill path for non-PR runs. Backfills process open non-draft PRs one at a time, persist progress in backfill-state.json, prune stale cached entries, and still publish accepted markdown when no PRs are selected, reducing repeated GitHub App GraphQL quota spend when large repositories hit state-branch CAS conflicts.

@trask trask force-pushed the rate-limit branch 3 times, most recently from 89e3e95 to b620f97 Compare July 8, 2026 02:09
@trask trask requested a review from Copilot July 8, 2026 02:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR replaces the dashboard's unbounded "full rebuild" for non-PR (scheduled/manual) runs with a bounded backfill path. Instead of refreshing every open PR in one write, a backfill lists open PRs, prunes stale cached entries, and refreshes at most DEFAULT_BACKFILL_MAX_PRS (100) open non-draft PRs one at a time — each as its own single-PR state-branch transaction — advancing a persisted cursor (backfill-state.json) in round-robin PR-number order. This keeps compare-and-swap retries cheap on large repos and avoids exhausting the dashboard GitHub App's hourly GraphQL quota. Documentation and workflow terminology are updated from "full rebuild" to "backfill".

Changes:

  • Add backfill-state.json state with load/save/empty helpers and a STATE_VERSION comment update in state.py.
  • Add capped, cursor-driven backfill orchestration in dashboard.py (select_backfill_prs, round_robin_numbers, update_dashboard_for_pr, update_backfill_cursor, cleanup_dashboard_state, render_and_save_dashboard, update_capped_backfill_with_state) and route no-PR runs to it.
  • Update README/RATIONALE/WEBHOOK_SETUP and workflow comments to reflect "backfill" semantics and the per-repo PR cap.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.github/scripts/pull-request-dashboard/dashboard.py Core backfill logic: selection, cursor round-robin, per-PR transactions, extracted render/save helper, dispatch of no-PR runs to backfill.
.github/scripts/pull-request-dashboard/state.py Adds backfill-state.json path, empty/load/save helpers, and clarifies the state-version comment.
.github/scripts/pull-request-dashboard/RATIONALE.md Documents backfill design, cursor, cap, and failure/cursor behavior.
pull-request-dashboard/README.md Renames "Manual full run" → "Manual backfill run" and documents the PR cap.
.github/workflows/pull-request-dashboard.yml Updates input description and comments to "backfill" terminology.
.github/workflows/pull-request-dashboard-repo.yml Renames the shared classification cache step to "backfill".
.github/scripts/pull-request-dashboard/WEBHOOK_SETUP.md Updates wording from "full rebuild" to "backfill".

Notes: The cursor round-robin and CAS/cursor-advancement semantics are correct across the edge cases I checked (closed cursor PR, wrap-around, mid-run failure). Two minor maintainability nits are flagged inline. One side effect of the refactor is that compute_pr_results/update_dashboard are now only invoked with a concrete PR number, leaving the parallel full-rebuild branch (and DEFAULT_JOBS) unreachable.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/scripts/pull-request-dashboard/dashboard.py Outdated
Comment thread .github/scripts/pull-request-dashboard/dashboard.py Outdated
@trask trask requested a review from Copilot July 8, 2026 02:27
@trask trask force-pushed the rate-limit branch 2 times, most recently from 1a95011 to e3e27a3 Compare July 8, 2026 02:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread .github/scripts/pull-request-dashboard/dashboard.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread .github/scripts/pull-request-dashboard/dashboard.py
Comment thread .github/scripts/pull-request-dashboard/dashboard.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@trask trask marked this pull request as ready for review July 8, 2026 03:45
@trask trask requested a review from a team as a code owner July 8, 2026 03:45
@trask trask merged commit 9cb82c0 into open-telemetry:main Jul 8, 2026
5 checks passed
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.

PR Dashboard: GraphQL: API rate limit already exceeded for installation ID 133550497

3 participants