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
trueif 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 atCRATES_IO_NEW_CRATE_WINDOWso 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.