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

Function build_rows

atomic-cli/src/commands/intent/list.rs:263–285  ·  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

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