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

Function vault_goal_stop

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

`atomic vault goal stop` over UpdateVaultEntity's GoalStop arm — the handler resolves the most recent active goal when none is named and performs the stop; the outcome status + removed paths ride the response.

(args: &super::vault::goal::GoalStop)

Source from the content-addressed store, hash-verified

6459/// performs the stop; the outcome status + removed paths ride the
6460/// response.
6461pub fn vault_goal_stop(args: &super::vault::goal::GoalStop) -> CliResult<bool> {
6462 let Some(session) = Service::open()? else {
6463 return Ok(false);
6464 };
6465 let request = pb::UpdateVaultEntityRequest {
6466 repository: Some(session.reference.clone()),
6467 meta: request_meta(),
6468 kind: Kind::Goal as i32,
6469 id: String::new(),
6470 update: Some(UpdateKind::GoalStop(pb::GoalStopAction {
6471 goal: args.goal.clone(),
6472 promote: args.promote,
6473 discard: args.discard,
6474 })),
6475 expected: None,
6476 view: None,
6477 };
6478 let response = session.update_vault_entity(request)?;
6479 let entry = response.entry.expect("stopped goal entry");
6480 let status = response.stop_status.clone().unwrap_or_default();
6481 match status.as_str() {
6482 "discarded" => println!(
6483 "Discarded goal: {} ({} files removed)",
6484 entry.id,
6485 response.paths_removed.unwrap_or(0)
6486 ),
6487 "completed" => println!("Completed goal: {}", entry.id),
6488 status => println!("Suspended goal: {} (status: {})", entry.id, status),
6489 }
6490 Ok(true)
6491}
6492
6493/// `atomic vault goal resume` over UpdateVaultEntity's GoalResume arm.
6494pub fn vault_goal_resume(args: &super::vault::goal::GoalResume) -> CliResult<bool> {

Callers 1

runMethod · 0.85

Calls 6

openFunction · 0.85
GoalStopClass · 0.85
request_metaFunction · 0.70
cloneMethod · 0.45
update_vault_entityMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected