Watch
0
0
Fork
You've already forked hyperhive
0

swarm ui: a pull requests card on the reports tab

The reports tab gets a "pull requests" card under the issue report. It lists
the open PRs of every repo, or of one picked in a repo select, with the
columns a reviewer or merger filters on: author, labels, requested
reviewers, base branch, WIP (the forge's draft flag), approvals against the
base branch's protection rule, has all approvals, conflicts, protected base
and CI. Every column sorts, the small-set columns filter by picking values,
and the browser keeps the filters and the repo. No filter applies at first.

swarm-controller resolves each row so the page makes no calls of its own:
GET /api/pr-report and GET /api/repos/{org}/{repo}/pr-report. The required
approvals come from the first matching branch protection rule (an
unprotected base asks for none); an approval counts when it is the
reviewer's latest decision, on the current head, neither stale nor
dismissed and official.

A free-text table cell gets a minimum width, so a table with many columns
scrolls sideways instead of wrapping a title to a word a line.
This commit is contained in:
iris 2026-11-07 10:06:59 +01:00 • committed by mara
commit f633963b77

View file

@ -587,6 +587,37 @@ fail on their own: a repo list that fails to load shows its error beside the
report, and a report that fails to load clears the table instead of leaving the
previous repo's issues under the error.
### Pull requests
The **pull requests** card, below the issue report on the **reports** tab, lists the open
pull requests of every repo that has one, from `GET /api/pr-report`, or of one
repo from `GET /api/repos/{org}/{repo}/pr-report`. It starts shut and reads
nothing until you open it. The **repo** select lists the repos from
`GET /api/pulls/repos`, and picking one fetches that repo's report. No filter
applies at first.
Each row shows the repo, the PR, its title, author, labels, requested reviewers
and base branch, and what a reviewer or merger filters on:
- **WIP**: the forge's draft flag. Giving the title a `WIP:` prefix sets it.
- **approvals**: how many approvals count against how many the base branch's protection
rule asks for (`1/2`). An approval counts when it stands as the reviewer's latest
decision, on the PR's current head, neither stale nor dismissed, and from a
reviewer whose approval the rule accepts. A reviewer whose latest review asks for changes shows **changes
requested**.
- **has all approvals**: the approvals meet the rule. A PR into a branch with no
protection rule has nothing to approve, so it has them all.
- **conflicts**: the forge can't merge the PR as it stands.
- **protected base**: the base branch has a protection rule. A stacked PR targets a
feature branch, so filtering this to **no** lists them.
- **CI**: the commit statuses on the head, as one state (`success`, `pending`,
`failure`, or a dash when it has none).
Every column sorts, and the columns with a small set of values (repo, author,
labels, reviewers, base, the flags and CI) filter by picking values. The browser
keeps the filters you set and the repo you picked. The card fetches the report once per
repo choice, with no refresh timer.
### Builds
The builds sit in a card under the job graph on the **jobs** tab. While the graph