Skip to content

test(tools): a sparse-registry fixture pins today's Cargo cooldown behaviour - #297

Merged
sweepies merged 4 commits into
mainfrom
chore/cargo-cooldown-fixture
Nov 13, 2026
Merged

sweepies merged 4 commits into
mainfrom
chore/cargo-cooldown-fixture

Conversation

@sweepies

@sweepies sweepies commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

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).

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)

  • Accepted durations: 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.
  • A too-new release already in Cargo.lock is downgraded by cargo update, not kept.
  • The held-back note names the next release above the chosen one, not the newest.
  • CARGO_REGISTRY_GLOBAL_MIN_PUBLISH_AGE=0 beats a committed file. Releases with no pubtime are never held back. [registry] min-publish-age is 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.

View guided diff Turn on auto-fix

Left for PR 2, when its generated cases need them

From review: owner_cargo has no timeout and a thin environment scrub; Release can't express yanked, features or rust_version; the .crate/dl path is unexercised because cargo update never 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.

sweepies and others added 4 commits November 13, 2026 14:38
…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.
A rustup proxy answers rustc --version from the default toolchain, so a
missing 1.99.1 passed the probe and was never installed.
@sweepies
sweepies merged commit 682b1da into main Nov 13, 2026
12 checks passed
@sweepies
sweepies deleted the chore/cargo-cooldown-fixture branch November 13, 2026 15:56
@sweepies-ops sweepies-ops Bot mentioned this pull request Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant