feat: add cargo-aprz and cargo-ensure-no-default-features - #76
Conversation
|
Codecov Report❌ Patch coverage is
❌ Your project status has failed because the head coverage (99.9%) is below the target coverage (100.0%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #76 +/- ##
=========================================
- Coverage 100.0% 99.9% -0.1%
=========================================
Files 58 135 +77
Lines 3277 17449 +14172
=========================================
+ Hits 3277 17448 +14171
- Misses 0 1 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
f665403 to
dd9406c
Compare
dd9406c to
edcf8e0
Compare
edcf8e0 to
e9e9a35
Compare
e9e9a35 to
8514e50
Compare
8514e50 to
c520f05
Compare
c520f05 to
8f5b374
Compare
8f5b374 to
2baaa6f
Compare
9ff55dd to
7a7a519
Compare
7a7a519 to
456dc13
Compare
456dc13 to
c2dfb80
Compare
c2dfb80 to
66c5394
Compare
66c5394 to
f23315b
Compare
f23315b to
5c3b094
Compare
Migrate cargo-aprz and cargo-ensure-no-default-features into the workspace, and normalize the surrounding repo state: - add crates/cargo-aprz, crates/cargo-aprz-lib and crates/cargo-ensure-no-default-features, with the thin-binary / fat-library split used elsewhere in the repo - rename crates/cargo_ensure_no_cyclic_deps to crates/cargo-ensure-no-cyclic-deps so the directory matches the package name - add the required workspace dependencies, enable Git LFS in CI so logos and icons resolve, and update README/CHANGELOG/deny.toml - satisfy the coverage and mutation gates - stop flagging cleared and MPL-2.0 crates as high risk: ignore withdrawn RustSec advisories, allow MPL-2.0, and add a repository aprz.toml exempting paste, directories and humantime - disable mimalloc under miri, which cannot call its foreign allocation functions Every fact provider reached a live service, so the tests exercising them were marked `#[ignore]` and never ran in CI, leaving the crate at 74.5% line coverage. Each provider now runs against a substitute service: the crates.io database dump is synthesized in memory and served by a mock HTTP server in place of the 1.5 GB production dump; the GitHub and Codeberg APIs are mocked, covering pagination, rate limiting and error statuses; the codebase provider clones a git repository built in a temporary directory; the advisory database is a RustSec-shaped fixture; and the progress reporter renders to a hidden draw target. Service addresses are injectable through facts::Endpoints, which also lets the tool run against a local mirror or a GitHub Enterprise instance. The 30 tests that required network access now run on every PR, the whole suite passes with networking disabled, and coverage rises from 74.5% to 97.0%. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 10a639c2-f4cb-47c2-a38b-283bf3869bd7 Copilot-Session: 5c34d2cc-be07-4547-986b-d58d33b83b1b
Summary
Migrates two standalone tools into this repo, and fixes several repo-wide issues found along the way.
New crates
cargo-aprz/cargo-aprz-lib— dependency approval and reporting tool, split into a thin binary over a library sodoc2readmecan generate its README.cargo-ensure-no-default-features— validates that dependencies declaredefault-features = false.Both are adapted to repo conventions: workspace-inherited package fields, workspace dependencies with features declared per-crate, anvil-managed lint sentinels, Microsoft copyright headers, and design docs.
Notable details:
cargo-aprz-libgets a build script declaring theall_tables/all_fieldscfgs, sounexpected_cfgsstays quiet without editing the anvil-managedcheck-cfglist.network_testsfeature is replaced with#[ignore].just testandjust clippyboth pass--all-features, so the feature would have made CI run ~24 minutes of live-network tests. They still compile (so clippy lints them) and run with--run-ignored all.kstringis pinned to 2.0.2 — 2.0.3+ requires rustc 1.96, above our MSRV of 1.95. Reached transitively viagix-attributes→gix→rustsec.deny.tomlallows RUSTSEC-2024-0436 (unmaintainedpaste, viacel-interpreter, no safe upgrade) andCDLA-Permissive-2.0(webpki-root-certs, viareqwest's rustls backend).Normalizing
cargo-ensure-no-cyclic-depsIts directory (
cargo_ensure_no_cyclic_deps) did not match its package name, which produced dead links in the root README and in its own publishedrepository/homepagemetadata. Renamed the directory to match, and brought the crate in line with the others: workspace-inherited dependencies, authors and homepage; shared logo and favicon; docs.rs metadata.Root documentation fixes
README.mdlisted only 4 of the 7 tools built here — it now lists all of them.CHANGELOG.mdlinked to 22 crates from the oxidizer repo, none of which exist here, so every link was dead. It now links to this repo's changelogs.cargo-eachchangelog.add-crate.ps1now preserves existing changelog links verbatim instead of rebuilding them from package names, so a future directory/package mismatch cannot silently break them.Binary file handling
.zst,.gzand other binary formats fell through to the catch-all* text eol=lfrule in.gitattributes, so Git rewrote CRLF byte pairs inside them. This was not hypothetical — the staged rustdoc JSON fixture had already been truncated from 46,200 to 46,197 bytes, which would not have decompressed.-textand moved them into LFS.lfs: trueon all CI checkouts, via thecargo-anviltemplates for the generated workflows, so LFS-stored test fixtures are not checked out as pointer files. Regeneration is idempotent (anvil --dry-runreports no pending changes).git lfs install --localas a setup step inDEVELOPMENT.md.Validation
All run locally against the full workspace:
cargo build --workspace --all-features --all-targetscargo clippy --workspace --all-targets --all-featurescargo nextest run --workspace --all-featurescargo test --doc --workspace --all-featurescargo doc --workspace --no-deps --all-features(nightly)cargo fmt --all --check(nightly)cargo sort --check --grouped --workspacecargo heathercargo deny --all-features --workspace check allcargo spellcheckjust readme-checkcargo check-external-types(nightly)Pre-existing and unrelated: the
cargo-anvil::schemasteststaplo_validates_emitted_toml_filesandactionlint_validates_emitted_workflowsfail locally withPermission denied (os error 13)when spawning their validators. They were excluded from the local run above; CI should exercise them normally.