docs: add module-level documentation to 11 crates#37
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (11)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review Summary by QodoAdd module-level documentation to 11 uselesskey crates
WalkthroughsDescription• Adds comprehensive module-level documentation to 11 crates • Documents purpose, functionality, and key types for each module • Improves API discoverability and developer onboarding • Minor formatting cleanup in core-cache imports Diagramflowchart LR
A["11 Crate Modules"] -->|"Add doc comments"| B["Module Documentation"]
B -->|"Describe purpose"| C["API Clarity"]
B -->|"Explain types"| D["Developer Onboarding"]
File Changes1. crates/uselesskey-bdd-steps/src/lib.rs
|
Code Review by Qodo
1.
|
| use alloc::sync::Arc; | ||
| use core::any::Any; | ||
| use core::fmt; | ||
|
|
||
| #[cfg(feature = "std")] | ||
| use dashmap::DashMap; | ||
| #[cfg(not(feature = "std"))] | ||
| use spin::Mutex; |
There was a problem hiding this comment.
1. Broken no_std build 🐞 Bug ✓ Correctness
uselesskey-core-cache now imports dashmap::DashMap unconditionally even though the crate supports no_std and dashmap is only enabled via the std feature. This will fail compilation when built with default-features = false (or otherwise without std) due to an unresolved import / missing optional dependency.
Agent Prompt
### Issue description
`uselesskey-core-cache` supports `no_std` (`#![cfg_attr(not(feature = "std"), no_std)]`) and uses a `spin::Mutex<BTreeMap<...>>` fallback when `std` is disabled. However, it unconditionally imports `dashmap::DashMap`, even though `dashmap` is an optional dependency only enabled by the `std` feature. This breaks compilation when building with `default-features = false`.
### Issue Context
`dashmap` is optional and only included in the `std` feature (`std = ["dep:dashmap", ...]`). Therefore, any `no_std` build will not have `dashmap` available.
### Fix Focus Areas
- crates/uselesskey-core-cache/src/lib.rs[11-18]
- crates/uselesskey-core-cache/src/lib.rs[24-28]
### Expected fix
Add back `#[cfg(feature = "std")]` to the import, e.g.:
```rust
#[cfg(feature = "std")]
use dashmap::DashMap;
```
(or remove the import and reference `dashmap::DashMap` only inside `#[cfg(feature="std")]` sections).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
Pull request overview
This PR adds crate/module-level Rustdoc (//! ...) documentation to multiple uselesskey workspace crates to better describe each crate’s purpose and how it fits into the overall fixture-generation/testing ecosystem.
Changes:
- Added module-level documentation to interop, BDD, and core utility crates.
- Clarified (via docs) roles like seed/ID derivation, caching, and negative fixture generation.
- Minor import/attribute reshuffling in
uselesskey-core-cachealongside the new docs.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/uselesskey-interop-tests/src/lib.rs | Adds crate-level docs describing the interoperability test crate. |
| crates/uselesskey-feature-grid/src/lib.rs | Adds crate-level docs describing canonical feature/matrix definitions for automation. |
| crates/uselesskey-core-seed/src/lib.rs | Adds crate-level docs for seed parsing/redaction primitives. |
| crates/uselesskey-core-negative/src/lib.rs | Adds crate-level docs for negative fixture builders (PEM/DER corruption). |
| crates/uselesskey-core-kid/src/lib.rs | Adds crate-level docs for deterministic kid helpers. |
| crates/uselesskey-core-keypair-material/src/lib.rs | Adds crate-level docs for PKCS#8/SPKI material helpers shared across crates. |
| crates/uselesskey-core-id/src/lib.rs | Adds crate-level docs for ArtifactId and deterministic derivation primitives. |
| crates/uselesskey-core-hash/src/lib.rs | Adds crate-level docs for length-prefixed hashing helpers. |
| crates/uselesskey-core-factory/src/lib.rs | Adds crate-level docs describing the fixture factory orchestration/caching. |
| crates/uselesskey-core-cache/src/lib.rs | Adds crate-level docs for the cache primitives; also adjusts imports around dashmap/spin. |
| crates/uselesskey-bdd-steps/src/lib.rs | Adds crate-level docs describing cucumber step definitions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -8,8 +13,6 @@ | |||
| use alloc::sync::Arc; | |||
| use core::any::Any; | |||
| use core::fmt; | |||
There was a problem hiding this comment.
dashmap is an optional dependency enabled only by the std feature (see Cargo.toml), but the use dashmap::DashMap; import is now unconditional. Building this crate with default-features = false / without std will fail to compile. Gate the import with #[cfg(feature = "std")] (or move it into the #[cfg(feature = "std")] sections that use it).
| use core::fmt; | |
| use core::fmt; | |
| #[cfg(feature = "std")] |
| //! artifacts keyed by `(domain, label, spec, variant)` tuples. This avoids | ||
| //! expensive re-generation (especially RSA) across test runs. |
There was a problem hiding this comment.
The new module docs say the cache is keyed by (domain, label, spec, variant) tuples, but the actual key type is ArtifactId, which also includes spec_fingerprint and derivation_version. Consider updating the docs to reference ArtifactId directly (or list its full fields) to avoid misleading readers.
| //! artifacts keyed by `(domain, label, spec, variant)` tuples. This avoids | |
| //! expensive re-generation (especially RSA) across test runs. | |
| //! artifacts keyed by [`ArtifactId`](uselesskey_core_id::ArtifactId). This identifier | |
| //! captures the artifact domain, label, spec, variant, spec fingerprint, and | |
| //! derivation version, avoiding expensive re-generation (especially RSA) across test runs. |
| //! Cross-backend interoperability tests for uselesskey. | ||
| //! | ||
| //! Verifies that keys generated by uselesskey work correctly across multiple | ||
| //! cryptographic backends (ring, aws-lc-rs, rustls, RustCrypto, jsonwebtoken). |
There was a problem hiding this comment.
The module-level docs claim these interop tests cover backends like aws-lc-rs, rustls, and jsonwebtoken, but this crate’s Cargo.toml/tests/interop.rs only exercises ring plus RustCrypto crates (p256, ed25519-dalek, rsa). Please update the docs to match the actual backends used (or add the missing backends/tests).
| //! cryptographic backends (ring, aws-lc-rs, rustls, RustCrypto, jsonwebtoken). | |
| //! cryptographic backends (ring and RustCrypto crates such as p256, ed25519-dalek, rsa). |
3416df1 to
b8583e6
Compare
- Gate dashmap import behind cfg(feature=std) (fixes no_std build) - Update cache docs to reference ArtifactId instead of raw tuple - Fix interop-tests docs to list actual backends (ring + RustCrypto) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
b8583e6 to
bba0603
Compare
Adds module doc comments.