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

Function parse_remote_manifest

atomic-cli/src/commands/push/helpers.rs:284–294  ·  view source on GitHub ↗

Parse and verify a remote manifest, mapping failures to remote errors. The declared state must equal the fold of the log — a remote that sends an inconsistent manifest is broken, and we refuse to plan against it.

(view: &str, text: &str, url: &str)

Source from the content-addressed store, hash-verified

282/// The declared state must equal the fold of the log — a remote that sends
283/// an inconsistent manifest is broken, and we refuse to plan against it.
284pub fn parse_remote_manifest(view: &str, text: &str, url: &str) -> CliResult<ViewManifest> {
285 let manifest = ViewManifest::parse(text).map_err(|e| CliError::RemoteError {
286 message: format!("Invalid manifest for view '{}' from remote: {}", view, e),
287 url: Some(url.to_string()),
288 })?;
289 manifest.verify().map_err(|e| CliError::RemoteError {
290 message: format!("Corrupt manifest for view '{}' from remote: {}", view, e),
291 url: Some(url.to_string()),
292 })?;
293 Ok(manifest)
294}
295
296// Change Data Loading
297

Calls 2

parseFunction · 0.85
verifyMethod · 0.45