Skip to content

Write user guide and packaging workflow updates - #47

Merged
leynos merged 4 commits into
mainfrom
terragon/docs-user-guide-release-6oe94n
Dec 21, 2025
Merged

Write user guide and packaging workflow updates#47
leynos merged 4 commits into
mainfrom
terragon/docs-user-guide-release-6oe94n

Conversation

@leynos

@leynos leynos commented Dec 19, 2025

Copy link
Copy Markdown
Owner

Summary

  • Adds a comprehensive user guide (docs/users-guide.md) detailing installation, a tutorial, and a full lading.toml reference.
  • Aligns documentation references across README and guides (points to the new user guide and usage guide).
  • Introduces packaging workflow improvements:
    • make build-release now uses the repository-managed virtual environment via uv to build sdist and wheel.
    • pyproject.toml dev-dependency updated to include build.
  • Expands tests to cover the user guide:
    • New unit tests ensure the user guide contains required sections and config keys.
    • E2E tests updated to exercise a tutorial workflow and dry-run publish path.
  • Minor documentation/design updates note Phase 4 work and coverage.

Changes

Documentation

  • Added docs/users-guide.md withInstallation, Tutorial, and Configuration reference for lading.toml.
  • Updated README.md to reference docs/users-guide.md and docs/usage-guide.md.
  • Updated docs/usage-guide.md to point to the new user guide.

Build & Packaging

  • Makefile: build-release now depends on build target and runs via uv (uv run python -m build).
  • pyproject.toml: added build to [tool.poetry.dev-dependencies]-style section (dev-dependencies).

Tests

  • New tests/unit/test_users_guide.py to verify the user guide contains required sections and keys.
  • E2E tests updated to cover the tutorial workflow and dry-run publish; mocks adjusted for new commands.
  • Updated tests/docs references to reflect new documentation structure.

Documentation & Roadmap

  • docs/roadmap.md shows completed tasks for "Write User Guide" and "Package for PyPI".
  • docs/lading-design.md Phase 4 updates reference the new user guide and test coverage.

Test Plan

  • Run unit tests: pytest
  • Run E2E tests: pytest tests/e2e (with required environment/mocks for cargo, lading)
  • Validate docs: ensure docs/users-guide.md exists and contains all required sections and config keys as validated by tests/unit/test_users_guide.py
  • Build artifacts: run make build-release to verify sdist and wheel creation using uv

Notes for reviewers

  • The new user guide is intended to be the primary reference for end-users and aligns with the updated tests to guard against documentation drift.
  • Changes in Makefile and pyproject.toml enable reproducible packaging in CI and local development.

🌿 Generated by Terry


ℹ️ Tag @terragon-labs to ask questions and address PR feedback

📎 Task: https://www.terragonlabs.com/task/d20422f4-3778-4c63-bb16-b2715e46c937

Summary by Sourcery

Add an end-user user guide, align documentation and roadmap with the new guide and packaging workflow, standardise release builds using uv, and extend tests to cover documentation and publish workflows.

New Features:

  • Introduce a comprehensive docs/users-guide.md covering installation, a tutorial workflow, and full lading.toml configuration reference.

Enhancements:

  • Update README and usage guide to point to the new user guide and clarify installation and invocation guidance.
  • Refine lading project description in pyproject.toml to better describe its purpose.
  • Mark roadmap tasks for writing the user guide and packaging for PyPI as complete and document Phase 4 updates in the design doc.
  • Standardise cargo metadata stubbing and cmd-mox recording helpers in E2E tests for reuse and stricter argument validation.
  • Adjust the build-release Makefile target to run packaging via the repo-managed uv environment and depend on the build target.

Build:

  • Add the build tool to the dev dependency group for reproducible sdist and wheel creation via uv.

Tests:

  • Add unit tests to ensure the user guide exists, contains required sections, and documents all supported configuration keys.
  • Expand E2E scenarios to cover the tutorial bump-and-publish workflow, including default and forbid-dirty publish behaviours and publish ordering expectations.

… reference

- Add new docs/users-guide.md as primary guide for installation, usage tutorial, and full lading.toml reference.
- Ensure documentation completeness with tests verifying all configuration keys are covered.
- Update README.md to link prominently to the new user guide.
- Update docs and tests to integrate the user guide into e2e scenarios.
- Standardize release builds via Makefile using repository-managed virtual environment.

This enhances onboarding and user experience by providing detailed, up-to-date documentation aligned with current features.

Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Dec 19, 2025

Copy link
Copy Markdown

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Summary by CodeRabbit

Release Notes

  • Documentation

    • New comprehensive user guide added covering installation, tutorial, and complete lading.toml configuration reference
    • README expanded with separate bulleted sections for user guide and usage guide
    • Roadmap updated to reflect completion of user guide and PyPI packaging phases
  • Build Improvements

    • Build process now executes within a uv-managed virtual environment for consistent dependency resolution

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Document set expanded with a new user guide and revised usage notes; Makefile build-release now runs within the repository-managed uv environment; configuration validation centralised into per-section TOML key constants; E2E and unit tests extended to exercise tutorial publish flows and verify guide coverage.

Changes

