Skip to content

refactor(workspace): relax lints, downgrade core crates, and expand documentation - #341

Merged
mroczect merged 32 commits into
masterfrom
libvctrl/root
Aug 21, 2026
Merged

refactor(workspace): relax lints, downgrade core crates, and expand documentation#341
mroczect merged 32 commits into
masterfrom
libvctrl/root

Conversation

@mroczect

@mroczect mroczect commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Summary

This PR fundamentally reverts the workspace to a more permissive developmental state by downgrading multiple crate versions, relaxing Clippy and Rustc lints from deny to warn, and removing the zeroize security dependency. It simultaneously modernizes the CI pipeline, simplifies the Makefile, heavily documents the public facade, and replaces a large standalone integration test suite with inline doctests.

Motivation & Context

The previous state of the repository enforced an extremely strict deny-based linting policy and had progressed to versions like 2.2.0/3.2.0/5.2.0. This change suggests a strategic pivot or reset, intentionally reverting to older minor versions (e.g., 2.1.x/3.0.x/5.0.x) likely to establish a cleaner baseline before future releases. The removal of zeroize from a cryptographic crate indicates a trade-off where secure memory wiping was deprioritized, possibly to simplify dependencies or support a broader no_std environment without alloc overhead. Replacing the public_api.rs integration tests with doctests indicates a shift towards documentation-driven development, ensuring examples are always compilable while reducing the maintenance burden of a separate test file.

Detailed Changes

  • .github/workflows/rust.yml: Removes the hardcoded toolchain: 1.96.0 parameter, allowing the GitHub Action to default to the latest stable toolchain. Eliminates the git config --global core.autocrlf false workaround from all jobs, suggesting that line-ending issues have been resolved at the repository level or are no longer deemed necessary.
  • Cargo.lock: Synchronizes the dependency tree to reflect the intentional downgrades of libvctrl, libvctrl_core, libvctrl_handler, libvctrl_plumbing, and libvctrl_sha512. Completely removes the zeroize crate and removes criterion as a dependency of libvctrl_handler.
  • Cargo.toml (root): Compresses the workspace members array into a single line. Drastically rewrites the [workspace.lints.rust] and [workspace.lints.clippy] sections, downgrading the vast majority of rules from "deny" to "warn" and allowing previously forbidden lints like pedantic, nursery, std_instead_of_core, and std_instead_of_alloc.
  • Makefile: Simplifies the default CLIPPY_FLAGS to be empty instead of -D warnings. Removes redundant strict CI targets (ci-fast, clippy-strict, check-all). Removes the --workspace flag from the base clippy target, narrowing its scope. Translates echo outputs from Indonesian to English and strips Unicode emojis. Hardcodes the publish-all sequence and explicitly drops libvctrl_sha512 from the publication list. Changes the run target to default to the workspace root instead of requiring the PKG variable.
  • libvctrl/Cargo.toml: Updates internal dependency version constraints to point to the newly downgraded crate versions (5.0.0, 3.0.0, 3.0.0).
  • libvctrl/src/lib.rs: Transforms the root module into a heavily documented unified facade. Adds a comprehensive module-level docstring explaining the architecture, re-export strategy, and safety invariants, accompanied by a full working code example. Appends detailed rustdocs to every single pub use statement at the crate root.
  • libvctrl/tests/public_api.rs: Deletes this 215-line integration test file entirely. This file previously covered hash roundtrips, validation functions, builder patterns, codec roundtrips, hasher APIs, and in-memory store operations.
  • libvctrl_core/Cargo.toml: Downgrades internal dependency versions to align with the workspace reset.
  • libvctrl_core/src/codec/binary_decoder.rs: Replaces alloc::str and alloc::sync::Arc with their std equivalents, aligning with the newly allowed std_instead_of_core lint. Adds extensive rustdocs to the module, the BinaryDecoder struct, and all trait implementation methods (decode_blob, decode_tree, decode_commit, decode_tag). Each method now includes format specifications, error conditions, and fully functional doctests that effectively replace the deleted integration tests.

Impact & Breaking Changes

Breaking changes are present. The intentional downgrade of published crate versions (e.g., libvctrl_sha512 from 3.2.0 to 3.0.0) will break downstream dependents using semver ranges like ^3.1.0 or ^3.2.0. The removal of the zeroize dependency from the cryptographic crate is a breaking change if downstream code relied on the Zeroize trait implementation for secure memory clearing. The deletion of libvctrl/tests/public_api.rs reduces the explicit test coverage of the facade crate, relying entirely on the new doctests to catch regressions. The CI pipeline's removal of the pinned toolchain version means builds may suddenly fail if a new Rust stable release introduces breaking changes or new warnings.

Testing Recommendations

Execute cargo test --workspace --doc to verify that all newly introduced doctests successfully compile and pass, effectively proving that they cover the functionality previously held by the deleted public_api.rs. Run make ci to ensure the relaxed linting rules and unpinned CI toolchain do not introduce unexpected failures. Attempt to build a downstream crate against these downgraded versions to confirm the impact of the version retraction.

* test(sha512): cover HKDF edge cases
* test(sha512): cover HMAC key handling
* test(sha512): add SHA-384 vectors
* test(sha512): add SHA-512 vectors
* test(sha512): cover utility helpers
* test(sha512): remove legacy integration tests
* test(sha512): add integration test helper
* test(sha512): add public API vectors
* chore(workspace): update sha512 lock version
* chore(libvctrl): update dependency versions
* chore(core): update dependency versions
* chore(plumbing): update libvctrl version
* chore(sha512): bump crate version
…ety (#334)

* chore(workspace): update Cargo.lock for handler benchmarks

* chore(handler): add criterion dev-dependency and benchmark target

* style(handler): remove unnecessary blank lines

* style(handler): remove unnecessary blank lines

* style(handler): remove unnecessary blank line

* refactor(handler): use alloc and reorder imports

* refactor(handler): add extern crate and test imports

* style(handler): remove unnecessary blank lines

* style(handler): reorder imports

* style(handler): reorder imports

* style(handler): reorder imports

* refactor(handler): add Clone bound to Entry and clean up

* style(handler): remove unnecessary blank lines

* style(handler): reorder imports

* style(handler): reorder imports

* style(handler): remove unnecessary blank lines

* style(handler): remove unnecessary blank lines

* style(handler): reorder imports

* refactor(handler): use HashSet for parent deduplication

* refactor(handler): use specific imports and iter types

* refactor(handler): reorder imports and use wrapping_add

* style(handler): remove unnecessary blank line

* fix(handler): improve duplicate detection in Tree

* style(handler): remove unnecessary blank lines

* fix(handler): validate ref name components more strictly

* bench(handler): add handler benchmarks

* test(handler): add blob tests

* test(handler): add commit tests

* test(handler): add commit_meta tests

* test(handler): add common test utilities

* test(handler): add delta tests

* test(handler): add entry_kind tests

* test(handler): add errors tests

* test(handler): add hash tests

* test(handler): add criterion import to hash_validation

* test(handler): add criterion import to type_validation

* test(handler): add tag_reflog tests

* test(handler): add traits_index tests

* test(handler): add tree tests

* test(handler): add user_id tests

* test(handler): add validation tests
* test(handler): fix empty slice assertion

* test(handler): make test helpers public and add lint attributes

* test(handler): use first() instead of get(0)
* test(core): add comprehensive tests for binary decoder

* test(core): add tests for binary encoder and fix clippy

* test(core): add tests for sha512 hasher

* style(core): add alloc extern and allow lint

* test(core): add tests for blob builder

* test(core): add tests for commit builder

* test(core): add tests for tag builder

* test(core): add tests for tree and tree entry builders

* test(core): add tests for memory store

* test(core): add tests for memory ref store

* test(core): remove obsolete codec_test

* test(core): remove obsolete store_test

* test(core): add builder API integration tests

* test(core): add codec roundtrip integration tests

* test(core): add common test utilities
* test(core): remove inline tests from binary_decoder

* test(core): remove inline tests from binary_encoder

* test(core): remove inline tests from sha512

* test(core): remove inline tests from blob

* test(core): remove inline tests from commit

* test(core): remove inline tests from tag

* test(core): remove inline tests from tree

* test(core): remove inline tests from memory store

* test(core): remove inline tests from ref_store

* test(core): remove builder_api integration tests

* test(core): remove codec_roundtrip integration tests

* test(core): remove common test utilities
* test(core): rewrite binary_decoder tests with roundtrip checks

* test(core): add binary_encoder tests and roundtrip checks

* test(core): add sha512 hasher tests with known vectors

* test(core): add blob builder tests

* test(core): add commit builder tests

* test(core): add tag builder tests

* test(core): add tree and tree entry builder tests

* test(core): add memory store tests

* test(core): add memory ref store tests

* test(core): add common test utilities

* test(core): add builder integration tests

* test(core): add codec integration roundtrip tests

* test(core): add hasher integration test

* test(core): add store integration tests
* fix(plumbing): improve cat_file safety and error handling

* style(plumbing): add alloc extern

* test(plumbing): update cat_file integration tests
@mroczect mroczect self-assigned this Aug 21, 2026
@mroczect mroczect added the enhancement New feature or request label Aug 21, 2026
@mroczect mroczect added audit audit report inspection See issues with this label labels Aug 21, 2026
@github-project-automation github-project-automation Bot moved this to Todo in libvctrl Aug 21, 2026
* style(root): remove unnecessary blank lines

* test(root): add public API integration tests
* chore: update Cargo.lock for version bumps

* chore(root): bump version to 2.2.0

* chore(core): bump version to 3.2.0

* chore(handler): bump version to 5.2.0

* chore(plumbing): bump version to 0.3.0

* chore(sha512): bump version to 3.2.0
@mroczect
mroczect merged commit 73840b2 into master Aug 21, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in libvctrl Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

audit audit report enhancement New feature or request inspection See issues with this label

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant