hive-forge: add 'reopen' verb (pr reopen / issue reopen)

hive-forge had close but no reopen, so reopening required the non-obvious
workaround 'issue edit <n> --state open'. Add a reopen verb mirroring close
(PATCH state=open), wired into both 'pr reopen' (kind-checked PR) and
'issue reopen' (kind-checked issue). Updates docs/forge.md + the subcommand
enumerations.
This commit is contained in:
atlas 2026-06-23 14:54:45 +02:00 committed by mara
commit 11fb2ac0fc
6 changed files with 50 additions and 5 deletions

View file

@ -1,7 +1,7 @@
//! `issue <verb>` — issue-scoped sub-commands. Wraps the per-verb modules
//! under an `issue` parent so `hive-forge issue close 42`, `issue create …`,
//! etc. read as kind-namespaced commands. The generic verbs that also work on
//! PRs (view/comment/comments/close/labels/assign/timeline) kind-check the
//! PRs (view/comment/comments/close/reopen/labels/assign/timeline) kind-check the
//! number is an issue first (`assert_kind`); the issue-only verbs are
//! kind-correct by construction. The flat `issue-*` + bare generic verbs stay
//! as hidden back-compat aliases (see `main.rs`).
@ -34,6 +34,8 @@ enum Cmd {
Comments(verbs::comments::Args),
/// Close the issue.
Close(verbs::close::Args),
/// Reopen a closed issue.
Reopen(verbs::reopen::Args),
/// List / add / remove labels.
Labels(verbs::labels::Args),
/// Assign or unassign a user.
@ -65,6 +67,10 @@ pub fn run(client: &Client, args: Args) -> Result<()> {
assert_kind(client, a.number, Kind::Issue)?;
verbs::close::run(client, a)
}
Cmd::Reopen(a) => {
assert_kind(client, a.number, Kind::Issue)?;
verbs::reopen::run(client, a)
}
Cmd::Labels(a) => {
assert_kind(client, a.number, Kind::Issue)?;
verbs::labels::run(client, a)