fj tag commands + branch create/delete (close the ref-mutation gap) #132

Closed
opened 2026-06-11 00:57:41 +00:00 by stephen · 0 comments
Owner

Task

Close fj's ref-mutation gap: it has no git tag commands and branch support is list-only.

  • Add a fj tag group: list / view <tag> / create <tag> [--target <sha>] [-m <msg>] / delete <tag> -y, backed by new thin src/api/ helpers over /repos/{o}/{r}/tags (GET, GET .../{tag}, POST, DELETE). Mirror the fj milestone / fj label CRUD shape (typed-confirmation delete).
  • Add branch write: branch-create <name> [--from <ref>] and branch-delete <name> -y (or a fj branch group) over /repos/{o}/{r}/branches. The read half, list_branches (src/api/repo_core.rs:246), already exists.
  • Give tag list and the branch list --json from the start so they compose into changelog and cleanup pipelines.

Source: rasterstate/fj#121.

Priority

p2. Branch/tag mutation is routine scripted-forge work and the one operation class where fj has zero coverage today (release cutting, "delete every merged feature/* branch", listing tags for changelog diffs). One notch below the p1 scripting-blockers because fj api/raw git is a working, if defeating, fallback.

Reason

fj repo exposes only branches for refs and it is list-only (src/cli/repo.rs:571); there is no branch create/delete/rename and no tag command at all (fj repo topics is GitHub-style discovery keywords, not git tags). The only ref helper in src/api/ is list_branches; grep -rnE 'fn (create_branch|delete_branch|list_tags|create_tag|delete_tag)' src/api/ returns nothing. Forgejo already serves every endpoint, so the gap is entirely at the CLI/api-helper layer. This is the read-but-not-write shape also seen in rasterstate/fj#108.

Acceptance

  • fj tag list [--json], fj tag view <tag>, fj tag create <tag> [--target <sha>] [-m <msg>], fj tag delete <tag> -y work against /repos/{o}/{r}/tags.
  • fj branch-create <name> [--from <ref>] and fj branch-delete <name> -y work against /repos/{o}/{r}/branches.
  • New src/api/ helpers funnel through the existing client request path; no parallel HTTP code.
  • Destructive verbs require typed/-y confirmation, consistent with fj milestone delete.
  • Wiremock coverage in src/client/integration_tests.rs for tag CRUD and branch create/delete.
  • cargo fmt --check, cargo clippy --all-targets --all-features -- -D warnings, and cargo test --all pass.

Dependencies

None. Independent thin helpers over endpoints fj does not yet touch.

Size

L

## Task Close `fj`'s ref-mutation gap: it has no git tag commands and branch support is list-only. - Add a `fj tag` group: `list` / `view <tag>` / `create <tag> [--target <sha>] [-m <msg>]` / `delete <tag> -y`, backed by new thin `src/api/` helpers over `/repos/{o}/{r}/tags` (`GET`, `GET .../{tag}`, `POST`, `DELETE`). Mirror the `fj milestone` / `fj label` CRUD shape (typed-confirmation delete). - Add branch write: `branch-create <name> [--from <ref>]` and `branch-delete <name> -y` (or a `fj branch` group) over `/repos/{o}/{r}/branches`. The read half, `list_branches` (`src/api/repo_core.rs:246`), already exists. - Give `tag list` and the branch list `--json` from the start so they compose into changelog and cleanup pipelines. Source: rasterstate/fj#121. ## Priority p2. Branch/tag mutation is routine scripted-forge work and the one operation class where `fj` has zero coverage today (release cutting, "delete every merged feature/* branch", listing tags for changelog diffs). One notch below the p1 scripting-blockers because `fj api`/raw git is a working, if defeating, fallback. ## Reason `fj repo` exposes only `branches` for refs and it is list-only (`src/cli/repo.rs:571`); there is no branch create/delete/rename and no tag command at all (`fj repo topics` is GitHub-style discovery keywords, not git tags). The only ref helper in `src/api/` is `list_branches`; `grep -rnE 'fn (create_branch|delete_branch|list_tags|create_tag|delete_tag)' src/api/` returns nothing. Forgejo already serves every endpoint, so the gap is entirely at the CLI/api-helper layer. This is the read-but-not-write shape also seen in rasterstate/fj#108. ## Acceptance - [ ] `fj tag list [--json]`, `fj tag view <tag>`, `fj tag create <tag> [--target <sha>] [-m <msg>]`, `fj tag delete <tag> -y` work against `/repos/{o}/{r}/tags`. - [ ] `fj branch-create <name> [--from <ref>]` and `fj branch-delete <name> -y` work against `/repos/{o}/{r}/branches`. - [ ] New `src/api/` helpers funnel through the existing client request path; no parallel HTTP code. - [ ] Destructive verbs require typed/`-y` confirmation, consistent with `fj milestone delete`. - [ ] Wiremock coverage in `src/client/integration_tests.rs` for tag CRUD and branch create/delete. - [ ] `cargo fmt --check`, `cargo clippy --all-targets --all-features -- -D warnings`, and `cargo test --all` pass. ## Dependencies None. Independent thin helpers over endpoints fj does not yet touch. ## Size L
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#132
No description provided.