Skip to content

Commit 163aa2a

Browse files
committed
more
1 parent 35629e2 commit 163aa2a

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

.github/scripts/pull-request-dashboard.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ def classify_threads(
797797

798798

799799
SIDE_LABELS = {
800-
"maintainer": "Waiting on maintainer (approved)",
800+
"maintainer": "Waiting on maintainers",
801801
"approver": "Waiting on approvers",
802802
"author": "Waiting on authors",
803803
"external": "Waiting on external",
@@ -954,15 +954,21 @@ def render_markdown_compact(
954954
res = results.get(pr["number"]) or {"side": "unknown"}
955955
by_side.setdefault(res.get("side") or "unknown", []).append(pr)
956956

957+
def row_sort_key(pr: dict[str, Any]) -> tuple[int, int]:
958+
res = results.get(pr["number"]) or {}
959+
facts = res.get("facts") or {}
960+
activity = facts.get("days_since_last_activity")
961+
return (activity if isinstance(activity, int) else -1, pr["number"])
962+
957963
for side in SIDE_ORDER:
958964
rows = by_side.get(side) or []
959965
if not rows:
960966
continue
961-
rows.sort(key=lambda p: -p["number"])
967+
rows.sort(key=row_sort_key, reverse=True)
962968
out.append(f"## {SIDE_LABELS.get(side, side)}")
963969
out.append("")
964-
out.append("| PR | Author | CI | Conflicts | Approved | Activity |")
965-
out.append("|---|---|---|---|---|---|")
970+
out.append("| PR | Author | CI | Conflicts | Inactive |")
971+
out.append("|---|---|:---:|:---:|:---:|")
966972
for pr in rows:
967973
number = pr["number"]
968974
title = _md_escape(pr.get("title", ""))
@@ -972,9 +978,12 @@ def render_markdown_compact(
972978
author = facts.get("author") or actor_login(pr.get("author") or {})
973979
activity = facts.get("days_since_last_activity")
974980
activity_cell = "?" if activity is None else f"{activity}d"
981+
pr_cell = f"[{title} (#{number})]({url})"
982+
if facts.get("approved"):
983+
pr_cell += " ✅"
975984
out.append(
976-
f"| [{title}]({url}) | {author} | {ci_cell(facts)} | "
977-
f"{conflicts_cell(facts)} | {approved_cell(facts)} | {activity_cell} |"
985+
f"| {pr_cell} | {author} | {ci_cell(facts)} | "
986+
f"{conflicts_cell(facts)} | {activity_cell} |"
978987
)
979988
out.append("")
980989

0 commit comments

Comments
 (0)