Add --label and --assignee to fj issue create #97

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

What

Add repeatable, comma-splittable --label and --assignee flags to fj issue create (CreateArgs in src/cli/issue.rs). Thread them into the already-present CreateIssue.labels / CreateIssue.assignees fields, currently hardcoded to None at src/cli/issue.rs:309-314. Forgejo's create-issue endpoint takes label IDs, not names, so resolve label names to IDs via the labels API (/repos/{owner}/{repo}/labels) before building the payload, reusing whatever resolution fj label already does; error clearly on an unknown label name. Assignees are passed through as usernames. Update the Create command doc-comment and --help so they accurately list the new flags.

Why

rasterstate/fj#95: fj issue create exposes no --label/--assignee flags and hardcodes both to None, even though fj markets "full feature parity with gh" and gh issue create --label/--assignee is table stakes. Filing the current batch of opportunity issues (rasterstate/fj#93, #94, #95) required falling back to fj api .../issues/<n>/labels because the CLI could not label them: the gap blocks scripted and agent-driven triage, the exact daily loop a team adopting the forge CLI needs. The API layer already models the fields, so the gap is purely at the CLI surface.

Acceptance

  • fj issue create --label bug --label enhancement and fj issue create --label bug,enhancement both attach the named labels (names resolved to IDs).
  • fj issue create --assignee alice --assignee bob assigns both users.
  • An unknown label name produces a clear error naming the label, not a raw API error.
  • fj issue create --help lists --label and --assignee and the doc-comment matches the behavior.
  • Wiremock coverage in src/client/integration_tests.rs for label-name resolution plus a create payload carrying the resolved IDs and assignees.
  • cargo fmt --check, cargo clippy --all-targets --all-features -- -D warnings, and cargo test --all pass.

Dependencies

none

Out of scope

  • Edit-side add/remove of labels/assignees (tracked separately for fj issue edit).
  • Milestone or project assignment.
  • Interactive label/assignee pickers.

Size

M

## What Add repeatable, comma-splittable `--label` and `--assignee` flags to `fj issue create` (`CreateArgs` in `src/cli/issue.rs`). Thread them into the already-present `CreateIssue.labels` / `CreateIssue.assignees` fields, currently hardcoded to `None` at `src/cli/issue.rs:309-314`. Forgejo's create-issue endpoint takes label **IDs**, not names, so resolve label names to IDs via the labels API (`/repos/{owner}/{repo}/labels`) before building the payload, reusing whatever resolution `fj label` already does; error clearly on an unknown label name. Assignees are passed through as usernames. Update the `Create` command doc-comment and `--help` so they accurately list the new flags. ## Why rasterstate/fj#95: `fj issue create` exposes no `--label`/`--assignee` flags and hardcodes both to `None`, even though `fj` markets "full feature parity with gh" and `gh issue create --label/--assignee` is table stakes. Filing the current batch of opportunity issues (rasterstate/fj#93, #94, #95) required falling back to `fj api .../issues/<n>/labels` because the CLI could not label them: the gap blocks scripted and agent-driven triage, the exact daily loop a team adopting the forge CLI needs. The API layer already models the fields, so the gap is purely at the CLI surface. ## Acceptance - [ ] `fj issue create --label bug --label enhancement` and `fj issue create --label bug,enhancement` both attach the named labels (names resolved to IDs). - [ ] `fj issue create --assignee alice --assignee bob` assigns both users. - [ ] An unknown label name produces a clear error naming the label, not a raw API error. - [ ] `fj issue create --help` lists `--label` and `--assignee` and the doc-comment matches the behavior. - [ ] Wiremock coverage in `src/client/integration_tests.rs` for label-name resolution plus a create payload carrying the resolved IDs and assignees. - [ ] `cargo fmt --check`, `cargo clippy --all-targets --all-features -- -D warnings`, and `cargo test --all` pass. ## Dependencies none ## Out of scope - Edit-side add/remove of labels/assignees (tracked separately for `fj issue edit`). - Milestone or project assignment. - Interactive label/assignee pickers. ## 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#97
No description provided.