Add --add-label/--remove-label/--add-assignee/--remove-assignee to fj issue edit #98

Closed
opened 2026-06-10 21:58:33 +00:00 by stephen · 0 comments
Owner

What

Add gh-style additive flags to fj issue edit (EditArgs in src/cli/issue.rs): --add-label, --remove-label, --add-assignee, --remove-assignee (repeatable, comma-splittable). Back them with the dedicated Forgejo endpoints rather than the issue PATCH: POST / DELETE /repos/{owner}/{repo}/issues/{n}/labels (resolving label names to IDs via the labels API) and the issue assignees add/remove path. Leave the existing --title/--body PATCH (src/cli/issue.rs:333-337) intact. Correct the doc-comment at src/cli/issue.rs:27 ("Edit an issue's title, body, labels, or assignees") so the --help text matches what the command actually does.

Why

rasterstate/fj#95: fj issue edit advertises in both its doc-comment and --help that it edits "labels, or assignees," but exposes only --title/--body and sends a patch that drops those fields. The lying help text is worse than a missing feature: it costs a debugging session before the user concludes the capability is absent. Relabeling and re-assigning existing issues is the core triage loop that gh issue edit --add-label/--add-assignee covers, and is required for a team running issue triage through fj.

Acceptance

  • fj issue edit <n> --add-label bug --remove-label triage adds and removes the named labels via the labels endpoints.
  • fj issue edit <n> --add-assignee alice --remove-assignee bob adds and removes assignees.
  • Editing --title/--body continues to work unchanged when no label/assignee flags are given.
  • An unknown label name errors clearly, naming the label.
  • fj issue edit --help and the doc-comment accurately describe the supported operations (no claim the command cannot fulfill).
  • Wiremock coverage in src/client/integration_tests.rs for the add/remove label and assignee calls.
  • cargo fmt --check, cargo clippy --all-targets --all-features -- -D warnings, and cargo test --all pass.

Dependencies

Shares label-name -> ID resolution with the create-side item (the fj issue create --label/--assignee backlog issue). Can land independently; if the create item lands first, reuse its resolver rather than duplicating it.

Out of scope

  • fj issue create label/assignee flags (separate item).
  • Wholesale label replacement semantics (a --label that sets-and-replaces); this item is additive add/remove only.
  • Milestone / project edits.

Size

M

## What Add gh-style additive flags to `fj issue edit` (`EditArgs` in `src/cli/issue.rs`): `--add-label`, `--remove-label`, `--add-assignee`, `--remove-assignee` (repeatable, comma-splittable). Back them with the dedicated Forgejo endpoints rather than the issue PATCH: `POST` / `DELETE /repos/{owner}/{repo}/issues/{n}/labels` (resolving label names to IDs via the labels API) and the issue assignees add/remove path. Leave the existing `--title`/`--body` PATCH (`src/cli/issue.rs:333-337`) intact. Correct the doc-comment at `src/cli/issue.rs:27` ("Edit an issue's title, body, labels, or assignees") so the `--help` text matches what the command actually does. ## Why rasterstate/fj#95: `fj issue edit` advertises in both its doc-comment and `--help` that it edits "labels, or assignees," but exposes only `--title`/`--body` and sends a patch that drops those fields. The lying help text is worse than a missing feature: it costs a debugging session before the user concludes the capability is absent. Relabeling and re-assigning existing issues is the core triage loop that `gh issue edit --add-label/--add-assignee` covers, and is required for a team running issue triage through `fj`. ## Acceptance - [ ] `fj issue edit <n> --add-label bug --remove-label triage` adds and removes the named labels via the labels endpoints. - [ ] `fj issue edit <n> --add-assignee alice --remove-assignee bob` adds and removes assignees. - [ ] Editing `--title`/`--body` continues to work unchanged when no label/assignee flags are given. - [ ] An unknown label name errors clearly, naming the label. - [ ] `fj issue edit --help` and the doc-comment accurately describe the supported operations (no claim the command cannot fulfill). - [ ] Wiremock coverage in `src/client/integration_tests.rs` for the add/remove label and assignee calls. - [ ] `cargo fmt --check`, `cargo clippy --all-targets --all-features -- -D warnings`, and `cargo test --all` pass. ## Dependencies Shares label-name -> ID resolution with the create-side item (the `fj issue create --label/--assignee` backlog issue). Can land independently; if the create item lands first, reuse its resolver rather than duplicating it. ## Out of scope - `fj issue create` label/assignee flags (separate item). - Wholesale label replacement semantics (a `--label` that sets-and-replaces); this item is additive add/remove only. - Milestone / project edits. ## Size M
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
rasterstate/fj#98
No description provided.