Skip to content

Add package-boundary smoke test (#411) - #469

Merged
leynos merged 3 commits into
mainfrom
issue-411-add-package-boundary-smoke-test-for-cargo-publish-package
Jul 29, 2026
Merged

Add package-boundary smoke test (#411)#469
leynos merged 3 commits into
mainfrom
issue-411-add-package-boundary-smoke-test-for-cargo-publish-package

Conversation

@lodyai

@lodyai lodyai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

This branch adds a release-boundary smoke test that verifies the packaged crate
builds successfully with cargo publish --dry-run, retains required
build-script sources and excludes stale ninja_env paths. This prevents
packaging regressions from surfacing only when a release is attempted.

Closes #411.

Review walkthrough

Validation

  • cargo publish --dry-run --allow-dirty -p netsuke: passed
  • make check-fmt: passed
  • make typecheck: passed
  • make test: passed
  • make lint: passed
  • make markdownlint: passed
  • make nixie: passed
  • coderabbit review --agent: completed without a finding

References

Guard the packaged crate's manifest against omitted build-script sources
and stale inlined `ninja_env` paths before a release exposes them.
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c0d31169-0e96-4b07-9ab4-26ef9969335b

📥 Commits

Reviewing files that changed from the base of the PR and between 954ed7e and 9b278bd.

📒 Files selected for processing (1)
  • tests/packaging_smoke_tests.rs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • leynos/rstest-bdd (auto-detected)
  • leynos/ortho-config (auto-detected)
  • leynos/shared-actions (auto-detected)

Summary

  • Added a packaging smoke test that runs cargo publish --dry-run and validates the packaged manifest.
  • Confirmed required build-script and localisation sources, including build_l10n_audit.rs, are retained.
  • Added checks to reject stale ninja_env path components.
  • Documented the packaging verification stages in the developers’ guide.

Walkthrough

Add a packaging smoke test that runs Cargo publication and packaging commands, verifies required build-script sources remain packaged, rejects stale ninja_env/ paths, and documents the test in the developer guide.

Changes

Packaging boundary validation

Layer / File(s) Summary
Cargo packaging smoke test and documentation
tests/packaging_smoke_tests.rs, docs/developers-guide.md
Run cargo publish --dry-run and cargo package --list, validate required packaged files including build_l10n_audit.rs, reject ninja_env/ entries, and map the test in the developer guide.

Suggested labels: Issue

Poem

Cargo packs the crate with care,
Build scripts safely travel there.
Stale paths fade from view,
The manifest proves what’s true,
A tidy release takes the air.

🚥 Pre-merge checks | ✅ 20
✅ Passed checks (20 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the packaging smoke test change and correctly includes the linked issue reference (#411).
Description check ✅ Passed The description directly matches the packaging boundary smoke test and its documentation update.
Linked Issues check ✅ Passed The test covers cargo publish/package failures, required build-script sources, and stale ninja_env paths as requested in #411.
Out of Scope Changes check ✅ Passed The docs update and new smoke test both stay within the packaging-boundary scope.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Testing (Overall) ✅ Passed Approve it: the new integration test runs real Cargo publish/package commands and asserts required files plus absence of ninja_env components.
User-Facing Documentation ✅ Passed Treat this as PASS: the PR adds only an internal packaging smoke test and developer-guide note; no user-facing change needs users-guide coverage.
Developer Documentation ✅ Passed docs/developers-guide.md now documents tests/packaging_smoke_tests.rs in the Test suite map; no locale variants or roadmap/execplan updates are present.
Module-Level Documentation ✅ Passed The new Rust test module is documented with crate-level //! comments that explain its purpose and release-boundary role; the Markdown guide is not a code module.
Testing (Unit And Behavioural) ✅ Passed Integration smoke test shells out to cargo publish/package and checks packaged-file invariants, so it hits the release boundary directly.
Testing (Property / Proof) ✅ Passed The change adds a concrete Cargo packaging smoke test, not a range-wide invariant or proof obligation, so no property/proof recommendation is warranted.
Testing (Compile-Time / Ui) ✅ Passed No compile-time/UI contract is introduced; the new packaging smoke test uses focused semantic assertions on Cargo output, so trybuild or snapshots are unnecessary.
Unit Architecture ✅ Passed Keep the side-effect at the test edge: the new smoke test shells out explicitly, handles cargo failures, and leaves query paths untouched.
Domain Architecture ✅ Passed The PR only touches docs and a packaging smoke test; no domain model, policy, repository, or transport code is changed.
Observability ✅ Passed Only a packaging smoke test changed; no production behaviour or operational surface was added, so extra logging, metrics, tracing, or alerts are not required.
Security And Privacy ✅ Passed Approve: the change only strengthens a packaging smoke test and does not add secrets, auth logic, unsafe parsing, or broader permissions.
Performance And Resource Use ✅ Passed Bounded test-only work: two Cargo subprocesses and a finite BTreeSet over package files; no hot-path or unbounded resource growth.
Concurrency And State ✅ Passed Only a synchronous packaging smoke test was added; it shells out to cargo and uses local BTreeSet state, with no shared mutability, locks, or async tasks.
Architectural Complexity And Maintainability ✅ Passed Added a single explicit smoke test and one docs note; no new traits, layers, registries, or dependencies appear.
Rust Compiler Lint Integrity ✅ Passed No new lint suppressions, fake references, or suspicious clones appear in the touched Rust test; imports and helpers are used directly.
📋 Issue Planner

Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).

View plan for ticket: #411

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-411-add-package-boundary-smoke-test-for-cargo-publish-package

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

@sourcery-ai

sourcery-ai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds a packaging smoke test that runs cargo package --list to assert required build-script and localization files are included in the crate package and that stale ninja_env paths are excluded, and documents this test in the developer guide.

Flow diagram for packaging smoke test using cargo package --list

flowchart LR
    A[Run test packaging_smoke_tests.rs] --> B[Invoke cargo package --list]
    B --> C[Assert build_l10n_audit.rs is listed]
    B --> D[Assert build script sources are listed]
    B --> E[Assert ninja_env paths are not listed]
    C --> F[Pass if all assertions hold]
    D --> F
    E --> F
Loading

File-Level Changes

Change Details Files
Add a packaging smoke test verifying packaged manifest contents via cargo package --list.
  • Introduce a test that shells out to cargo package --list --allow-dirty -p netsuke using the CARGO env var or cargo fallback.
  • Collect the listed package paths into a BTreeSet and assert that specific build-script and localization files are present.
  • Assert that no packaged path contains the substring ninja_env, guarding against stale environment artifact inclusion.
tests/packaging_smoke_tests.rs
Document the new packaging smoke test and its rationale in the developer guide.
  • Describe that the new test checks for retention of build-script sources (including build_l10n_audit.rs) and rejects stale ninja_env/ paths in the packaged manifest.
  • Explain why cargo package --list is used instead of cargo publish --dry-run due to an unversioned ambient_fs path dependency with publish = false.
docs/developers-guide.md

Assessment against linked issues

Issue Objective Addressed Explanation
#411 Add an automated package-boundary check that runs cargo package/cargo publish --dry-run and fails if the command itself fails.
#411 Ensure the automated check fails if build_l10n_audit.rs and other required build-script-related sources are missing from the packaged file list, and optionally assert absence of stale ninja_env/ paths.
#411 Ensure this package-boundary check runs as part of the standard CI pipeline (via the normal test suite).

Possibly linked issues


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-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

@leynos
leynos marked this pull request as ready for review July 29, 2026 00:10

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @leynos, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b9c034cdc0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/developers-guide.md Outdated
Comment on lines +474 to +475
rather than `cargo publish --dry-run` because the unversioned `ambient_fs` path
dependency has `publish = false`, which blocks a full publish verification.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove the obsolete ambient_fs packaging rationale

In the reviewed tree, a repo-wide search for ambient_fs finds only this paragraph, and Cargo.toml no longer declares that dependency because commit 576e421 removed it before this change. The guide therefore gives contributors a false reason that full publish verification is unavailable; re-evaluate whether cargo publish --dry-run can now replace --list, or document the actual remaining blocker.

AGENTS.md reference: AGENTS.md:L44-L47

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@coderabbitai Has this now been resolved in the latest commit?

Use codegraph analysis to determine your answer.

If this comment is now resolved, please mark it as such using the API. Otherwise, please provide an AI agent prompt for the remaining work to be done to address this comment.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@coderabbitai Addressed and pushed in commit 954ed7e.

  • packaging_smoke_tests.rs now requires cargo publish --dry-run to succeed, then uses cargo package --list for exact manifest assertions.
  • developers-guide.md no longer mentions ambient_fs.
  • All local Rust and documentation gates passed.
  • PR #469 was updated with the stronger test contract.
  • The original thread is outdated. Remote CodeRabbit was still processing at the final check, with no new inline findings posted.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@leynos, resolved. The updated contract now runs cargo publish --dry-run and
uses cargo package --list only for exact packaged-manifest assertions; the
obsolete ambient_fs blocker rationale has also been removed.

Run `cargo publish --dry-run` before inspecting the packaged file list so
the standard test suite verifies that the release artefact builds.

Remove the obsolete `ambient_fs` limitation from the developer guide and
describe the distinct publish-verification and manifest-inspection steps.
codescene-access[bot]

This comment was marked as outdated.

@coderabbitai coderabbitai Bot added the Issue label Jul 29, 2026
codescene-access[bot]

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as resolved.

@buzzybee-df12

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

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.

Reject only exact `ninja_env` path components so legitimate packaged files
with longer names are not mistaken for stale inlined-crate paths.
codescene-access[bot]

This comment was marked as outdated.

@codescene-access codescene-access 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.

No quality gates enabled for this code.

@buzzybee-df12

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

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.

Repository owner deleted a comment from coderabbitai Bot Jul 29, 2026
Repository owner deleted a comment from coderabbitai Bot Jul 29, 2026
@leynos
leynos merged commit 43b42ca into main Jul 29, 2026
20 checks passed
@leynos
leynos deleted the issue-411-add-package-boundary-smoke-test-for-cargo-publish-package branch July 29, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add package-boundary smoke test for cargo publish/package

2 participants