Import Rust template documentation#33
Conversation
|
Warning Review limit reached
Your plan includes 10 reviews of capacity. Refill in 7 minutes and 25 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, 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 trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (15)
WalkthroughThe PR extends the Rust Copier template with build environment isolation for cross-compilation (pinning cross via commit SHA and clearing RUSTFLAGS), introduces four new documentation templates (contents index, user guide, developer guide, repository layout), standardises documentation architecture through updated style rules, expands AGENTS.md with detailed quality contracts for testing and observability, refines existing testing documentation, and comprehensively validates generated project structure and guidance through expanded test helpers and contract assertions. ChangesExtended Rust Copier Template: Quality Contracts and Documentation
Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 15 | ❌ 5❌ Failed checks (5 warnings)
✅ Passed checks (15 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Reviewer's GuideUpdates the Rust Copier template so generated projects have stricter Rust tooling (Cranelift + mold + lld, llvm-tools, Whitaker, nextest), richer Cargo metadata, pinned CI/release workflows, and new contributor/docs scaffolding, all enforced via expanded pytest-copier tests that render lib/app projects and run their public gates. Sequence diagram for generated CI test and lint workflowsequenceDiagram
participant CI as GitHub_Actions_ci_yml
participant Repo as Generated_Project_Repo
participant RustSetup as setup-rust_action
participant Mold as Install_mold_linker_step
participant UV as setup-uv_action
participant Tools as Install_template_test_tools_step
participant CacheW as actions_cache_for_Whitaker
participant WhitakerInst as Install_Whitaker_step
participant Make as make_test_target
CI->>Repo: actions_checkout
CI->>RustSetup: leynos/shared-actions/setup-rust
CI->>Mold: run apt-get install clang lld mold
CI->>UV: astral-sh/setup-uv
CI->>Tools: cargo binstall cargo-nextest
Tools->>Tools: uv tool install mbake
CI->>CacheW: actions/cache (whitaker paths)
CI->>WhitakerInst: cargo install whitaker-installer (if cache-miss)
WhitakerInst->>WhitakerInst: whitaker-installer --cranelift
CI->>Make: make test
Make->>Make: cargo nextest run || cargo test
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
2221c5f to
39226c5
Compare
13d144e to
2df4039
Compare
2df4039 to
b7439c4
Compare
|
@coderabbitai please create a new GitHub issue for the following: Verify each finding against current code. Fix only still-valid issues, skip the Outside diff comments:
|
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain
🏁 Script executed: Length of output: 56
|
Add the requested testing and documentation requirements to the generated AGENTS.md, including app and library-specific users-guide wording.
Fold reusable improvements from sibling project docs into the shared template copies while leaving project-specific policy and title-case drift behind. Keep the Markdown style guide aligned with repository-layout guidance, fix malformed doctest references, refresh dependency-injection examples, and apply stable wrapping and table formatting.
Add in-template documentation contents and repository layout references for generated Rust projects. Render the layout by project flavour so app projects include the release workflow and executable entrypoint while library projects document the library crate root. Cover the generated documents in the pytest-copier contract tests.
Filter blank package metadata answers before rendering Cargo.toml, pin cross to an immutable revision in the generated app release workflow, and repair the rstest guide grammar issue. Split the generated tooling contract test into focused assertion helpers and add a regression case for blank keywords and categories.
Set an empty `RUSTFLAGS` environment for generated release artifact builds so `cross build` does not inherit repository-local mold linker flags from `.cargo/config.toml`.
Document `tracing` as the default logging and diagnostics facade and require `metrics` for usage, uptake, failure, and mitigation metric emission in generated project instructions.
Add rendered user and developer guides that describe public Makefile targets, cargo-nextest fallback behaviour, Whitaker linting, and Cranelift debug code generation.
Keep the templated README focused on documentation entry points and move technical tooling detail out of its contract.
Update the generated README contract and structured workflow snapshot to match the rebased template output.
b7439c4 to
ce6ca40
Compare
Summary
This pull request targets
origin/rust-project-enhancementsand layers the generated-template documentation work onto the Rust project tooling enhancements already present on that base branch.It updates the generated
AGENTS.mdcontract, adds in-template documentation navigation, refreshes shared generated-project documentation, and tightens review findings that were in scope for this PR: keyword/category filtering, immutablecrossinstallation, a Markdown grammar fix, and focused parent-template contract assertions.Review Walkthrough
template/AGENTS.md.jinjafor the generated agent guidance. It now renders flavour-specific documentation expectations for application versus library projects and records the expected rigour forrstest,rstest-bdd,proptest,kani, andverus.template/docs/contents.md.jinjaandtemplate/docs/repository-layout.md.jinjafor the new generated documentation navigation and generated repository layout reference.template/docs/documentation-style-guide.md,template/docs/complexity-antipatterns-and-refactoring-strategies.md,template/docs/reliable-testing-in-rust-via-dependency-injection.md,template/docs/rust-doctest-dry-guide.md, andtemplate/docs/rust-testing-with-rstest-fixtures.md.template/Cargo.toml.jinjafor empty keyword/category filtering before rendering Cargo metadata.template/.github/workflows/{% if flavour == 'app' %}release.yml{% endif %}.jinjafor immutablecrossinstallation via the dereferenced commit forv0.2.5.tests/test_template.pyfor the rendered-output contract checks, including the split helper assertions for package metadata, Makefile contracts, local tooling, CI, release workflow configuration, and generated documentation.Validation
make test 2>&1 | tee /tmp/test-agent-template-rust-update-templated-documentation.out:12 passed in 21.44smarkdownlint-cli2 template/docs/rust-testing-with-rstest-fixtures.md:Summary: 0 error(s)git diff --check: cleanrg --fixed-strings -- "v0.2.5" template tests: no matchesrg --fixed-strings -- "--tag" template tests: only the negative assertion remainscoderabbit review --agent:review_completed,findings: 0Notes
This PR is intended to be reviewed against
origin/rust-project-enhancements, notorigin/main.The snapshot-test request was left out of this PR because it would expand the parent-template assertion strategy and test dependencies beyond the in-scope review fixes. The current changes keep the existing rendered-output contract style while reducing the large contract test into focused assertion helpers.
During formatting,
mdtablefixexposed a reproducible issue where wrapping can split GitHub Flavoured Markdown footnote reference markers such as[^4]. The affected generated documentation was repaired manually, and a draft issue with a minimal testcase was written locally to/tmp/mdtablefix-breaks-gfm-refs-issue.md.