MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / build_rows

Function build_rows

atomic-cli/src/commands/intent/list.rs:267–289  ·  view source on GitHub ↗

Build the (optionally kind-filtered) rows for the listing. Enumeration reuses [`Repository::vault_intent_list`]; the `kind` tag is read straight from the manifest `IntentSummary.kind` (a manifest read, never a lift). Factored out of [`Command::run`] so the kind tag + filter are unit-testable without a global identity store. A row whose id is missing from the manifest (should not happen — the same

(
    repo: &Repository,
    verifier: Option<&Verifier>,
    filter: Option<&str>,
)

Source from the content-addressed store, hash-verified

265/// the manifest (should not happen — the same manifest backs both) degrades to
266/// the default `feature`.
267fn build_rows(
268 repo: &Repository,
269 verifier: Option<&Verifier>,
270 filter: Option<&str>,
271) -> CliResult<Vec<Row>> {
272 let manifest = repo.vault_manifest().map_err(CliError::Repository)?;
273 let intents = repo.vault_intent_list(None).map_err(CliError::Repository)?;
274 let mut rows = Vec::new();
275 for info in &intents {
276 let kind = manifest
277 .intents
278 .get(&info.id)
279 .map(|s| s.kind.clone())
280 .unwrap_or_else(|| "feature".to_string());
281 if let Some(f) = filter {
282 if kind != f {
283 continue;
284 }
285 }
286 rows.push(compute_row(repo, info, kind, verifier));
287 }
288 Ok(rows)
289}
290
291impl Command for IntentList {
292 fn run(&self) -> CliResult<()> {

Callers 2

runMethod · 0.85

Calls 6

vault_manifestMethod · 0.80
vault_intent_listMethod · 0.80
compute_rowFunction · 0.70
getMethod · 0.65
cloneMethod · 0.45
pushMethod · 0.45

Tested by 1