Cohort / File(s) Summary
Build & Project config
Makefile, pyproject.toml
make build-release now depends on build and runs uv run python -m build --sdist --wheel. Project [project].description updated and build added to dev dependency-group.
Documentation
README.md, docs/lading-design.md, docs/roadmap.md, docs/usage-guide.md, docs/users-guide.md
Added docs/users-guide.md (installation, tutorial, lading.toml reference). README Learn more section expanded into bullets. Roadmap Phase 4 items marked complete. Usage and design docs updated with Phase 4 notes.
Configuration validation
lading/config.py
Introduced constants for TOML key sets: CONFIG_ROOT_TOML_KEYS, BUMP_TOML_KEYS, BUMP_DOCUMENTATION_TOML_KEYS, PUBLISH_TOML_KEYS, PREFLIGHT_TOML_KEYS. Refactored all from_mapping validators to use these constants.
E2E tests & helpers
tests/e2e/features/e2e.feature, tests/e2e/helpers/e2e_steps_helpers.py, tests/e2e/steps/test_e2e_steps.py
Added tutorial workflow scenario and a step checking cargo publish omits --allow-dirty when forbid-dirty set. Updated E2EExpectationError.args_prefix_mismatch signature to accept multiple expected prefixes. Refactored command stubbing: introduced argument-validation helpers and configuration-driven stubs; replaced some cmd_mox.mock calls with cmd_mox.stub.
Unit tests for user guide
tests/unit/test_users_guide.py
New tests assert presence of Installation/Tutorial/Configuration sections, verify the guide documents all supported config keys (driven from lading.config constants), and confirm key CLI flags and environment variables are shown.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify TOML key constants in lading/config.py match the documented lading.toml reference and are used consistently across all from_mapping methods.
  • Validate E2E helpers in tests/e2e/steps/test_e2e_steps.py enforce expected argument prefixes and target-dir detection correctly for all stubbed commands.
  • Confirm Makefile changes invoke uv correctly in CI/developer flows and that pyproject.toml dev dependency addition is intentional.
  • Check unit tests in tests/unit/test_users_guide.py correctly derive expected terms from lading.config and are robust to formatting changes in the guide.

Poem

📚 A guide unfolds with keys all aligned,
Tests march through flows that documentation signed,
Build wrapped in uv, artifacts prepared,
Config constants gathered, validations declared,
Publish and bump sing in organised mind. ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarises the main changes: adding a comprehensive user guide and improving the packaging workflow, which are the primary objectives of this pull request.
Description check ✅ Passed The description comprehensively outlines all major changes across documentation, build configuration, and tests, directly aligned with the changeset contents.
Docstring Coverage ✅ Passed Docstring coverage is 95.83% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch terragon/docs-user-guide-release-6oe94n

📜 Recent review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between de594d3 and 7dc6c47.

📒 Files selected for processing (2)
  • docs/lading-design.md (1 hunks)
  • docs/users-guide.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
docs/**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

docs/**/*.md: Use the markdown files within the docs/ directory as a knowledge base and source of truth for project requirements, dependency choices, and architectural decisions.
Proactively update relevant files in the docs/ directory when new decisions are made, requirements change, libraries are added/removed, or architectural patterns evolve to keep documentation accurate and current.

