diff --git a/.github/scripts/pull-request-dashboard/publish_dashboard.py b/.github/scripts/pull-request-dashboard/publish_dashboard.py index 9c5bc87b6..25cb48b33 100644 --- a/.github/scripts/pull-request-dashboard/publish_dashboard.py +++ b/.github/scripts/pull-request-dashboard/publish_dashboard.py @@ -17,7 +17,8 @@ DASHBOARD_LABEL = "dashboard" DASHBOARD_LABEL_COLOR = "cfd3d7" DASHBOARD_LABEL_DESCRIPTION = "Pull request dashboard" -LARGE_REPO_MAX_ROWS_PER_SECTION = 50 +ISSUE_BODY_MAX_CHARS = 65536 +LARGE_REPO_MAX_ROWS_PER_SECTION = 100 # GraphQL is used instead of the REST `/repos/{repo}/issues` list endpoint @@ -157,9 +158,14 @@ def render_dashboard_markdown(repo: str, large_repo: bool) -> Path: output_path.write_text(md, encoding="utf-8") print( f"rendered dashboard markdown to {output_path.resolve()} " - f"({len(md)} chars, GitHub issue-body limit is 65536)", + f"({len(md)} chars, GitHub issue-body limit is {ISSUE_BODY_MAX_CHARS})", file=sys.stderr, ) + if len(md) > ISSUE_BODY_MAX_CHARS: + raise RuntimeError( + f"rendered dashboard markdown is {len(md)} chars, which exceeds " + f"GitHub's {ISSUE_BODY_MAX_CHARS}-character issue-body limit" + ) return output_path diff --git a/.github/scripts/pull-request-dashboard/render.py b/.github/scripts/pull-request-dashboard/render.py index 224583b45..328920b6b 100644 --- a/.github/scripts/pull-request-dashboard/render.py +++ b/.github/scripts/pull-request-dashboard/render.py @@ -59,10 +59,11 @@ def render_draft_pr_section( for pr in drafts: number = pr["number"] title = _md_escape(pr.get("title", "")) - url = pr.get("url", "") author = actor_login(pr.get("author") or {}) updated = activity_age(parse_ts(pr.get("updatedAt") or "")) - lines.append(f"| [{title} (#{number})]({url}) | {author} | {updated} |") + # GitHub autolinks same-repo PR numbers; avoid full URLs so large + # dashboards can show more PRs before hitting the issue body limit. + lines.append(f"| #{number} {title} | {author} | {updated} |") lines.append("") if truncated: lines.append(_truncation_note(truncated)) @@ -194,9 +195,13 @@ def render_pr_tables( ) -> str: source_url = "https://github.com/open-telemetry/shared-workflows/blob/main/.github/scripts/pull-request-dashboard/dashboard.py" refresh_url = "https://github.com/open-telemetry/shared-workflows/actions/workflows/pull-request-dashboard.yml" + draft_note = ( + "Draft PRs are omitted to keep this dashboard concise." + if skip_drafts + else "Draft PRs are listed separately." + ) grouping_note = ( - "Open non-draft PRs grouped by who is expected to act next. Draft PRs are " - "listed separately. The grouping is " + f"Open non-draft PRs grouped by who is expected to act next. {draft_note} The grouping is " f"partly performed by an LLM ([source]({source_url})) and could contain mistakes." ) reviewers_note = ( @@ -240,13 +245,14 @@ def row_sort_key(pr: dict[str, Any]) -> tuple[int, int]: for pr in rows: number = pr["number"] title = _md_escape(pr.get("title", "")) - url = pr.get("url", "") res = results.get(number) or {} facts = res.get("facts") or {} author = facts.get("author") or actor_login(pr.get("author") or {}) reviewers_cell = reviewers_cell_text(facts) activity_cell = age_cell(facts) - pr_cell = f"[{title} (#{number})]({url})" + # GitHub autolinks same-repo PR numbers; avoid full URLs so large + # dashboards can show more PRs before hitting the issue body limit. + pr_cell = f"#{number} {title}" out.append( f"| {pr_cell} | {author} | {reviewers_cell} | {ci_cell(facts)} | " f"{conflicts_cell(facts)} | {activity_cell} |" diff --git a/pull-request-dashboard/README.md b/pull-request-dashboard/README.md index 9e56fba3f..355515f16 100644 --- a/pull-request-dashboard/README.md +++ b/pull-request-dashboard/README.md @@ -10,9 +10,9 @@ The classification cache reuses prior results for unchanged review threads, mini ## Dashboard columns -The dashboard groups open non-draft pull requests by who is expected to act next (e.g. *Waiting on reviewers*, *Waiting on authors*, *Waiting on maintainers*, *Waiting on external*). Draft PRs are listed separately at the bottom. Within each group, rows are sorted longest-waiting first. Every row has these six columns: +The dashboard groups open non-draft pull requests by who is expected to act next (e.g. *Waiting on reviewers*, *Waiting on authors*, *Waiting on maintainers*, *Waiting on external*). Draft PRs are listed separately at the bottom unless `large_repo` rendering is enabled. Within each group, rows are sorted longest-waiting first. Every row has these six columns: -- **PR** — Pull request title and number, linked to the PR on GitHub. +- **PR** — Pull request number and title. The number autolinks to the PR on GitHub. - **Author** — GitHub login of the PR author. - **Reviewers** — Reviewers who have engaged with the PR, each annotated with one or more icons: - ✅ approved @@ -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. | +| `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 100 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).