hive-forge: add dependency verb for issue/pr blocking relationships

This commit is contained in:
damocles 2026-08-14 23:32:49 +02:00 committed by mara
commit 6a95aceedb
6 changed files with 121 additions and 11 deletions

View file

@ -1,10 +1,10 @@
//! `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/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`).
//! PRs (view/comment/comments/close/reopen/labels/assign/dependency/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`).
use anyhow::Result;
use clap::{Args as ClapArgs, Subcommand};
@ -40,6 +40,8 @@ enum Cmd {
Labels(verbs::labels::Args),
/// Assign or unassign a user.
Assign(verbs::assign::Args),
/// List / add / remove dependencies (issues this one is blocked by).
Dependency(verbs::dependency::Args),
/// List timeline events.
Timeline(verbs::timeline::Args),
}
@ -79,6 +81,10 @@ pub fn run(client: &Client, args: Args) -> Result<()> {
assert_kind(client, a.number, Kind::Issue)?;
verbs::assign::run(client, a)
}
Cmd::Dependency(a) => {
assert_kind(client, a.number, Kind::Issue)?;
verbs::dependency::run(client, a)
}
Cmd::Timeline(a) => {
assert_kind(client, a.number, Kind::Issue)?;
verbs::timeline::run(client, a)