Conversation
Reviewer's GuideThis PR establishes a locked nightly toolchain and rustfmt configuration, adds a release workflow that builds on stable, and then reformats the entire codebase to adhere to the new style rules. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis update introduces configuration files for continuous integration and Rust development tooling, including a GitHub Actions release workflow, Rust toolchain specification, and code formatting rules. Additionally, it applies consistent import grouping and code style refinements across source and test files, focusing on non-functional, stylistic improvements. Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant GitHub
participant GitHub Actions
participant Build System
Developer->>GitHub: Push tag "v*"
GitHub->>GitHub Actions: Trigger "Release" workflow
GitHub Actions->>Build System: Checkout code, install Rust toolchain
Build System->>Build System: Build project (cargo build --release)
Build System->>GitHub Actions: Upload "wireframe" binary as artifact
Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate Unit Tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Hey @leynos - I've reviewed your changes - here's some feedback:
- Consider splitting the rustfmt configuration and CI toolchain pinning into one commit/PR and the bulk formatting changes into another to keep the revision history and reviews focused.
- Pinning the toolchain to a specific nightly date may lead to CI breakage when that snapshot expires—consider using the floating
nightlychannel or a more update‐resilient approach.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider splitting the rustfmt configuration and CI toolchain pinning into one commit/PR and the bulk formatting changes into another to keep the revision history and reviews focused.
- Pinning the toolchain to a specific nightly date may lead to CI breakage when that snapshot expires—consider using the floating `nightly` channel or a more update‐resilient approach.
## Individual Comments
### Comment 1
<location> `rust-toolchain.toml:2` </location>
<code_context>
+[toolchain]
+channel = "nightly-2025-06-10"
+components = ["rustfmt", "clippy"]
</code_context>
<issue_to_address>
Pinning to a specific nightly date may become unavailable
Using a hardcoded nightly date risks breakage if that build is removed. Consider using `channel = "nightly"` or regularly updating the date.
</issue_to_address>
<suggested_fix>
<<<<<<< SEARCH
channel = "nightly-2025-06-10"
=======
channel = "nightly"
>>>>>>> REPLACE
</suggested_fix>
### Comment 2
<location> `src/server.rs:337` </location>
<code_context>
#[allow(clippy::type_complexity)]
/// Runs a worker task that accepts incoming TCP connections and processes them asynchronously.
///
</code_context>
<issue_to_address>
Missing module-level item comment (`//!`) at the top of the file.
Please add a module-level item comment at the top of this file using the `//!` syntax to describe the purpose of the module, as required by the review instructions.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Actionable comments posted: 6
🔭 Outside diff range comments (1)
src/extractor.rs (1)
32-113: Expand single-line functions to multi-line blocks
Prettier checks require methods and functions to be defined over multiple lines.--- a/src/extractor.rs +++ b/src/extractor.rs @@ -31,7 +31,10 @@ impl Payload<'_> { - pub fn remaining(&self) -> usize { self.data.len() } + pub fn remaining(&self) -> usize { + self.data.len() + } #[deprecated(since = "0.2.0", note = "construct via `inner.into()` instead")] - pub fn new(inner: Arc<T>) -> Self { Self(inner) } + pub fn new(inner: Arc<T>) -> Self { + Self(inner) + } @@ -87,7 +90,10 @@ impl<T: Send + Sync> From<Arc<T>> for SharedState<T> { - fn from(inner: Arc<T>) -> Self { Self(inner) } + fn from(inner: Arc<T>) -> Self { + Self(inner) + } } impl<T: Send + Sync> From<T> for SharedState<T> { - fn from(inner: T) -> Self { Self(Arc::new(inner)) } + fn from(inner: T) -> Self { + Self(Arc::new(inner)) + } } @@ -112,7 +118,10 @@ impl<T: Send + Sync> std::ops::Deref for SharedState<T> { - fn deref(&self) -> &Self::Target { &self.0 } + fn deref(&self) -> &Self::Target { + &self.0 + } }
🧹 Nitpick comments (3)
src/preamble.rs (1)
50-74: Documentation section now contains duplicated / disordered paragraphsLines 59-64 re-introduce the “Errors” heading and explanatory text that already exists immediately above. The result is two “Errors” sections and a broken sentence at line 60 (“Returns a [
DecodeError] if decoding the preamble fails or an Asynchronously reads…”).-/// # Errors -/// -/// Returns a [`DecodeError`] if decoding the preamble fails or an -/// Asynchronously reads and decodes ... +/// # Errors +/// +/// Returns a [`DecodeError`] if decoding fails or if an I/O error occurs while +/// reading from the reader.Cleaning this up avoids confusing rust-doc output.
src/middleware.rs (1)
52-53: Minor doc-comment grammar“Returns a response produced by the service, or an error if the service fails to handle the request.” reads better without the line break that splits the sentence mid-phrase.
.github/workflows/release.yml (1)
1-25: Restrict GitHub Actions permissions for security
Grant the workflow only the minimal required permissions to reduce risk.name: Release on: push: tags: - 'v*' +permissions: + contents: read jobs: build:
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
.github/workflows/release.yml(1 hunks).rustfmt.toml(1 hunks)rust-toolchain.toml(1 hunks)src/app.rs(3 hunks)src/extractor.rs(5 hunks)src/message.rs(3 hunks)src/middleware.rs(1 hunks)src/preamble.rs(2 hunks)src/rewind_stream.rs(1 hunks)src/server.rs(10 hunks)tests/preamble.rs(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/middleware.rs (4)
src/app.rs (2)
new(41-41)service(63-66)src/extractor.rs (1)
new(84-84)src/rewind_stream.rs (1)
new(20-26)src/server.rs (1)
new(68-83)
src/message.rs (1)
src/preamble.rs (1)
borrow_decode_from_slice(115-115)
🪛 GitHub Actions: CI
src/middleware.rs
[error] 41-44: Prettier formatting check failed. Function 'new' should be expanded to multiple lines.
src/app.rs
[error] 38-41: Prettier formatting check failed. Code formatting does not match expected style; function 'new' should be expanded to multiple lines.
src/message.rs
[error] 1-7: Prettier formatting check failed. Imports should be formatted on separate lines.
[error] 19-22: Prettier formatting check failed. Function 'to_bytes' should be expanded to multiple lines.
src/server.rs
[error] 186-189: Prettier formatting check failed. Function 'worker_count' should be expanded to multiple lines.
src/extractor.rs
[error] 29-32: Prettier formatting check failed. Method 'remaining' should be formatted with braces and on multiple lines.
[error] 81-84: Prettier formatting check failed. Function 'new' should be expanded to multiple lines.
[error] 88-91: Prettier formatting check failed. Function 'from' should be expanded to multiple lines.
[error] 92-95: Prettier formatting check failed. Function 'from' should be expanded to multiple lines.
[error] 110-113: Prettier formatting check failed. Function 'deref' should be expanded to multiple lines.
🪛 GitHub Check: CodeQL
.github/workflows/release.yml
[warning] 10-24: Workflow does not contain permissions
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}
🔇 Additional comments (18)
rust-toolchain.toml (1)
2-3: Nightly toolchain pin may quickly become staleLocking to a dated nightly (
nightly-2025-06-10) gives reproducibility today but is prone to breakage once components disappear from the nightly index or if newer language features are required. Consider:-channel = "nightly-2025-06-10" +# Prefer either: +# channel = "nightly" # always latest +# or +# channel = "1.XX" # stable version if no nightly-only features are usedIf nightly is unavoidable, automate periodic bumps (e.g. via
dependabot-config.yml) so CI does not silently rot.src/rewind_stream.rs (1)
1-5: Grouped imports look goodThe consolidated
std::{ … }import matches the new rustfmt config and keeps the prelude tidy. No functional impact.src/preamble.rs (1)
1-1: Import consolidation fine – but verify unused items
error::DecodeErroris now pulled into the grouped list ― good. Just confirm no orphanuse bincode::error::DecodeError;remains elsewhere to avoid duplicates.tests/preamble.rs (1)
2-8: Import grouping LGTMThe grouped
tokioandwireframeimports improve readability and match the new style guide.src/extractor.rs (1)
1-1: Consolidated imports improve readability
Groupingstdimports into a single line reduces clutter and matches project style.src/app.rs (1)
1-1: Use groupedstdimports consistently
The consolidated importuse std::{boxed::Box, collections::HashMap, future::Future, pin::Pin};matches the project’s formatting conventions.src/server.rs (12)
8-11: Consolidated standard library imports look clean.
Groupingstdimports into a single block improves readability and maintainability.
14-18: Tokio imports are well grouped.
Thetokiocrate imports are logically consolidated, easing future additions or removals.
20-24: Crate imports are neatly sorted.
Imports from the local crate follow a consistent order, enhancing clarity.
55-56: Reflowing doc comments is clear.
The multi-line description now wraps nicely in Rustdoc style and reads well.
87-88: Doc comment adjusted for clarity.
The expanded note about dropping previous callbacks is more explicit.
92-93: Type parameter docs are explicit.
Specifying the required trait bounds in the documentation aids user comprehension.
201-202: Doc comment clarification forbind.
The revised description adds useful context on binding behaviour and error conditions.
249-251: Enhanced method doc forrun.
The expanded details on how shutdown is handled improve overall comprehension.
340-342: Worker task doc comments extended.
The elaborated description of exponential backoff and graceful shutdown is helpful.
378-384: Stream processing doc refined.
The documentation now fully covers both success and failure code paths.
436-442: Test imports consolidated.
Groupingstdimports within the test module aligns with the project's import style.
446-450: Tokio and test crates neatly grouped.
Consistent consolidation of external crate imports enhances readability.
…n permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Release file not needed for wireframe
Use newer sha for toolchain
Summary
+stableTesting
cargo clippy --all-targets --all-features -- -D warningsRUSTFLAGS="-D warnings" cargo testnpx -y markdownlint-cli2 '**/*.md' '#node_modules'nixie docs/preamble-validator.mdhttps://chatgpt.com/codex/tasks/task_e_685039965f508322968e3c9587a04a06
Summary by Sourcery
Configure Rust formatting, toolchains, and release automation, and reformat the codebase to match the new rules.
Enhancements:
Build:
CI:
Summary by CodeRabbit