pr list: add --label, --head, --page filters #6

Open
opened 2026-05-16 11:53:39 +02:00 by heiko · 1 comment
Owner

The mod-nag workflow in workflows/.forgejo/workflows/mod-nag.yaml needs to:

  1. Look up an existing open PR by head branch name (to detect "PR already exists, just force-push") — currently a raw curl to /pulls?state=open&head=<branch>.
  2. List all open PRs labelled mod-nag to close stale ones — currently a raw curl to /pulls?state=open&labels=<id>&limit=50.

To replace those with fj, fj pr list (and the prs alias) would need:

  • --label <name> (repeatable) — resolved to IDs via FetchLabels and forwarded as labels=<id,id,...>.
  • --head <branch> — forwarded as head=<branch>.
  • --page <n> — explicit page, combined with existing --limit.

--json already exists at the root and is what the workflow consumes.

Endpoint shape (forgejo GET /repos/{owner}/{repo}/pulls):

state=<state>&labels=<id,id>&head=<branch>&limit=<n>&page=<n>
The mod-nag workflow in `workflows/.forgejo/workflows/mod-nag.yaml` needs to: 1. Look up an existing open PR by head branch name (to detect "PR already exists, just force-push") — currently a raw `curl` to `/pulls?state=open&head=<branch>`. 2. List all open PRs labelled `mod-nag` to close stale ones — currently a raw `curl` to `/pulls?state=open&labels=<id>&limit=50`. To replace those with `fj`, `fj pr list` (and the `prs` alias) would need: - `--label <name>` (repeatable) — resolved to IDs via `FetchLabels` and forwarded as `labels=<id,id,...>`. - `--head <branch>` — forwarded as `head=<branch>`. - `--page <n>` — explicit page, combined with existing `--limit`. `--json` already exists at the root and is what the workflow consumes. Endpoint shape (forgejo `GET /repos/{owner}/{repo}/pulls`): state=<state>&labels=<id,id>&head=<branch>&limit=<n>&page=<n>
Author
Owner

AI attribution comment added per repository instruction for this open issue.\n\n(co)authored by ai:gpt-5-codex

AI attribution comment added per repository instruction for this open issue.\n\n(co)authored by ai:gpt-5-codex
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
heiko/fj#6
No description provided.