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

Function triage_candidates

atomic-cli/src/commands/rpc.rs:7362–7388  ·  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

7360/// domain call; the CLI renders the same plain/JSON reports over the
7361/// wire-carried domain payload.
7362pub(crate) fn triage_candidates(
7363 args: &super::triage::TriageCandidates,
7364) -> CliResult<Option<TriageCandidateSet>> {
7365 let Some(session) = Service::open()? else {
7366 return Ok(None);
7367 };
7368 let request = pb::ListTriageCandidatesRequest {
7369 repository: Some(session.reference.clone()),
7370 from_view: args.feature.clone(),
7371 to_view: args.into.clone(),
7372 };
7373 let response = session.list_triage_candidates(request)?;
7374 let Some(bundle) = response
7375 .candidate_set
7376 .as_ref()
7377 .filter(|bytes| bytes.schema == "atomic.triage.candidates.v1")
7378 else {
7379 return Err(CliError::Internal(anyhow::anyhow!(
7380 "the service returned no candidate set bundle"
7381 )));
7382 };
7383 Ok(Some(TriageCandidateSet {
7384 feature: response.feature,
7385 target: response.target,
7386 payload: bundle.payload.clone(),
7387 }))
7388}
7389
7390// ---------------------------------------------------------------------------
7391// tags (TagService)

Callers 1

runMethod · 0.85

Calls 4

openFunction · 0.85
as_refMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected