Skip to content
Merged
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
26 changes: 24 additions & 2 deletions scripts/org_triage.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ def unpinned_actions(full: str) -> list[str] | None:
def render(reports: list[dict]) -> tuple[str, bool]:
"""The report, and whether anything in it needs a decision."""
urgent: list[str] = []
ready: list[str] = []
waiting: list[str] = []
quiet: list[str] = []
drifting: list[str] = []
Expand All @@ -265,8 +266,28 @@ def render(reports: list[dict]) -> tuple[str, bool]:
elif pull["bot"]:
waiting.append(f"{line} — {pull['age']}d, checks {pull['checks']}")
interesting = True
elif pull["checks"] in ("green", "none") and not pull["draft"]:
# Green, not a draft, author is not a bot: everything that can be
# automated has happened and the only thing left is somebody
# deciding. That is the question this report asks, so it belongs
# here rather than waiting for STALE_DAYS.
#
# It was not here before, and decisionrl#31 is why: green on every
# leg including the forty-minute learning job, open twenty-four
# days, and this report called the repository quiet -- because red
# checks were the only thing that counted as needing you, and
# thirty days the only thing that counted as old.
# "none" means no check ever ran, which in a repository without
# CI is every pull request in it. .github#7 has been open and
# cleanly mergeable for forty-one days on exactly that basis, and
# calling it unchecked rather than green is the honest wording.
state = "Green" if pull["checks"] == "green" else "No checks ran, and mergeable,"
ready.append(
f"{line}\n {state} for {pull['age']} days and waiting on a decision."
)
interesting = True
elif pull["age"] >= STALE_DAYS:
drifting.append(f"{line} — open {pull['age']} days")
drifting.append(f"{line} — open {pull['age']} days, checks {pull['checks']}")
interesting = True

ci = report["ci"]
Expand Down Expand Up @@ -313,6 +334,7 @@ def section(title: str, lines: list[str]) -> str:
parts = [
f"_Generated {NOW:%Y-%m-%d %H:%M} UTC._\n",
section("Needs you this week", urgent),
section("Green and waiting on you", ready),
section("Waiting on review", waiting),
section("Quiet", [", ".join(quiet)] if quiet else []),
section("Drifting", drifting),
Expand All @@ -329,7 +351,7 @@ def section(title: str, lines: list[str]) -> str:
)
)

return "\n".join(parts), bool(urgent)
return "\n".join(parts), bool(urgent or ready)


def main() -> int:
Expand Down
Loading