hive-forge: hard-error unresolved --label names; render dependency timeline events

This commit is contained in:
damocles 2026-08-02 04:41:52 +02:00 committed by mara
commit 7bad72d354
4 changed files with 134 additions and 20 deletions

View file

@ -24,8 +24,9 @@ pub struct Args {
#[arg(long)]
assignee: Option<String>,
/// Label name to attach, repeatable (e.g. `--label area/ops --label
/// type/bug`). Same spelling `labels add` accepts. Unknown names are
/// silently dropped, matching `labels add`'s existing behavior.
/// type/bug`). Same spelling `labels add` accepts. An unresolved name
/// errors out (before the issue is created) rather than silently
/// attaching fewer labels than asked for.
#[arg(long = "label")]
labels: Vec<String>,
}
@ -35,8 +36,8 @@ pub struct Args {
/// Propagates any I/O error from the body input (`--body-file`,
/// stdin), any transport error from the Forgejo REST call (network
/// unreachable, 4xx/5xx response, token missing/invalid, the
/// `--label` lookup's own list-labels call), and any I/O error from
/// writing the issue URL to stdout.
/// `--label` lookup's own list-labels call), an unresolved `--label`
/// name, and any I/O error from writing the issue URL to stdout.
pub fn run(client: &Client, args: Args) -> Result<()> {
let body = body::resolve(args.body.as_deref(), args.body_file.as_deref())?.unwrap_or_default();
let (owner, name) = client.owner_repo()?;
@ -44,7 +45,7 @@ pub fn run(client: &Client, args: Args) -> Result<()> {
None
} else {
let all = labels::repo_labels(client)?;
Some(labels::resolve_ids(&all, &args.labels))
Some(labels::resolve_ids(&all, &args.labels)?)
};
let payload = CreateIssueOption {
assignee: None,