ci(#1555): prose-ify legacy tracker tags; add lint:allow escape hatch
Clean the legacy backlog so the tracker-tag lint can become a required gate (mara's warn-during-cleanup -> full-tree-enforcement path). Rewrite the ~33 real `closes/see #NNN` provenance refs in doc-comments to prose across hive-forge, hive-c0re, hive-ag3nt, hive-matrix-mcp, hive-sh4re, and add a `lint:allow` line marker to check-issue-refs.sh for genuine non-tracker `#<digits>` (a hash-digit heading-detection test input). Tree is now lint-clean; tracker-tag lint ready to promote to required.
This commit is contained in:
parent
ceb3e3b01a
commit
ab1b07acce
23 changed files with 55 additions and 47 deletions
|
|
@ -1,5 +1,5 @@
|
|||
//! Body-input resolution shared by every verb that posts a body.
|
||||
//! Matches the bash `resolve_body` helper (#382): exactly one source
|
||||
//! Matches the bash `resolve_body` helper: exactly one source
|
||||
//! between `--body`, `--body-file`, and piped stdin. Passing both
|
||||
//! `--body` and `--body-file` is a clear error.
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ pub struct Client {
|
|||
pub default_repo: String,
|
||||
/// Global `--json` flag — verbs that have a human-readable
|
||||
/// default path branch on `client.json_mode()` to pick the
|
||||
/// JSON output shape instead. Closes #421.
|
||||
/// JSON output shape instead.
|
||||
json_mode: bool,
|
||||
}
|
||||
|
||||
|
|
@ -131,7 +131,7 @@ impl Client {
|
|||
/// params (`?limit=N&state=open&...`) are preserved. Pages drain
|
||||
/// while the response carries a `Link: rel="next"` header, up to
|
||||
/// `max_pages` (the runaway-loop safety cap). Returns the merged
|
||||
/// array. Used by `lint` for repo-wide queries (closes #505).
|
||||
/// array. Used by `lint` for repo-wide queries.
|
||||
pub fn get_json_all(&self, path: &str, max_pages: u32) -> Result<Vec<Value>> {
|
||||
let sep = if path.contains('?') { '&' } else { '?' };
|
||||
let mut merged = Vec::new();
|
||||
|
|
@ -271,8 +271,8 @@ fn read_token() -> Result<String> {
|
|||
}
|
||||
|
||||
/// Surface non-2xx HTTP responses as anyhow errors with the response
|
||||
/// body included (matches `curl --fail-with-body`). Closes #353's
|
||||
/// "silent failures with no clue what went wrong" case.
|
||||
/// body included (matches `curl --fail-with-body`) — turns
|
||||
/// silent failures into errors with a clear message.
|
||||
fn check_status(resp: Response, op: &str) -> Result<Response> {
|
||||
let status = resp.status();
|
||||
if status.is_success() {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//! Single binary with verb subcommands. Replaces the prior bash
|
||||
//! script (`hive-forge-tools.nix`) so that agents and operators get
|
||||
//! the same error handling, exit codes, and JSON shapes regardless
|
||||
//! of how the bash mood was that day (closes #280).
|
||||
//! of how the bash mood was that day.
|
||||
|
||||
#![warn(missing_docs)]
|
||||
// Clap-derived `Args` structs are intentionally consumed by their
|
||||
|
|
@ -26,7 +26,7 @@ use clap::{Parser, Subcommand};
|
|||
#[derive(Parser)]
|
||||
#[command(
|
||||
name = "hive-forge",
|
||||
about = "Forgejo CLI wrapper for hyperhive (closes #280)",
|
||||
about = "Forgejo CLI wrapper for hyperhive",
|
||||
disable_help_subcommand = true
|
||||
)]
|
||||
struct Cli {
|
||||
|
|
@ -36,7 +36,7 @@ struct Cli {
|
|||
#[arg(short = 'r', long, global = true)]
|
||||
repo: Option<String>,
|
||||
/// Emit JSON output instead of the verb's default human-readable
|
||||
/// shape, for verbs that support both (closes #421). Verbs whose
|
||||
/// shape, for verbs that support both. Verbs whose
|
||||
/// only output is already JSON (`issue`, `pr`, etc.) ignore this
|
||||
/// flag — they always print JSON regardless.
|
||||
#[arg(long, global = true)]
|
||||
|
|
@ -100,7 +100,7 @@ enum Verb {
|
|||
Subscription(verbs::subscription::Args),
|
||||
/// List timeline events on an issue or PR (closes, label adds,
|
||||
/// assignments, commit refs, pushes, etc.) — the audit trail
|
||||
/// `view` + `comments` don't surface (closes #783).
|
||||
/// `view` + `comments` don't surface.
|
||||
Timeline(verbs::timeline::Args),
|
||||
/// Upload a file as an attachment to an issue.
|
||||
AttachIssue(verbs::attach::IssueArgs),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
//! `assign <number> <user> [--remove]` — add or remove a user from an
|
||||
//! issue/PR's assignee list. Forgejo has no dedicated POST endpoint —
|
||||
//! we read the current list, mutate, and PATCH the issue back (closes
|
||||
//! #353's "no such endpoint" trap; matches the bash helper's logic).
|
||||
//! we read the current list, mutate, and PATCH the issue back (Forgejo
|
||||
//! has no such endpoint; matches the bash helper's logic).
|
||||
|
||||
use anyhow::Result;
|
||||
use clap::Args as ClapArgs;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
//! `comments <number> [--limit N | --tail N]` — list comments on an
|
||||
//! issue or PR. Closes the curl-fallback gap (#418); `--tail`
|
||||
//! closes the third of the four #694 gaps (paging-for-long-threads
|
||||
//! issue or PR. Replaces the curl fallback; `--tail`
|
||||
//! handles the paging-for-long-threads
|
||||
//! awkwardness).
|
||||
//!
|
||||
//! - `--limit N` (default 50, Forgejo's cap) returns the first N
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
//! on this long thread?" without scrolling through the whole
|
||||
//! history.
|
||||
//!
|
||||
//! Use the global `--json` flag for JSON output (#421).
|
||||
//! Use the global `--json` flag for JSON output.
|
||||
|
||||
use anyhow::Result;
|
||||
use clap::Args as ClapArgs;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
//! `package-lock.json`, …) is collapsed to a single
|
||||
//! `[<path>: contents changed (+N -M, --full for content)]`
|
||||
//! line so a `flake.lock` rev bump doesn't drown the human-
|
||||
//! authored changes in 5 000 lines of lock churn (#222). The
|
||||
//! authored changes in 5 000 lines of lock churn. The
|
||||
//! per-file git headers (`diff --git`, `index`, `---`, `+++`,
|
||||
//! and any rename / mode metadata) are suppressed alongside the
|
||||
//! hunks since the placeholder already carries the file path and
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
//! `lint <subcommand>` — issue/PR/branch lint queries for triage
|
||||
//! workflows (closes #505). Replaces ad-hoc curl + jq filtering with
|
||||
//! workflows. Replaces ad-hoc curl + jq filtering with
|
||||
//! typed commands that always emit JSON via the global `--json`
|
||||
//! (default is a compact one-line-per-item human shape).
|
||||
//!
|
||||
|
|
@ -97,7 +97,7 @@ struct NoReviewerArgs {
|
|||
/// Reviewer login to look for (matches `@<reviewer>` in PR body or
|
||||
/// any comment). Required — defaulting to a specific name would
|
||||
/// bake one deployment's reviewer convention into the binary
|
||||
/// (mara's nit on #507).
|
||||
/// (flagged in review).
|
||||
#[arg(long)]
|
||||
reviewer: String,
|
||||
}
|
||||
|
|
@ -177,7 +177,7 @@ fn run_no_reviewer(client: &Client, args: NoReviewerArgs) -> Result<()> {
|
|||
continue;
|
||||
}
|
||||
// Paginate so PRs with >50 comments don't yield false positives
|
||||
// (argus nit on #507). Same 1000-comment ceiling as elsewhere.
|
||||
// (flagged in review). Same 1000-comment ceiling as elsewhere.
|
||||
let comments = client.get_json_all(
|
||||
&format!("/repos/{repo}/issues/{number}/comments?limit={PAGE_LIMIT}"),
|
||||
MAX_PAGES,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
//!
|
||||
//! Mirrors Forgejo's `GET /repos/{owner}/{repo}/issues` query-string
|
||||
//! filters one-for-one so the mental model carries over. Closes the
|
||||
//! second of the four #694 gaps (read-side; no boundary concerns —
|
||||
//! read-side curl-fallback gap (no boundary concerns —
|
||||
//! every agent + the operator queries the issue tracker constantly).
|
||||
|
||||
use std::fmt::Write as _;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//! hint block is filtered out of git's stderr (we print the canonical
|
||||
//! URL ourselves once the API returns). Other git stderr passes
|
||||
//! through. Default behaviour is unchanged: no push unless asked.
|
||||
//! Closes the auto-push half of #222 per operator decision (opt-in
|
||||
//! Adds the auto-push path per operator decision (opt-in
|
||||
//! flag).
|
||||
//!
|
||||
//! With `--agit` the PR is opened via Forgejo's `AGit` flow instead of
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
//! `timeline <number> [--limit N]` — list timeline events on an
|
||||
//! issue or PR. Closes #783 (last piece of the #694 epic: agents kept
|
||||
//! issue or PR. Fills the gap where agents kept
|
||||
//! falling back to curl for "who closed this?" / "when was this
|
||||
//! labelled?" archaeology). Composes naturally with `view <n>` /
|
||||
//! labelled?" archaeology. Composes naturally with `view <n>` /
|
||||
//! `comments <n>` — separate verb keeps the existing shapes stable.
|
||||
//!
|
||||
//! Forgejo's `/issues/{n}/timeline` endpoint returns BOTH the actual
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
//!
|
||||
//! `--tail N` is a follow-up (the timeline endpoint doesn't expose a
|
||||
//! total-count field so we can't use the count-then-page trick that
|
||||
//! `comments --tail` lands in #770; future shape probably mirrors
|
||||
//! `comments --tail` uses; future shape probably mirrors
|
||||
//! `comments --tail` once Forgejo grows a `count` query or we accept
|
||||
//! the trailing-slice cost).
|
||||
|
||||
|
|
@ -211,7 +211,7 @@ mod tests {
|
|||
//! Tests call `format_event` directly so any new event-type arm
|
||||
//! added in `print_event`'s dispatch is automatically covered by
|
||||
//! the rendering path (no parallel test-side dispatch to keep in
|
||||
//! sync). Argus on PR #798 🟡: "extract a `format_event(ev) ->
|
||||
//! sync). A review flagged: "extract a `format_event(ev) ->
|
||||
//! String` helper and test that function directly instead of
|
||||
//! duplicating the logic" — addressed.
|
||||
use super::*;
|
||||
|
|
|
|||
Loading…
Reference in a new issue