docs/**/*.md: Use British English based on the Oxford English Dictionary (en-GB-oxendict) with suffixes: -ize in words like 'realize' and 'organization', -lyse in words like 'analyse' and 'paralyse', -our in words like 'colour' and 'behaviour', -re in words like 'centre' and 'calibre', double 'l' in words like 'cancelled' and 'counsellor', maintain 'e' in words like 'likeable', -ogue in words like 'catalogue'
Use the Oxford comma in documentation: 'ships, planes, and hovercraft' where it aids comprehension
Treat company names as collective nouns in documentation, for example 'Lille Industries are expanding'
Write headings in sentence case
Use Markdown headings (#, ##, ###, and so on) in order without skipping levels
Follow markdownlint recommendations for Markdown formatting
Always provide a language identifier for fenced code blocks; use 'plaintext' for non-code text
Use '-' as the first level bullet and renumber lists when items change in Markdown
Prefer inline links using text or angle brackets around the URL in Markdown
Ensure blank lines before and after bulleted lists and fenced blocks in Markdown
Ensure tables have a delimiter line below the header row in Markdown
Expand any uncommon acronym on first use, for example, Continuous Integration (CI)
Wrap paragraphs at 80 columns in documentation
Wrap code at 120 columns in documentation
Do not wrap tables in documentation
Use footnotes referenced with [^label] in Markdown documentation
Include Mermaid diagrams in documentation where they add clarity
When embedding figures in documentation, use ![alt text](path/to...

Files:

  • docs/lading-design.md
  • docs/users-guide.md
**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

**/*.md: For Markdown files (.md only), ensure changes pass lint checks via make markdownlint.
For Markdown files (.md only), ensure Mermaid diagrams pass validation using nixie via make nixie.

Files:

  • docs/lading-design.md
  • docs/users-guide.md

⚙️ CodeRabbit configuration file

**/*.md: * Avoid 2nd person or 1st person pronouns ("I", "you", "we")

  • Use en-GB-oxendict (-ize / -yse / -our) spelling and grammar
  • Headings must not be wrapped.
  • Documents must start with a level 1 heading
  • Headings must correctly increase or decrease by no more than one level at a time
  • Use GitHub-flavoured Markdown style for footnotes and endnotes.
  • Numbered footnotes must be numbered by order of appearance in the document.

Files:

  • docs/lading-design.md
  • docs/users-guide.md
🪛 LanguageTool
docs/users-guide.md

[style] ~49-~49: To form a complete sentence, be sure to include a subject.
Context: ...atches = "per-crate" ``` lading.toml can be omitted entirely. When absent, `ladi...

(MISSING_IT_THERE)


[grammar] ~153-~153: This phrase is duplicated. You should probably use “array of” only once.
Context: ...invocation. | |aux_build | array of array of strings |[]` | Extra commands (tok...

(PHRASE_REPETITION)

🔍 Remote MCP Deepwiki

Summary — additional facts relevant to reviewing this PR

  • The Makefile/packaging change (build-release now runs build inside the repo-managed venv) matches repository docs: release artifacts are expected to be built with uv-managed environment (uv run python -m build); pyproject.dev group must include "build" for this to work locally/CI.

  • The repo’s recommended developer workflow and CI rely on uv for venv/dependency management and on python -m build to produce sdist/wheel in dist/. Updating Makefile to use uv run aligns with that documented workflow.

  • Configuration constants in lading/config.py (bump, publish, preflight keys) are the canonical source of truth used by unit tests (tests/unit/test_users_guide.py derives expected doc terms from these constants). Changes to those constants must remain stable to keep tests in sync.

  • Tests (unit + BDD) use cmd-mox IPC stubbing for external commands (cargo, git). The publish preflight logic uses an injected command runner and checks LADING_USE_CMD_MOX_STUB/CMOX_IPC_SOCKET; E2E test changes that adjust cargo argument validation (allow-dirty vs forbid-dirty) interact with these stubs, so test handlers must accept both modes.

  • Publish preflight behavior: git cleanliness (git status --porcelain) is skipped when --allow-dirty is set; cargo check and cargo test still run. The E2E tests explicitly assert cargo publish arg differences when forbid-dirty vs default. Review Makefile/CI expectations for preflight in case build-release usage affects preflight assumptions.

  • Documentation additions (docs/users-guide.md, usage-guide updates) are intended to be the canonical end-user reference and are validated by unit tests that assert presence of installation, tutorial, config keys, CLI flags and env vars. The tests read config constants to build expected terms.

Sources

  • Repository docs and generated wiki content (installation, packaging, config, testing, publish/bump command behavior) — Deepwiki_read_wiki_contents.
⏰ Context from checks skipped due to timeout of 120000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Sourcery review

Comment @coderabbitai help to get the list of available commands and usage tips.

@sourcery-ai

sourcery-ai Bot commented Dec 19, 2025

Copy link
Copy Markdown

Reviewer's Guide

Introduces a new end-user user guide and aligns project documentation around it, standardises release builds through uv-driven packaging, and extends unit/E2E tests to validate documentation coverage and publish workflows, including new cargo invocation expectations.

Flow diagram for documentation and tests integration

flowchart TD
    DocsUsersGuide[docs/users-guide.md]
    DocsUsageGuide[docs/usage-guide.md]
    Readme[README.md]

    UnitTests[test_users_guide.py]
    E2EFeature[tests/e2e/features/e2e.feature]
    E2ESteps[tests/e2e/steps/test_e2e_steps.py]

    DocsUsersGuide -->|installation, tutorial, config reference| EndUsers
    Readme -->|links to| DocsUsersGuide
    Readme -->|links to| DocsUsageGuide
    DocsUsageGuide -->|points readers to| DocsUsersGuide

    UnitTests -->|assert sections and config keys exist in| DocsUsersGuide

    E2EFeature -->|scenario definitions use| TutorialWorkflow[Tutorial bump and publish workflow]
    TutorialWorkflow -->|invokes| LadingCLI[lading CLI]

    LadingCLI -->|calls| CargoCommands[cargo check/test/package/publish]
    E2ESteps -->|stub and assert| CargoCommands
Loading

File-Level Changes

Change Details Files
Refactor E2E cargo stubbing to support multiple valid argument prefixes and enforce target-dir semantics, and extend publish workflow coverage.
  • Extract generic helpers to validate command arg prefixes and required --target-dir position for cmd-mox invocations.
  • Replace inlined recording handler factory with a reusable _create_recording_handler that records all cargo invocations in a shared list.
  • Configure stubs for cargo::check, cargo::test, cargo::package, and cargo::publish with richer expectations, including allow-dirty vs forbid-dirty dry-run prefixes.
  • Add a new step definition to run lading publish with default allow-dirty behaviour and assert success in E2E scenarios.
  • Extend the feature file with a tutorial workflow scenario that bumps to a new version and runs publish, asserting preflight and publish order behaviour.
tests/e2e/steps/test_e2e_steps.py
tests/e2e/features/e2e.feature
Introduce a comprehensive user guide and wire the documentation set (README, usage guide, roadmap, design doc) to treat it as the primary end-user reference.
  • Add docs/users-guide.md with installation instructions, a tutorial, configuration reference for lading.toml, and CLI/environment reference.
  • Update README to link explicitly to the new user guide and reposition the existing usage guide as implementation-focused.
  • Update the usage guide to defer end-user tutorial/configuration material to the new user guide and clarify installation via uv and wheels.
  • Mark user guide and PyPI packaging tasks as complete in the roadmap and describe Phase 4 documentation work in the design document.
docs/users-guide.md
README.md
docs/usage-guide.md
docs/roadmap.md
docs/lading-design.md
Tighten packaging workflow by running release builds inside the uv-managed environment and ensuring build tooling is present in dev dependencies.
  • Change the Makefile build-release target to depend on build and execute uv run python -m build to generate sdist and wheel artefacts.
  • Add build to the dev dependency group in pyproject.toml so the build module is available in the synced development environment.
  • Clarify the project description string in pyproject.toml to better reflect the tool’s purpose.
Makefile
pyproject.toml
Add unit tests that enforce user guide structure and coverage of configuration keys, and adjust E2E helpers for more flexible cargo metadata stubbing.
  • Create tests/unit/test_users_guide.py to assert that the user guide exists, includes required sections, and mentions all supported configuration keys and tables.
  • Switch cargo metadata mocking in E2E helpers from mock to stub to better match usage patterns while still providing deterministic metadata responses.
tests/unit/test_users_guide.py
tests/e2e/helpers/e2e_steps_helpers.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

codescene-delta-analysis[bot]

This comment was marked as outdated.

@leynos

leynos commented Dec 19, 2025

Copy link
Copy Markdown
Owner Author

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix:

tests/e2e/steps/test_e2e_steps.py

Comment on file

    def _recording_handler(
        label: str,
        expected_prefix: tuple[str, ...] = (),
        expected_prefixes: tuple[tuple[str, ...], ...] = (),

❌ New issue: Complex Method
given_cargo_commands_stubbed has a cyclomatic complexity of 9, threshold = 9

@coderabbitai

This comment was marked as resolved.

Refactor e2e test setup for cargo command stubs by introducing helper
functions to validate command args and create invocation handlers. This
removes duplicated logic and centralizes validation and recording of
cmd-mox invocations for cargo commands like check, test, package, and publish.

Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
@leynos
leynos marked this pull request as ready for review December 20, 2025 01:08
sourcery-ai[bot]

This comment was marked as resolved.

- Improved documentation for configuration keys including bump, publish, preflight sections.
- Corrected wording and formatting for clarity in the tutorial section.
- Added references for CLI flags like --forbid-dirty, --live, and environment variables.
- Ensured coverage matches current code schema to prevent documentation drift.

Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
@leynos

leynos commented Dec 20, 2025

Copy link
Copy Markdown
Owner Author

@coderabbitai Have the following now been resolved?

Please address the comments from this code review:

## Overall Comments
- In the new cargo command stubbing helpers, `_validate_target_dir` hardcodes `--target-dir` at position 2; consider scanning the full arg list for that prefix so the tests remain stable if argument ordering changes in the CLI layer.
- When raising `E2EExpectationError.args_prefix_mismatch` from `_validate_args_prefix`, you only pass the first expected prefix even when multiple prefixes are allowed; including all acceptable prefixes in the error message would make debugging mismatches easier.
- The config key list in `test_users_guide_documents_all_supported_config_keys` duplicates schema knowledge as string literals; if possible, derive this list from the actual configuration schema or a shared constant to reduce the chance of test and implementation drifting out of sync.

## Individual Comments

### Comment 1
<location> `tests/e2e/steps/test_e2e_steps.py:153-160` </location>
<code_context>
     return run_cli(repo_root, workspace.root, "publish", "--forbid-dirty")


+@when("I run lading publish in the E2E workspace", target_fixture="cli_run")
+def when_run_lading_publish_allow_dirty(
+    repo_root: Path,
+    e2e_state: dict[str, typ.Any],
+) -> dict[str, typ.Any]:
+    """Invoke `lading publish` using the default allow-dirty behaviour."""
+    workspace: workspace_builder.NonTrivialWorkspace = e2e_state["workspace"]
+    return run_cli(repo_root, workspace.root, "publish")
+
+
</code_context>

<issue_to_address>
**question (testing):** Add explicit assertions that distinguish the default publish flow from the forbid-dirty flow in terms of `cargo publish` flags

Since the handler already records invocations, please add/extend a `then` step that inspects `invocation_records` to assert:

- In the default publish scenario, `cargo::publish` is called with `--allow-dirty --dry-run`.
- In the `--forbid-dirty` scenario, `cargo::publish` is called only with `--dry-run` and never with `--allow-dirty`.

This will make the E2E tests explicitly verify the two flows and guard against regressions in the publish flags.
</issue_to_address>

### Comment 2
<location> `tests/unit/test_users_guide.py:18-27` </location>
<code_context>
+    assert "## Configuration reference (`lading.toml`)" in content
+
+
+def test_users_guide_documents_all_supported_config_keys() -> None:
+    """Guard against documentation drift when the config schema changes."""
+    content = Path("docs/users-guide.md").read_text(encoding="utf-8")
+
+    required_terms = (
+        "[bump]",
+        "[bump.documentation]",
+        "[publish]",
+        "[preflight]",
+        "`exclude`",
+        "`globs`",
+        "`order`",
+        "`strip_patches`",
+        "`test_exclude`",
+        "`unit_tests_only`",
+        "`aux_build`",
+        "`compiletest_extern`",
+        "`env`",
+        "`stderr_tail_lines`",
+    )
+
+    missing = [term for term in required_terms if term not in content]
+    assert not missing, f"users guide missing terms: {missing}"
</code_context>

<issue_to_address>
**suggestion (testing):** Extend documentation coverage tests to also assert CLI flags and environment variables are documented

The tests currently only guard against drift for `lading.toml` keys, even though this phase also targets CLI flags and environment variables.

To better lock in the user guide contract, consider adding coverage so that:
- Key CLI flags (e.g. `lading publish --forbid-dirty`, `--config`) must appear in the guide.
- Any important environment variables (if supported) must also be documented.

This will keep CLI-related docs from silently falling out of sync over time.

Suggested implementation:

```python
    missing = [term for term in required_terms if term not in content]
    assert not missing, f"users guide missing terms: {missing}"


def test_users_guide_documents_key_cli_flags_and_env_vars() -> None:
    """Guard against documentation drift for CLI flags and environment variables."""
    content = Path("docs/users-guide.md").read_text(encoding="utf-8")

    required_cli_terms = (
        "lading publish --forbid-dirty",
        "`--config`",
    )

    required_env_terms: tuple[str, ...] = ()

    missing_cli = [term for term in required_cli_terms if term not in content]
    missing_env = [term for term in required_env_terms if term not in content]

    assert not missing_cli, f"users guide missing CLI terms: {missing_cli}"
    assert not missing_env, f"users guide missing env var terms: {missing_env}"

```

To fully cover environment variables, populate `required_env_terms` with the concrete strings that appear in your users guide for each important environment variable (for example, backticked names like ``"\\`LADING_FOO\\`"``). You may also want to expand `required_cli_terms` with any other flags or subcommands that should be locked into the documentation contract.
</issue_to_address>

### Comment 3
<location> `docs/users-guide.md:131-140` </location>
<code_context>
+| `exclude` | array of string | `[]`    | Crate names to exclude from manifest updates. |
</code_context>

<issue_to_address>
**suggestion (typo):** Consider pluralising "array of string"/"array of array of string" for grammatical clarity.

This wording appears in all relevant configuration table rows (e.g., `exclude`, `globs`, `order`, `test_exclude`, `aux_build`); consider updating each to use plural forms for consistency and clarity.

Suggested implementation:

```
array of strings

```

```
array of array of strings

```
</issue_to_address>

### Comment 4
<location> `docs/users-guide.md:34` </location>
<code_context>
+
+## Tutorial
+
+This tutorial assumes you have a Rust workspace with a root `Cargo.toml` and
+one or more member crates.
+
</code_context>

<issue_to_address>
**issue (review_instructions):** This line uses the second-person pronoun "you", which the documentation guidelines prohibit.

The phrase "you have" introduces second person. Consider rephrasing to something like:

"This tutorial assumes a Rust workspace with a root `Cargo.toml` and one or more member crates."

This keeps the meaning while avoiding second-person pronouns.

<details>
<summary>Review instructions:</summary>

**Path patterns:** `**/*.md`

**Instructions:**
Avoid 2nd person or 1st person pronouns ("I", "you", "we").

</details>
</issue_to_address>

### Comment 5
<location> `docs/users-guide.md:49` </location>
<code_context>
+strip_patches = "per-crate"
+```
+
+You can omit `lading.toml` entirely. When absent, `lading` uses the defaults
+documented in the configuration reference below.
+
</code_context>

<issue_to_address>
**issue (review_instructions):** The sentence starts with "You", which conflicts with the instruction to avoid first/second-person pronouns.

To comply with the style guidelines, rephrase to avoid "You". For example:

"`lading.toml` can be omitted entirely. When absent, `lading` uses the defaults documented in the configuration reference below."

<details>
<summary>Review instructions:</summary>

**Path patterns:** `**/*.md`

**Instructions:**
Avoid 2nd person or 1st person pronouns ("I", "you", "we").

</details>
</issue_to_address>

### Comment 6
<location> `docs/users-guide.md:66` </location>
<code_context>
+lading bump 1.2.3 --dry-run
+```
+
+If you configured `bump.documentation.globs`, `lading` will also search those
+Markdown files for TOML code fences and update version values that refer to
+workspace crates.
</code_context>

<issue_to_address>
**issue (review_instructions):** This conditional clause uses "you", which violates the no first/second-person pronoun rule.

Consider rephrasing to avoid directly addressing the reader. For example:

"If `bump.documentation.globs` is configured, `lading` also searches those Markdown files for TOML code fences and updates version values that refer to workspace crates."

<details>
<summary>Review instructions:</summary>

**Path patterns:** `**/*.md`

**Instructions:**
Avoid 2nd person or 1st person pronouns ("I", "you", "we").

</details>
</issue_to_address>

### Comment 7
<location> `docs/users-guide.md:72` </location>
<code_context>
+
+### 3. Publish in dry-run mode
+
+By default, `publish` runs `cargo publish --dry-run` so you can validate the
+full pipeline without uploading crates.
+
</code_context>

<issue_to_address>
**issue (review_instructions):** The clause "so you can validate" uses second person, which is disallowed by the documentation guidelines.

To adhere to the style requirements, rephrase to avoid second person. For example:

"By default, `publish` runs `cargo publish --dry-run` so the full pipeline can be validated without uploading crates."

<details>
<summary>Review instructions:</summary>

**Path patterns:** `**/*.md`

**Instructions:**
Avoid 2nd person or 1st person pronouns ("I", "you", "we").

</details>
</issue_to_address>

@coderabbitai

coderabbitai Bot commented Dec 20, 2025

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Read the test files and documentation to check resolution status
echo "=== tests/e2e/steps/test_e2e_steps.py ==="
cat tests/e2e/steps/test_e2e_steps.py

echo -e "\n\n=== tests/unit/test_users_guide.py ==="
cat tests/unit/test_users_guide.py

echo -e "\n\n=== docs/users-guide.md ==="
cat docs/users-guide.md

Length of output: 20056


@leynos: Yes, all the review comments have been resolved! Here's the status:

Overall Comments ✅

  1. _validate_target_dir position hardcoding — Resolved. The function now scans the entire argument list using any(argument.startswith("--target-dir=") for argument in args) instead of checking a specific position.

  2. Error message for args_prefix_mismatch — Resolved. The function now passes all expected_prefixes to the error instead of only the first one.

  3. Config key duplication — Resolved. test_users_guide_documents_all_supported_config_keys() now derives keys from config_module.BUMP_TOML_KEYS, BUMP_DOCUMENTATION_TOML_KEYS, PUBLISH_TOML_KEYS, and PREFLIGHT_TOML_KEYS instead of hardcoding strings.

Individual Comments ✅

Comment 1 (publish flow assertions) — Resolved. Two new @then steps have been added:

  • then_cargo_publish_uses_allow_dirty() verifies --allow-dirty --dry-run in the default flow.
  • then_cargo_publish_omits_allow_dirty() verifies only --dry-run (no --allow-dirty) in the forbid-dirty flow.

Comment 2 (CLI flags and env vars tests) — Resolved. New test test_users_guide_documents_key_cli_flags_and_env_vars() checks for CLI terms (lading bump 1.2.3 --dry-run, lading publish --forbid-dirty, lading publish --live, ### \--workspace-root`) and environment variables (LADING_WORKSPACE_ROOT, LADING_LOG_LEVEL`).

Comment 3 (pluralise "array of string") — Resolved. All configuration tables now use "array of strings" and "array of array of strings".

Comments 4-7 (second-person pronouns) — Resolved. All instances removed:

  • Line 34: "a Rust workspace" (not "you have a Rust workspace")
  • Line 49: "lading.toml can be omitted" (not "You can omit")
  • Line 66: "If bump.documentation.globs is configured" (not "If you configured")
  • Line 72: "so the full pipeline can be validated" (not "so you can validate")

All review feedback has been addressed. 🎉

       /)/)
      (='.'=)
     (")_(")_/
    Noted! ✓

@leynos

leynos commented Dec 20, 2025

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Dec 20, 2025

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@leynos

leynos commented Dec 21, 2025

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Dec 21, 2025

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@leynos

leynos commented Dec 21, 2025

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Dec 21, 2025

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c1dc67f and de594d3.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (12)
  • Makefile (1 hunks)
  • README.md (1 hunks)
  • docs/lading-design.md (1 hunks)
  • docs/roadmap.md (1 hunks)
  • docs/usage-guide.md (1 hunks)
  • docs/users-guide.md (1 hunks)
  • lading/config.py (6 hunks)
  • pyproject.toml (2 hunks)
  • tests/e2e/features/e2e.feature (1 hunks)
  • tests/e2e/helpers/e2e_steps_helpers.py (2 hunks)
  • tests/e2e/steps/test_e2e_steps.py (4 hunks)
  • tests/unit/test_users_guide.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
docs/**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

docs/**/*.md: Use the markdown files within the docs/ directory as a knowledge base and source of truth for project requirements, dependency choices, and architectural decisions.
Proactively update relevant files in the docs/ directory when new decisions are made, requirements change, libraries are added/removed, or architectural patterns evolve to keep documentation accurate and current.

docs/**/*.md: Use British English based on the Oxford English Dictionary (en-GB-oxendict) with suffixes: -ize in words like 'realize' and 'organization', -lyse in words like 'analyse' and 'paralyse', -our in words like 'colour' and 'behaviour', -re in words like 'centre' and 'calibre', double 'l' in words like 'cancelled' and 'counsellor', maintain 'e' in words like 'likeable', -ogue in words like 'catalogue'
Use the Oxford comma in documentation: 'ships, planes, and hovercraft' where it aids comprehension
Treat company names as collective nouns in documentation, for example 'Lille Industries are expanding'
Write headings in sentence case
Use Markdown headings (#, ##, ###, and so on) in order without skipping levels
Follow markdownlint recommendations for Markdown formatting
Always provide a language identifier for fenced code blocks; use 'plaintext' for non-code text
Use '-' as the first level bullet and renumber lists when items change in Markdown
Prefer inline links using text or angle brackets around the URL in Markdown
Ensure blank lines before and after bulleted lists and fenced blocks in Markdown
Ensure tables have a delimiter line below the header row in Markdown
Expand any uncommon acronym on first use, for example, Continuous Integration (CI)
Wrap paragraphs at 80 columns in documentation
Wrap code at 120 columns in documentation
Do not wrap tables in documentation
Use footnotes referenced with [^label] in Markdown documentation
Include Mermaid diagrams in documentation where they add clarity
When embedding figures in documentation, use ![alt text](path/to...

Files:

  • docs/lading-design.md
  • docs/roadmap.md
  • docs/usage-guide.md
  • docs/users-guide.md
**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

**/*.md: For Markdown files (.md only), ensure changes pass lint checks via make markdownlint.
For Markdown files (.md only), ensure Mermaid diagrams pass validation using nixie via make nixie.

Files:

  • docs/lading-design.md
  • README.md
  • docs/roadmap.md
  • docs/usage-guide.md
  • docs/users-guide.md

⚙️ CodeRabbit configuration file

**/*.md: * Avoid 2nd person or 1st person pronouns ("I", "you", "we")

  • Use en-GB-oxendict (-ize / -yse / -our) spelling and grammar
  • Headings must not be wrapped.
  • Documents must start with a level 1 heading
  • Headings must correctly increase or decrease by no more than one level at a time
  • Use GitHub-flavoured Markdown style for footnotes and endnotes.
  • Numbered footnotes must be numbered by order of appearance in the document.

Files:

  • docs/lading-design.md
  • README.md
  • docs/roadmap.md
  • docs/usage-guide.md
  • docs/users-guide.md
pyproject.toml

📄 CodeRabbit inference engine (.rules/python-00.md)

Configure tools like Ruff, Pyright, and Pytest using pyproject.toml

pyproject.toml: Use PEP 621 [project] table for metadata (name, version, description, readme, requires-python, license, authors, keywords, classifiers) and runtime dependencies
Include mandatory PEP 621 fields: name and version in the [project] table
Include recommended [project] metadata fields: description, readme (pointing to README.md), requires-python (e.g., >=3.10), license, authors, keywords, and classifiers
Declare runtime dependencies as a list in PEP 508 format within the [project] table dependencies field (e.g., "requests>=2.25")
Use [project.optional-dependencies] to group development and documentation dependencies separately from production dependencies
Define console entry points in [project.scripts] table and GUI entry points in [project.gui-scripts] table to expose CLIs or GUIs
Declare [build-system] table with requires = ["setuptools>=61.0", "wheel"] and build-backend = "setuptools.build_meta" to support editable installs
Set [tool.uv] with package = true to ensure uv sync builds and installs your project into its virtual environment
Keep pyproject.toml human-readable by editing it by hand when possible and using TOML-aware editors
Declare dynamic = ["version"] sparingly; only use it when your version is computed at build time (e.g., via setuptools_scm), and ensure your build backend supports dynamic metadata
Keep build system constraints minimal; omit [build-system] if you don't need editable installs, but set tool.uv.package = true to override default behavior

Files:

  • pyproject.toml
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: For Python files, ensure changes pass all relevant unit and behavioral tests according to testing guidelines.
For Python files, ensure changes pass lint checks via make lint.
For Python files, ensure changes adhere to formatting standards via make check-fmt.
For Python files, ensure changes pass type checking via make typecheck.
For Python development, refer to detailed guidelines in the .rules/ directory including Python Code Style Guidelines, Context Managers, Exception Design/Raising/Handling/Logging, Generators, Project Configuration, Return Patterns, and Typing best practices.

**/*.py: Use snake_case.py for Python file names, naming them for their contents
Use PascalCase for class names
Use snake_case for variable and function names
Use UPPER_SNAKE_CASE for module-level constants
Prefix private or internal helpers with a single underscore (_)
Enable and maintain full static type coverage using Pyright; use typing everywhere
Use TypedDict or @DataClass(slots=True) for structured data
Avoid Any; use precise types (TypeVar, Protocol, Literal, Union) and typing.cast only when necessary with justification
Be explicit with return type annotations using -> None, -> str, etc., for all public functions and class methods
Prefer immutability: use tuples over lists and types.MappingProxyType for read-only mappings
Enforce strict mode in Pyright; treat all Pyright warnings as CI errors and use # pyright: ignore sparingly with explanation
Avoid side effects at import time; modules should not modify global state or perform actions on import
Document public functions, classes, and modules using NumPy-format docstrings
Use inline comments to explain tricky code and non-obvious logic

**/*.py: Use context managers (via contextlib.contextmanager or __enter__/__exit__ methods) to encapsulate setup and teardown logic for resource management (files, locks, connections, etc.)
Use @contextlib.contextmanager decorator for straightforward procedural setup...

Files:

  • tests/e2e/helpers/e2e_steps_helpers.py
  • tests/e2e/steps/test_e2e_steps.py
  • tests/unit/test_users_guide.py
  • lading/config.py

⚙️ CodeRabbit configuration file

**/*.py: - Keep C90 / mccabe complexity ≤ 9

  • Follow single responsibility and CQRS (command/query segregation)
  • Prefer structural pattern matching to
  • Prefer structural pattern matching over isinstance() or imperative decomposition.
  • Docstrings must follow the numpy style guide. Use a single-line summary for private functions and methods, and full structured docs for all public interfaces.
  • Move conditionals with >2 branches to predicate/helper functions
  • Avoid eval, exec, pickle, monkey-patching, ctypes, unsafe shell
  • Every module must begin with a triple-quoted docstring explaining its purpose, utility, and usage, including example calls if appropriate.
  • Comments and docs must follow en-GB-oxendict (-ize / -yse / -our) spelling and grammar
  • Lint suppressions:
    • Blanket # noqa, file-level skips, and categories are forbidden
    • Only narrow in-line disables (# noqa: XYZ) are permitted, and must be accompanied by FIXME: or a ticket link, and used only as a last resort.
  • Use pytest fixtures for shared setup (conftest.py or fixtures/)
  • Replace duplicate tests with @pytest.mark.parametrize
  • Prefer pytest-mock or unittest.mock for stubs/mocks
  • Use assert …, "message" over bare asserts
  • Reflect all API/behaviour changes in docs/ and update roadmap on completion
  • Files must not exceed 400 logical lines:
    • Decompose large modules into subpackages
    • Split large match/case or dispatch tables by domain and collocate with targets if appropriate
    • Move bulky data (fixtures, templates) to external files for parsing at runtime
  • Mutable defaults and shadowed built-ins are forbidden
  • All code must have clear type hints using modern style (A | B, list[str], class Foo[A]:, type Bar = int, etc.), with ABC imports drawn from the correct stdlib module.
  • All path manipulation must be performed using pathlib for cross platform safety. Do not use string manipulation for extraction of path components or filename ele...

Files:

  • tests/e2e/helpers/e2e_steps_helpers.py
  • tests/e2e/steps/test_e2e_steps.py
  • tests/unit/test_users_guide.py
  • lading/config.py
**/test_*.py

📄 CodeRabbit inference engine (.rules/python-00.md)

**/test_*.py: Use pytest idioms: prefer fixtures over setup/teardown, parametrize broadly, avoid unnecessary mocks
Group related tests using class with method names prefixed by test_
Write tests from a user's perspective; test public behavior, not internals
Avoid mocking too much; prefer test doubles only for external services or non-deterministic behaviors

Files:

  • tests/e2e/steps/test_e2e_steps.py
  • tests/unit/test_users_guide.py
**/*test*.py

📄 CodeRabbit inference engine (.rules/python-exception-design-raising-handling-and-logging.md)

In tests, use narrow exception assertions with pytest.raises() specifying the expected type and optionally constraining the message via regex (B017)

Files:

  • tests/e2e/steps/test_e2e_steps.py
  • tests/unit/test_users_guide.py
🪛 LanguageTool
docs/lading-design.md

[style] ~619-~619: Would you like to use the Oxford spelling “Standardized”? The spelling ‘Standardised’ is also correct.
Context: ...out of sync with the documentation. - Standardised release builds via make build-release...

(OXFORD_SPELLING_Z_NOT_S)

docs/users-guide.md

[style] ~49-~49: To form a complete sentence, be sure to include a subject.
Context: ...atches = "per-crate" ``` lading.toml can be omitted entirely. When absent, `ladi...

(MISSING_IT_THERE)


[grammar] ~153-~153: This phrase is duplicated. You should probably use “array of” only once.
Context: ...invocation. | |aux_build | array of array of strings |[]` | Extra commands (tok...

(PHRASE_REPETITION)


[style] ~153-~153: Would you like to use the Oxford spelling “tokenized”? The spelling ‘tokenised’ is also correct.
Context: ... of strings | [] | Extra commands (tokenised) to run before cargo pre-flight checks....

(OXFORD_SPELLING_Z_NOT_S)

🔍 Remote MCP

The search results show similar Rust workspace publishing tools but not the specific lading project. Let me search more directly for lading and also check for information about the uv tool that's being integrated into the build process.Based on my research, I have gathered sufficient context about the tools and technologies referenced in this PR. Let me now compile the findings.

Summary of Relevant Context for PR Review

Build & Packaging Context

uv is a fast Python package manager and project manager that provides drop-in replacements for common pip, pip-tools, and virtualenv commands, extending their interfaces with advanced features such as dependency version overrides, platform-independent resolutions, and reproducible resolutions. The Makefile changes that integrate uv run python -m build align with uv's ability to build source distributions and binary distributions (wheels) for projects. This addresses the PR objective of standardizing release builds via the repository-managed virtual environment.

The pyproject.toml change to add "build" to dev-dependencies is appropriate since uv build is used to build source distributions and binary distributions (wheel) for projects, placing built artifacts in a dist/ subdirectory by default.

Configuration Schema & Testing

The PR introduces public constants in lading/config.py that centralize TOML key validation. The new test file tests/unit/test_users_guide.py appropriately validates documentation completeness by:

  • Testing that the user guide documents all supported config keys derived from the new constants
  • Verifying CLI flags and environment variable references appear in documentation

This approach ensures the user guide stays synchronized with the actual configuration schema as it evolves.

Test Refactoring Assessment

The E2E test refactoring addresses complexity concerns by extracting three helper functions (_validate_args_prefix, _validate_target_dir, _create_recording_handler) and converting to data-driven stub configuration. This reduces cyclomatic complexity in given_cargo_commands_stubbed and improves maintainability of the cargo command mocking logic.

Documentation Coverage

The user guide addition is comprehensive, covering installation methods, a tutorial workflow, and full configuration reference—all appropriate for an end-user document. The test-driven validation ensures documentation stays current with actual supported options as the tool evolves.

[::web_search::] for uv and Python build tools, [::web_search::] for Rust versioning and publishing context

⏰ Context from checks skipped due to timeout of 120000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Sourcery review
🔇 Additional comments (29)
docs/roadmap.md (1)

252-252: Roadmap task completion aligns with deliverables.

The transition to completed status for "Write User Guide" and "Package for PyPI" correctly reflects the addition of docs/users-guide.md and the standardised build workflow via uv.

Also applies to: 260-260

Makefile (1)

21-22: Build dependency and uv integration improve reproducibility.

The new dependency on the build target ensures the virtual environment is prepared before creating release artefacts. Wrapping the build command with uv run standardises the execution context and aligns with the addition of build to pyproject.toml dev dependencies.

pyproject.toml (2)

4-4: Description update provides clearer project purpose.

The updated description accurately conveys the tool's functionality for end users and aligns with the comprehensive user guide being added.


31-31: Build dependency addition supports release workflow.

Adding build to the dev dependency group enables the make build-release target to produce distribution artefacts via uv run python -m build, as documented in the external tools context.

README.md (1)

35-40: Learn more section provides clear navigation.

The restructured section effectively directs users to the appropriate guide based on their needs (end-user vs implementation details).

docs/usage-guide.md (1)

7-16: Installation guidance and cross-reference enhance usability.

The pointer to the end-user tutorial provides clear navigation, and the expanded installation notes accurately describe both wheel-based installation and development workflows.

docs/lading-design.md (1)

612-620: Phase 4 documentation accurately reflects deliverables.

The summary correctly describes the user guide addition, test coverage for configuration synchronisation, and standardised build workflow.

tests/e2e/features/e2e.feature (2)

21-21: Flag assertion step enhances test coverage.

The new step validates that --allow-dirty is correctly omitted when --forbid-dirty is set, ensuring the dirty-tree guard behaves as expected.


24-36: Tutorial workflow scenario provides comprehensive validation.

The new scenario exercises the complete bump-and-publish sequence documented in the user guide, verifying version propagation, dependency updates, and publish-flow assertions including --allow-dirty presence in the default path.

docs/users-guide.md (5)

1-11: Introduction provides clear tool overview.

The opening effectively describes the tool's capabilities without using second-person pronouns, adhering to documentation guidelines.


12-30: Installation instructions cover both workflows.

The section appropriately documents wheel-based installation for distribution and uv-based development setup, with properly annotated code blocks.


32-95: Tutorial workflow matches test scenarios.

The step-by-step tutorial aligns with the E2E test scenario added in tests/e2e/features/e2e.feature, ensuring documentation and test coverage remain synchronised.


97-152: Configuration reference provides comprehensive coverage.

The complete example and per-section tables document all supported lading.toml keys, facilitating the test-driven validation implemented in tests/unit/test_users_guide.py.


158-176: CLI reference documents key flags and environment variables.

The section covers --workspace-root positioning flexibility and LADING_LOG_LEVEL configuration, addressing common operational concerns.

tests/e2e/helpers/e2e_steps_helpers.py (3)

39-47: LGTM: Enhanced signature supports multiple prefix validation.

The updated signature and error message construction correctly support validation against multiple possible prefixes, aligning with the data-driven stubbing approach introduced in test_e2e_steps.py.


50-54: LGTM: Error message accurately reflects positional-independent validation.

The updated message correctly indicates that --target-dir=... is expected anywhere in the args list, matching the flexible validation logic in _validate_target_dir.


99-107: LGTM: Consistent with config-driven stub refactoring.

The shift from cmd_mox.mock to cmd_mox.stub aligns with the broader refactoring of cargo command stubbing in test_e2e_steps.py, ensuring uniform stubbing mechanisms across the E2E test suite.

tests/unit/test_users_guide.py (4)

1-8: LGTM: Clean module structure.

The module docstring clearly states intent, and imports are minimal and appropriate for documentation coverage testing.


10-17: LGTM: Clear section presence validation.

The test effectively guards against removal of Phase 4.2 required sections using straightforward substring checks.


20-38: LGTM: Robust documentation drift guard using source of truth.

The test derives expected configuration keys from lading/config.py constants, correctly handles the nested [bump.documentation] section, and provides clear failure messages. This ensures the user guide stays synchronised with the actual configuration schema.


41-61: LGTM: Comprehensive CLI and environment variable coverage.

The test guards against drift in CLI flag and environment variable documentation, verifying presence of key invocation examples and configuration references. Separate assertions for CLI and environment terms provide clear diagnostic output.

lading/config.py (2)

22-39: LGTM: Well-structured centralized key validation.

The constants follow best practices (UPPER_SNAKE_CASE, typ.Final, frozenset) and accurately capture the valid keys for each configuration section. The centralisation enables reuse in tests and ensures consistent validation across the configuration loading logic.


67-69: LGTM: Consistent validation using centralized constants.

All from_mapping methods correctly use the centralized key constants with _validate_mapping_keys, maintaining existing validation behaviour whilst enabling reuse in tests. The context strings provide clear error messages.

Also applies to: 87-87, 109-109, 143-143, 188-188

tests/e2e/steps/test_e2e_steps.py (6)

29-38: LGTM: Clean prefix validation with flexible length matching.

The helper correctly validates that invocation arguments begin with one of the allowed prefixes, handling variable-length prefixes and empty prefix sets (which allow any args).


41-44: LGTM: Position-independent target directory validation.

The helper correctly scans all arguments for --target-dir=, avoiding brittle positional checks.


47-64: LGTM: Well-structured handler factory reduces duplication.

The factory pattern effectively encapsulates validation and recording logic, enabling data-driven stub configuration. The closure correctly captures label, records, and validation requirements.


89-123: LGTM: Data-driven stubbing reduces complexity effectively.

The refactored approach replaces bespoke handlers with configuration-driven logic, reducing cyclomatic complexity and improving maintainability. The stub configuration correctly models expected argument prefixes and target-dir requirements for each cargo command.


152-159: LGTM: Separate step enables default publish flow testing.

The new when step correctly captures the default publish behaviour (with allow-dirty), enabling distinct test scenarios for different publish flag combinations as requested in prior review feedback.


260-277: LGTM: Explicit assertions guard against publish flag regressions.

The new then steps correctly verify that cargo publish is invoked with the appropriate flags for default (--allow-dirty --dry-run) versus forbid-dirty (--dry-run only) flows, directly addressing prior review feedback.

Comment thread docs/lading-design.md Outdated
Comment thread docs/users-guide.md Outdated
Corrected 'Standardised' to 'Standardized' in lading-design.md and 'tokenised' to 'tokenized' in users-guide.md to improve documentation accuracy.

Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
@leynos

leynos commented Dec 21, 2025

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Dec 21, 2025

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@leynos
leynos merged commit 1ef7e3b into main Dec 21, 2025
4 checks passed
@leynos
leynos deleted the terragon/docs-user-guide-release-6oe94n branch December 21, 2025 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant