From 37244449d6d0d58bb639f181bd15092de1acaaee Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 5 Mar 2026 14:19:49 +0000 Subject: feat(cover-note): add kind-1624 cover notes for PRs, patches, and issues Implements experimental kind-1624 cover note events: - KIND_COVER_NOTE constant and process_cover_note() in git_events.rs; replaceable semantics (latest created_at, hex-id tiebreak), author or maintainer only - kind-1624 events fetched alongside labels in the fetch pipeline; cover_notes count added to FetchReport display - ngit pr/issue view: cover note displayed in place of description with a clear 'Cover Note:' header; maintainer-authored notes identify the author; original description shown only with --comments; cover_note object included in --json output - ngit pr set-cover-note / ngit issue set-cover-note: publish a kind-1624 event; nostr: mentions in --body converted to q/p tags via tags_from_content (same rules as issue --body) - Fix pre-existing clippy::too_many_lines on repo/mod.rs show_info --- src/bin/ngit/main.rs | 75 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 56 insertions(+), 19 deletions(-) (limited to 'src/bin/ngit/main.rs') diff --git a/src/bin/ngit/main.rs b/src/bin/ngit/main.rs index 3f5e65c..a656412 100644 --- a/src/bin/ngit/main.rs +++ b/src/bin/ngit/main.rs @@ -3,7 +3,7 @@ #![cfg_attr(not(test), warn(clippy::expect_used))] use clap::Parser; -use cli::{AccountCommands, Cli, Commands, IssueCommands, PrCommands, CUSTOMISE_TEMPLATE}; +use cli::{AccountCommands, CUSTOMISE_TEMPLATE, Cli, Commands, IssueCommands, PrCommands}; mod cli; use ngit::{ @@ -54,7 +54,13 @@ async fn main() { }, Commands::Init(args) => sub_commands::init::launch(&cli, args).await, Commands::Repo(args) => { - sub_commands::repo::launch(&cli, args.repo_command.as_ref(), args.offline, args.json).await + sub_commands::repo::launch( + &cli, + args.repo_command.as_ref(), + args.offline, + args.json, + ) + .await } Commands::Send(args) => sub_commands::send::launch(&cli, args, false).await, Commands::Pr(args) => match &args.pr_command { @@ -102,18 +108,26 @@ async fn main() { PrCommands::Send(sub_args) => { sub_commands::send::launch(&cli, sub_args, false).await } - PrCommands::Close { id, reason, offline } => { - sub_commands::pr_status::launch_close(id, *offline, reason.as_deref()).await - } - PrCommands::Reopen { id, reason, offline } => { - sub_commands::pr_status::launch_reopen(id, *offline, reason.as_deref()).await - } - PrCommands::Ready { id, reason, offline } => { - sub_commands::pr_status::launch_ready(id, *offline, reason.as_deref()).await - } - PrCommands::Draft { id, reason, offline } => { - sub_commands::pr_status::launch_draft(id, *offline, reason.as_deref()).await - } + PrCommands::Close { + id, + reason, + offline, + } => sub_commands::pr_status::launch_close(id, *offline, reason.as_deref()).await, + PrCommands::Reopen { + id, + reason, + offline, + } => sub_commands::pr_status::launch_reopen(id, *offline, reason.as_deref()).await, + PrCommands::Ready { + id, + reason, + offline, + } => sub_commands::pr_status::launch_ready(id, *offline, reason.as_deref()).await, + PrCommands::Draft { + id, + reason, + offline, + } => sub_commands::pr_status::launch_draft(id, *offline, reason.as_deref()).await, PrCommands::Comment { id, body, @@ -143,6 +157,9 @@ async fn main() { subject, offline, } => sub_commands::set_subject::launch_pr_set_subject(id, subject, *offline).await, + PrCommands::SetCoverNote { id, body, offline } => { + sub_commands::set_cover_note::launch_pr_set_cover_note(id, body, *offline).await + } }, Commands::Issue(args) => match &args.issue_command { IssueCommands::List { @@ -183,17 +200,33 @@ async fn main() { body, labels, } => { - sub_commands::issue_create::launch(subject.clone(), body.clone(), labels.clone()) - .await + sub_commands::issue_create::launch( + subject.clone(), + body.clone(), + labels.clone(), + ) + .await } - IssueCommands::Close { id, reason, offline } => { + IssueCommands::Close { + id, + reason, + offline, + } => { sub_commands::issue_status::launch_close(id, *offline, reason.as_deref()).await } - IssueCommands::Resolved { id, reason, offline } => { + IssueCommands::Resolved { + id, + reason, + offline, + } => { sub_commands::issue_status::launch_resolved(id, *offline, reason.as_deref()) .await } - IssueCommands::Reopen { id, reason, offline } => { + IssueCommands::Reopen { + id, + reason, + offline, + } => { sub_commands::issue_status::launch_reopen(id, *offline, reason.as_deref()).await } IssueCommands::Comment { @@ -222,6 +255,10 @@ async fn main() { } => { sub_commands::set_subject::launch_issue_set_subject(id, subject, *offline).await } + IssueCommands::SetCoverNote { id, body, offline } => { + sub_commands::set_cover_note::launch_issue_set_cover_note(id, body, *offline) + .await + } }, Commands::Sync(args) => sub_commands::sync::launch(args).await, } -- cgit v1.2.3