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

Method run

atomic-cli/src/commands/push/command.rs:1139–1160  ·  view source on GitHub ↗

Execute the push command. Syncs the current (or specified) view's parent chain to the remote via view manifests, then uploads attestations, provenance graphs, and tags that travel with the pushed changes. # Errors - `CliError::RepositoryNotFound` - Not in a repository - `CliError::RemoteNotFound` - Remote doesn't exist - `CliError::AuthenticationFailed` - Auth failure - `CliError::Conflict` - H

(&self)

Source from the content-addressed store, hash-verified

1137 /// - `CliError::RemoteError` - Network/server error (including servers
1138 /// that predate view-manifest support)
1139 fn run(&self) -> CliResult<()> {
1140 // Route every form through the service layer: the network sync IS
1141 // domain — the handler performs it end to end and returns the
1142 // report this render prints. The client-side pieces (remote-name
1143 // resolution read, the credential check, the auth headers) are
1144 // config/identity reads, never redb.
1145 if crate::commands::rpc::push(self)? {
1146 return Ok(());
1147 }
1148
1149 // A current-thread runtime keeps the workspace transaction's ordered
1150 // operation locks bound to one thread for the whole async body; nested
1151 // repository operations re-enter them instead of contending.
1152 let runtime = tokio::runtime::Builder::new_current_thread()
1153 .enable_all()
1154 .build()
1155 .map_err(|e| {
1156 CliError::Internal(anyhow::anyhow!("Failed to create async runtime: {}", e))
1157 })?;
1158
1159 runtime.block_on(self.run_async())
1160 }
1161}
1162
1163// Tests

Callers

nothing calls this directly

Calls 3

pushFunction · 0.50
buildMethod · 0.45
run_asyncMethod · 0.45

Tested by

no test coverage detected