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

Function triage_candidates

atomic-cli/src/commands/rpc.rs:7445–7471  ·  view source on GitHub ↗

`atomic triage candidates` over ListTriageCandidates — the handler resolves the (feature, target) pair (the same defaults and errors the local resolve_views applies) and runs the repository's candidate-set domain call; the CLI renders the same plain/JSON reports over the wire-carried domain payload.

(
    args: &super::triage::TriageCandidates,
)

Source from the content-addressed store, hash-verified

7443/// domain call; the CLI renders the same plain/JSON reports over the
7444/// wire-carried domain payload.
7445pub(crate) fn triage_candidates(
7446 args: &super::triage::TriageCandidates,
7447) -> CliResult<Option<TriageCandidateSet>> {
7448 let Some(session) = Service::open()? else {
7449 return Ok(None);
7450 };
7451 let request = pb::ListTriageCandidatesRequest {
7452 repository: Some(session.reference.clone()),
7453 from_view: args.feature.clone(),
7454 to_view: args.into.clone(),
7455 };
7456 let response = session.list_triage_candidates(request)?;
7457 let Some(bundle) = response
7458 .candidate_set
7459 .as_ref()
7460 .filter(|bytes| bytes.schema == "atomic.triage.candidates.v1")
7461 else {
7462 return Err(CliError::Internal(anyhow::anyhow!(
7463 "the service returned no candidate set bundle"
7464 )));
7465 };
7466 Ok(Some(TriageCandidateSet {
7467 feature: response.feature,
7468 target: response.target,
7469 payload: bundle.payload.clone(),
7470 }))
7471}
7472
7473// ---------------------------------------------------------------------------
7474// tags (TagService)

Callers 1

runMethod · 0.85

Calls 4

as_refMethod · 0.80
openFunction · 0.50
cloneMethod · 0.45

Tested by

no test coverage detected