chore(release): prepare v0.4.1#267
Conversation
|
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. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughVersion bump from 0.4.0 to 0.4.1 across the entire workspace, including all crate manifests, documentation examples, CHANGELOG, and build infrastructure. Adds preflight validation to verify consistency of version numbers in documentation snippets against workspace versions. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request prepares the repository for the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request prepares for the v0.4.1 release by bumping version numbers across the workspace, updating the changelog and documentation, and introducing a new publish-preflight check. The new check in xtask validates that versioned dependency snippets in documentation are up-to-date, which is a great addition for release hygiene. My review includes one suggestion to make this new check more robust and maintainable by recursively searching for relevant files instead of using a hardcoded list.
| fn versioned_dependency_snippet_files() -> Result<Vec<PathBuf>> { | ||
| let mut files = vec![ | ||
| PathBuf::from("README.md"), | ||
| PathBuf::from("crates/uselesskey/src/lib.rs"), | ||
| ]; | ||
|
|
||
| for entry in | ||
| fs::read_dir("crates").context("failed to read crates dir for doc version checks")? | ||
| { | ||
| let entry = entry.context("failed to read crates dir entry for doc version checks")?; | ||
| let readme = entry.path().join("README.md"); | ||
| if readme.is_file() { | ||
| files.push(readme); | ||
| } | ||
| } | ||
|
|
||
| files.sort(); | ||
| Ok(files) | ||
| } |
There was a problem hiding this comment.
The current implementation for finding files with version snippets is a bit brittle as it hardcodes crates/uselesskey/src/lib.rs and only looks for README.md files in the top-level of each crate directory. This could miss version snippets in other documentation files or library source files in the future.
A more robust approach would be to recursively search for all .md and .rs files in the workspace, which would make this check more maintainable. This can be done with a recursive inner function to avoid adding new dependencies.
fn versioned_dependency_snippet_files() -> Result<Vec<PathBuf>> {
fn walk(dir: &Path, files: &mut Vec<PathBuf>) -> Result<()> {
let name = dir.file_name().and_then(|s| s.to_str()).unwrap_or("");
if matches!(name, ".git" | "target" | ".cargo") {
return Ok(());
}
for entry in fs::read_dir(dir).with_context(|| format!("read_dir failed for {dir:?}"))? {
let entry = entry.context("failed to read dir entry")?;
let path = entry.path();
if path.is_dir() {
walk(&path, files)?;
} else if path.is_file() {
if let Some(ext) = path.extension().and_then(|s| s.to_str()) {
if ext == "md" || ext == "rs" {
files.push(path);
}
}
}
}
Ok(())
}
let mut files = Vec::new();
walk(Path::new("."), &mut files)?;
files.sort();
Ok(files)
}There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
xtask/src/main.rs (1)
1308-1313:⚠️ Potential issue | 🟡 MinorRecord
preflight:doc-versionsin the docs-only fast path too.This branch skips the new step when there are no Cargo changes, but the earlier
plan.docs_onlyearly return still never records it. After addingpreflight:doc-versions, docs-onlyxtask prreceipts will now have a different preflight step set than every other path.Suggested fix
if plan.docs_only { let reason = Some("docs-only".to_string()); runner.skip("fmt", reason.clone()); runner.skip("clippy", reason.clone()); runner.skip("tests", reason.clone()); @@ runner.skip("coverage", reason.clone()); runner.skip("coverage:report", reason.clone()); runner.skip("root-tests", reason.clone()); runner.skip("xtask-tests", reason.clone()); runner.skip("preflight:metadata", reason.clone()); + runner.skip("preflight:doc-versions", reason.clone()); for name in PUBLISH_CRATES { runner.skip(&format!("preflight:package:{name}"), reason.clone()); } return Ok(()); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@xtask/src/main.rs` around lines 1308 - 1313, The docs-only early-return path (check of plan.docs_only) never records the "preflight:doc-versions" step; add the same recording used in the no-Cargo-changes path so receipts are consistent. Modify the docs-only branch to call runner.skip("preflight:doc-versions", Some("docs-only".into())) (or the same message used elsewhere, e.g. "no cargo changes") alongside the other preflight skips, ensuring the symbol plan.docs_only and method runner.skip are used so the "preflight:doc-versions" step is recorded for the docs-only fast path.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@xtask/src/main.rs`:
- Around line 987-1005: versioned_dependency_snippet_files() currently uses
cwd-relative paths which breaks when the process is started from a subdirectory;
change it to resolve everything from the repo workspace root via the existing
workspace_path() helper: replace PathBuf::from("README.md") and
PathBuf::from("crates/uselesskey/src/lib.rs") with
workspace_path().join("README.md") and
workspace_path().join("crates/uselesskey/src/lib.rs"), call
fs::read_dir(workspace_path().join("crates")) instead of fs::read_dir("crates"),
and when building per-crate readme paths use entry.path().join("README.md") or
workspace_path().join(...) as appropriate before checking is_file() and pushing
to files so all lookups are workspace-root relative.
---
Outside diff comments:
In `@xtask/src/main.rs`:
- Around line 1308-1313: The docs-only early-return path (check of
plan.docs_only) never records the "preflight:doc-versions" step; add the same
recording used in the no-Cargo-changes path so receipts are consistent. Modify
the docs-only branch to call runner.skip("preflight:doc-versions",
Some("docs-only".into())) (or the same message used elsewhere, e.g. "no cargo
changes") alongside the other preflight skips, ensuring the symbol
plan.docs_only and method runner.skip are used so the "preflight:doc-versions"
step is recorded for the docs-only fast path.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: e253ee62-fc4b-4e31-95ce-a66daa0c77f4
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (62)
CHANGELOG.mdCargo.tomlREADME.mdcrates/uselesskey-aws-lc-rs/Cargo.tomlcrates/uselesskey-aws-lc-rs/README.mdcrates/uselesskey-bdd-steps/Cargo.tomlcrates/uselesskey-core-base62/Cargo.tomlcrates/uselesskey-core-cache/Cargo.tomlcrates/uselesskey-core-factory/Cargo.tomlcrates/uselesskey-core-hash/Cargo.tomlcrates/uselesskey-core-hmac-spec/Cargo.tomlcrates/uselesskey-core-id/Cargo.tomlcrates/uselesskey-core-jwk-builder/Cargo.tomlcrates/uselesskey-core-jwk-shape/Cargo.tomlcrates/uselesskey-core-jwk/Cargo.tomlcrates/uselesskey-core-jwks-order/Cargo.tomlcrates/uselesskey-core-keypair-material/Cargo.tomlcrates/uselesskey-core-keypair/Cargo.tomlcrates/uselesskey-core-kid/Cargo.tomlcrates/uselesskey-core-negative-der/Cargo.tomlcrates/uselesskey-core-negative-pem/Cargo.tomlcrates/uselesskey-core-negative/Cargo.tomlcrates/uselesskey-core-rustls-pki/Cargo.tomlcrates/uselesskey-core-seed/Cargo.tomlcrates/uselesskey-core-sink/Cargo.tomlcrates/uselesskey-core-token-shape/Cargo.tomlcrates/uselesskey-core-token/Cargo.tomlcrates/uselesskey-core-x509-chain-negative/Cargo.tomlcrates/uselesskey-core-x509-derive/Cargo.tomlcrates/uselesskey-core-x509-negative/Cargo.tomlcrates/uselesskey-core-x509-spec/Cargo.tomlcrates/uselesskey-core-x509/Cargo.tomlcrates/uselesskey-core/Cargo.tomlcrates/uselesskey-ecdsa/Cargo.tomlcrates/uselesskey-ed25519/Cargo.tomlcrates/uselesskey-feature-grid/Cargo.tomlcrates/uselesskey-hmac/Cargo.tomlcrates/uselesskey-jsonwebtoken/Cargo.tomlcrates/uselesskey-jsonwebtoken/README.mdcrates/uselesskey-jwk/Cargo.tomlcrates/uselesskey-pgp/Cargo.tomlcrates/uselesskey-ring/Cargo.tomlcrates/uselesskey-ring/README.mdcrates/uselesskey-rsa/Cargo.tomlcrates/uselesskey-rustcrypto/Cargo.tomlcrates/uselesskey-rustcrypto/README.mdcrates/uselesskey-rustls/Cargo.tomlcrates/uselesskey-rustls/README.mdcrates/uselesskey-test-grid/Cargo.tomlcrates/uselesskey-token-spec/Cargo.tomlcrates/uselesskey-token/Cargo.tomlcrates/uselesskey-tonic/Cargo.tomlcrates/uselesskey-tonic/README.mdcrates/uselesskey-x509/Cargo.tomlcrates/uselesskey/Cargo.tomlcrates/uselesskey/README.mdcrates/uselesskey/src/lib.rsdocs/explanation/roadmap.mddocs/how-to/publishing.mddocs/how-to/release.mdtests/Cargo.tomlxtask/src/main.rs
89d6581 to
2064eff
Compare
Summary
0.4.1across workspace manifests, lockfile, and versioned dependency snippetspublish-preflightdoc-version check inxtaskso staleuselesskey*README examples fail before publish0.4.1cutVerification
cargo test -p xtaskcargo xtask gate --checkcargo xtask publish-preflightcargo xtask publish-check