fj pr: label and assign on create and edit #114
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Task
Let
fj prlabel and assign pull requests, mirroring the issue-side write surface:--label/--assignee(repeatable, comma-split) onfj pr create, threaded intoCreatePull(Forgejo's create-PR endpoint takeslabelsas IDs andassigneesas logins; resolve label names to IDs via the labels API first).--add-label/--remove-label/--add-assignee/--remove-assigneeonfj pr edit, backed by the already-present but dormantadd_to_issue/remove_from_issue(src/api/label.rs, drop the#[allow(dead_code)]) plus the parallel assignees endpoint. In Forgejo a PR is an issue, soPOST /issues/{number}/labelslabels a PR too.Reuse whatever label-name→ID resolver lands for the issue side (
rasterstate/fj#98) verbatim rather than duplicating it. A unifiedfj label add/remove <number>that works for both issues and PRs is an acceptable alternative shape.Source:
rasterstate/fj#110.Priority
p2. Routing a PR (label
area/api, assign the owner) is half of code-review triage and feeds everyone's filtered queues, pairing directly with the#108filter work. gh-parity (gh pr create --label --assignee,gh pr edit --add-label). One notch below the p1s; thefj apifallback works today and this depends on the issue-side resolver.Reason
fj prcovers reviewers (request-review/unrequest-review) but has no label/assignee write path:CreateArgs/EditArgs(src/cli/pr.rs) andCreatePull/EditPull(src/api/pull_core.rs) omit both. This is a write-only gap, not a data-model gap:Pullalready deserializeslabelson read, sofj pr viewshows labels the CLI cannot set, and the label write endpoint already exists, just dormant. Distinct from#95/#98(those are issue create/edit); this is the parallel hole on the PR surface.Acceptance
fj pr create --label area/api --assignee aliceopens a PR with the label and assignee set.fj pr edit <n> --add-label needs-review --remove-label wipadds/removes PR labels.fj pr edit <n> --add-assignee alice --remove-assignee bobadds/removes PR assignees.#[allow(dead_code)]onadd_to_issue/remove_from_issueis removed (now reached by a CLI verb).cargo fmt --check,cargo clippy --all-targets --all-features -- -D warnings, andcargo test --allpass.Dependencies
rasterstate/fj#98(issue-side add/remove labels/assignees). Shares the label-name→ID resolver and the add/remove endpoint plumbing; land after or alongside #98 and reuse its resolver. Can also be folded into a sharedfj label add/removeverb covering both surfaces.Size
M
fj prcannot label or assign a pull request (create or edit), though it can request reviewers #110