Skip to main content

Module execution

Module execution 

Source
Expand description

Shared execution helpers for publish workflows.

Absorbed from the former shipper-execution-core microcrate. These items are pub (rather than pub(crate)) because an external fuzz target in fuzz/ exercises them directly; they will be tightened to pub(crate) once the fuzz surface is rationalized in a later pass.

Constants§

CRATES_IO_NEW_CRATE_WINDOW
crates.io’s documented rate-limit window for new-crate publishes: 10 min. After the 5-crate account burst is consumed, new crates are admitted at most once per CRATES_IO_NEW_CRATE_WINDOW. Source: https://crates.io/docs/rate-limits.

Functions§

backoff_delay
Calculate the delay for a retry attempt.
classify_cargo_failure
Classify a cargo failure output into retry semantics for publish decisioning.
looks_like_rate_limit
Return true if an error message looks like a rate-limit signal (HTTP 429 / “too many requests” / “rate limit” phrasings that appear in cargo publish stderr or common registry error bodies). Used to gate the crates.io-aware backoff adjustment: we only extend the delay when we believe we’re actually being rate-limited.
pkg_key
Create a stable key for a package version.
registry_aware_backoff
Registry-aware backoff. Layered on top of the generic backoff_delay: if we’re publishing a brand-new crate and the retry is caused by a rate-limit signal, floor the delay at CRATES_IO_NEW_CRATE_WINDOW so we stop burning retries during the 10-minute window crates.io has already told us to wait through. Everything else uses the generic delay.
resolve_state_dir
Resolve the effective state directory from a workspace root and user option.
short_state
Short, human-readable label for a package state.
update_state
Update a package state and persist the entire execution state to disk.
update_state_locked
Update a package state inside an in-memory execution state.