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.
Structs§
- Registry
Profile - Registry-specific publish constraints that affect retry pacing and operator estimates.
Enums§
- Registry
Ambiguity Model - How Shipper should treat ambiguous cargo publish output for this registry.
- Registry
Propagation Model - How Shipper expects a registry to propagate newly published packages.
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§
- append_
attempt_ detail - Append an attempt detail to an in-memory state and refresh its timestamp.
- 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.
- record_
attempt_ detail - Append an attempt detail and persist the execution state.
- 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. - registry_
profile_ aware_ backoff - Registry-profile-aware backoff.
- resolve_
state_ dir - Resolve the effective state directory from a workspace root and user option.
- retry_
after_ delay - Parse a
Retry-Afterheader value from cargo/registry output. - retry_
next_ attempt_ at - Calculate the wall-clock time for a scheduled retry.
- 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.