hive-forge list: show dep-progress count for items with open dependencies

This commit is contained in:
damocles 2026-08-18 10:10:24 +02:00 committed by mara
commit a796c24037
2 changed files with 77 additions and 10 deletions

View file

@ -351,12 +351,15 @@ pub(crate) fn latest_reviews(client: &Client, repo: &str, pr: u64) -> Result<Vec
}
/// The current dependency list for an issue or PR — each entry names
/// another issue/PR this one is blocked on. Forgejo's dependency endpoint
/// works on the shared issue/PR index (PRs are issues internally under
/// the hood), so `issue show` and `pr show` both call this instead of
/// duplicating the fetch-and-shape step. A reviewer asked whether
/// another issue/PR this one is blocked on, with its `number`/`title`/
/// `state`. Forgejo's dependency endpoint works on the shared issue/PR
/// index (PRs are issues internally under the hood), so `issue show`,
/// `pr show`, and `list`'s dep-progress annotation all call this instead
/// of duplicating the fetch-and-shape step. A reviewer asked whether
/// `show`/`view` surface dependencies — they didn't (only `timeline`
/// rendered them, as history); this is the current-state complement.
/// `state` was added alongside `list`'s annotation so a caller can tell
/// open deps from closed ones without a second fetch.
///
/// # Errors
///
@ -373,7 +376,7 @@ pub(crate) fn dependency_summaries(
.send()?;
Ok(deps
.into_iter()
.map(|d| json!({ "number": d.number, "title": d.title }))
.map(|d| json!({ "number": d.number, "title": d.title, "state": d.state }))
.collect())
}