From 4fa44e41ca57e1e7836eb5bf184c066122ce74c1 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Thu, 9 Jul 2026 16:02:44 -0700 Subject: [PATCH] Allow large repo dashboard webhooks --- .../pull-request-dashboard/RATIONALE.md | 2 +- .../pull-request-dashboard/dashboard.py | 2 +- .github/workflows/pull-request-dashboard.yml | 30 +------------------ pull-request-dashboard/README.md | 2 +- 4 files changed, 4 insertions(+), 32 deletions(-) diff --git a/.github/scripts/pull-request-dashboard/RATIONALE.md b/.github/scripts/pull-request-dashboard/RATIONALE.md index b485a30c8..27ddfdf91 100644 --- a/.github/scripts/pull-request-dashboard/RATIONALE.md +++ b/.github/scripts/pull-request-dashboard/RATIONALE.md @@ -57,7 +57,7 @@ the implementation understandable and operationally cheap. - Non-PR dashboard runs are backfills, not repository-wide refreshes. They are capped so one run cannot exhaust the dashboard GitHub App's hourly API quota. - Each backfill lists open PRs, prunes cached PRs that are no longer open - non-draft, then refreshes at most 100 open non-draft PRs. + non-draft, then refreshes at most 50 open non-draft PRs. - Selected PRs are processed one at a time through the same single-PR merge path as targeted refreshes. Each accepted PR update pushes structured state before the next selected PR is processed. diff --git a/.github/scripts/pull-request-dashboard/dashboard.py b/.github/scripts/pull-request-dashboard/dashboard.py index 20f5601dd..82775f49b 100644 --- a/.github/scripts/pull-request-dashboard/dashboard.py +++ b/.github/scripts/pull-request-dashboard/dashboard.py @@ -181,7 +181,7 @@ # --- CLI defaults ---------------------------------------------------------- DEFAULT_MODEL = "gpt-5.4-mini" POSITIVE_ACK_REACTIONS = {"THUMBS_UP", "HOORAY", "HEART", "ROCKET"} -DEFAULT_BACKFILL_MAX_PRS = 100 +DEFAULT_BACKFILL_MAX_PRS = 50 # ---------------------------------------------------------------- model helpers diff --git a/.github/workflows/pull-request-dashboard.yml b/.github/workflows/pull-request-dashboard.yml index 970379413..f8a2c31bb 100644 --- a/.github/workflows/pull-request-dashboard.yml +++ b/.github/workflows/pull-request-dashboard.yml @@ -121,31 +121,8 @@ jobs: echo "repository=$(jq -r '.[0].name' <<< "$matrix")" >> "$GITHUB_OUTPUT" echo "$matrix" | jq . - # Webhook-driven runs (trigger_event is a real GitHub event like - # pull_request_review_comment, not schedule/workflow_dispatch) skip - # large_repo targets. Webhook volume on large repos exhausts the App's - # hourly API quota; scheduled backfills and manual dispatches still - # process them. - - name: Check webhook large-repo skip - id: webhook-large-repo-skip - if: steps.trigger.outputs.event != 'schedule' && steps.trigger.outputs.event != 'workflow_dispatch' - env: - TARGET_REPOSITORY: ${{ steps.targets.outputs.repository }} - TRIGGER_EVENT: ${{ steps.trigger.outputs.event }} - run: | - set -euo pipefail - is_large=$(jq -r --arg repo "$TARGET_REPOSITORY" ' - [ .[] | select(.name == $repo) | .large_repo // false ][0] // false - ' "$DASHBOARD_CONFIG") - if [[ "$is_large" == "true" ]]; then - echo "Skipping webhook-driven run for large_repo target ($TARGET_REPOSITORY, event=$TRIGGER_EVENT)." - echo "skip=true" >> "$GITHUB_OUTPUT" - fi - - uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 - if: >- - steps.trigger.outputs.pr_number != '' && - steps.webhook-large-repo-skip.outputs.skip != 'true' + if: steps.trigger.outputs.pr_number != '' id: dashboard-token with: client-id: ${{ vars.PR_DASHBOARD_CLIENT_ID }} @@ -159,14 +136,9 @@ jobs: env: GH_TOKEN: ${{ steps.dashboard-token.outputs.token }} TRIGGER_PR_NUMBER: ${{ steps.trigger.outputs.pr_number }} - WEBHOOK_LARGE_REPO_SKIP: ${{ steps.webhook-large-repo-skip.outputs.skip }} REPO: open-telemetry/${{ steps.targets.outputs.repository }} run: | set -euo pipefail - if [[ "${WEBHOOK_LARGE_REPO_SKIP:-}" == "true" ]]; then - echo "met=false" >> "$GITHUB_OUTPUT" - exit 0 - fi if [[ -z "$TRIGGER_PR_NUMBER" ]]; then echo "met=true" >> "$GITHUB_OUTPUT" exit 0 diff --git a/pull-request-dashboard/README.md b/pull-request-dashboard/README.md index 9ccadc183..9e56fba3f 100644 --- a/pull-request-dashboard/README.md +++ b/pull-request-dashboard/README.md @@ -64,7 +64,7 @@ Fields: | `required_approvals` | yes | Number of approvals required for an open PR to be marked ready to merge. | | `slack_channel` | no | Slack channel for notifications. Omit to skip Slack processing for this repository. | | `slack_user_mapping` | no | Map of GitHub login to Slack user ID for at-mentions. | -| `large_repo` | no | If `true`, apply rendering presets that keep the dashboard body under GitHub's 65,536-character issue-body limit: cap each section (each *Waiting on …* table, the *Draft pull requests* table, and the *Diagnostics* block) at 50 rows, and omit the *Draft pull requests* section entirely. Truncated sections get a `_More X PRs not shown_` footer. Defaults to `false` (no cap, drafts shown). Enable this for very large repos with hundreds of PRs. **Also affects triggering**: webhook-driven runs are skipped for `large_repo` targets to avoid exhausting the App's hourly API quota. Hourly scheduled runs and manual `Run workflow` clicks still process them. | +| `large_repo` | no | If `true`, apply rendering presets that keep the dashboard body under GitHub's 65,536-character issue-body limit: cap each section (each *Waiting on …* table, the *Draft pull requests* table, and the *Diagnostics* block) at 50 rows, and omit the *Draft pull requests* section entirely. Truncated sections get a `_More X PRs not shown_` footer. Defaults to `false` (no cap, drafts shown). Enable this for very large repos with hundreds of PRs. | Ask a maintainer or admin to add the repository under [Repository access](https://github.com/organizations/open-telemetry/settings/installations/133550497).