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

Function vault_goal_stop

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

6499/// performs the stop; the outcome status + removed paths ride the
6500/// response.
6501pub fn vault_goal_stop(args: &super::vault::goal::GoalStop) -> CliResult<bool> {
6502 let Some(session) = Service::open()? else {
6503 return Ok(false);
6504 };
6505 let request = pb::UpdateVaultEntityRequest {
6506 repository: Some(session.reference.clone()),
6507 meta: request_meta(),
6508 kind: Kind::Goal as i32,
6509 id: String::new(),
6510 update: Some(UpdateKind::GoalStop(pb::GoalStopAction {
6511 goal: args.goal.clone(),
6512 promote: args.promote,
6513 discard: args.discard,
6514 })),
6515 expected: None,
6516 view: None,
6517 };
6518 let response = session.update_vault_entity(request)?;
6519 let entry = response.entry.expect("stopped goal entry");
6520 let status = response.stop_status.clone().unwrap_or_default();
6521 match status.as_str() {
6522 "discarded" => println!(
6523 "Discarded goal: {} ({} files removed)",
6524 entry.id,
6525 response.paths_removed.unwrap_or(0)
6526 ),
6527 "completed" => println!("Completed goal: {}", entry.id),
6528 status => println!("Suspended goal: {} (status: {})", entry.id, status),
6529 }
6530 Ok(true)
6531}
6532
6533/// `atomic vault goal resume` over UpdateVaultEntity's GoalResume arm.
6534pub fn vault_goal_resume(args: &super::vault::goal::GoalResume) -> CliResult<bool> {

Callers 1

runMethod · 0.85

Calls 6

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

Tested by

no test coverage detected