Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/scripts/pull-request-dashboard/publish_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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


Expand Down
18 changes: 12 additions & 6 deletions .github/scripts/pull-request-dashboard/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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 = (
Expand Down Expand Up @@ -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} |"
Expand Down
6 changes: 3 additions & 3 deletions pull-request-dashboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 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. **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. |

Ask a maintainer or admin to add the repository under [Repository access](https://github.com/organizations/open-telemetry/settings/installations/133550497).

Expand Down