Repository navigation
test(tools): a sparse-registry fixture pins today's Cargo cooldown behaviour - #297
Merged
Merged
Conversation
…haviour A local sparse registry (`real_sparse_registry.rs`) serves index files whose `pubtime` is relative to now, and `.crate` files, to real Cargo through the run's CARGO_HOME; every other host is unreachable. Tests pin, with Cargo 1.100, what the Count does today: - Without a cooldown, direct, boundary and maintenance updates lock every release, however new. - A cooldown the repository commits (`[registry] global-min-publish-age`) never reaches the Count's Cargo, so the Count locks a release the owner's own Cargo refuses on the same tree. - A cooldown in a `.cargo/config.toml` above the run's driver directory does apply to the Count's run. - Cargo 1.99.1 ignores the keys. - Cargo's texts: the refusal under `deny`, the `allow` and held-back notes, the cutoff line, the duration grammar it accepts and rejects, and an invalid resolver value. No behaviour change. The tests run with the real lockfile tools (`mise run test:tools`). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
write_tree clears the directory first, so a cooldown config or lock an earlier case wrote can't decide a later one. The registry finds a crate whatever the case of its index path, ignores a connection that sends no request line, and ensure_tool probes rustc for rust.
Without it mise cannot resolve [email protected] on CI.
A rustup proxy answers rustc --version from the default toolchain, so a missing 1.99.1 passed the probe and was never installed.
Merged
This was referenced Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A local sparse registry (
real_sparse_registry.rs) serves index fileswhose
pubtimeis relative to now, and.cratefiles, to real Cargothrough the run's CARGO_HOME; every other host is unreachable. Tests
pin, with Cargo 1.100, what the Count does today:
every release, however new.
[registry] global-min-publish-age) never reaches the Count's Cargo, so theCount locks a release the owner's own Cargo refuses on the same tree.
.cargo/config.tomlabove the run's driver directorydoes apply to the Count's run.
deny, theallowand held-backnotes, the cutoff line, the duration grammar it accepts and rejects,
and an invalid resolver value.
No behaviour change. The tests run with the real lockfile tools
(
mise run test:tools).PR 1 of 3 for Cargo cooldowns. PR 2 reads a repository's committed cooldown and uses it as a floor on the release age. PR 3 hands the setting (and
waitHours) to Cargo and stops a parent directory's cooldown from applying.Cargo 1.100 facts the tests pin (the docs leave these out)
14 days,14 day,14days,5 hours,1 week,1 month,15 minutes,3 seconds,0,0 days. Rejected with an error:14 Days,1 year,1.5 days,-5 days, a double space, leading or trailing spaces.Cargo.lockis downgraded bycargo update, not kept.CARGO_REGISTRY_GLOBAL_MIN_PUBLISH_AGE=0beats a committed file. Releases with nopubtimeare never held back.[registry] min-publish-ageis ignored with a warning.Checks (on the project VM)
mise run test:tools: 23 passed, including the 5 new tests.test:unit, clippy, fmt and hk are clean.Left for PR 2, when its generated cases need them
From review:
owner_cargohas no timeout and a thin environment scrub;Releasecan't expressyanked,featuresorrust_version; the.crate/dlpath is unexercised becausecargo updatenever downloads; the runner's 4 KiB tool-output limit could cut long refusal texts; CI's real-tools job downloads Rust 1.99.1 uncached for the old-toolchain test.