8000 fix(minimal): compile the spin demo only in debug builds by gominimal-aw-bot[bot] · Pull Request #2301 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(minimal): compile the spin demo only in debug builds - #2301

Merged
norrietaylor merged 1 commit into
mainfrom
inbox-patch/spin-debug-only-b22bbc330d4d6ad4
Oct 18, 2026
Merged

norrietaylor merged 1 commit into
mainfrom
inbox-patch/spin-debug-only-b22bbc330d4d6ad4

Conversation

@gominimal-aw-bot
@gominimal-aw-bot gominimal-aw-bot Bot commented Oct 17, 2026 •
Copy link
Copy Markdown
Contributor

Routing-Key: inbox-route/I_kwDOSUhdos8AAAABX3vWsQ

Release builds of min suggested the hidden spin development demo in clap's typo tips:
min sesion printed tip: some similar subcommands exist: 'spin', 'version', 'sessions', 'session',
advertising an undocumented command ahead of the intended session.

clap draws suggestion candidates from every subcommand, hidden ones included, so hiding alone
cannot keep a dev-only command out of release output. This compiles the Spin variant, its
args struct, the dispatch arm, and the cmd_spin handler only under #[cfg(debug_assertions)],
matching the existing debug-answerer-command dev aid, and adds a release-only test asserting
the subcommand is absent from the CLI.

Verification

  • cargo fmt --all --check — clean
  • cargo clippy --workspace --all-targets --locked -- -D warnings — clean
  • cargo test --locked -p minimal — 523 passed; 1 failure (legacy_network_spellings_parse_with_hint) is pre-existing and fails identically on the unmodified tree
  • cargo test --release --locked -p minimal spin_absent_in_release — 1 passed
  • Release repro min sesion: before, the tip listed 'spin', 'version', 'sessions', 'session'; after, 'version', 'sessions', 'session'
  • Debug build: min sesion still names spin, and min spin --seconds 1 still runs — the dev aid is intact

Summary by CodeRabbit

  • Bug Fixes
    • The spin command is now available only in debug builds and is omitted from release builds.

clap draws typo-suggestion candidates from every subcommand, hidden
ones included, so release builds of min suggested the hidden spin
development demo on subcommand typos (e.g. min sesion listed spin
ahead of the real session/session candidates).

Gate the Spin command, its args struct, the dispatch arm, and the
cmd_spin handler behind cfg(debug_assertions) — the same treatment
the debug-answerer-command dev aid already gets — and add a
release-only test asserting the subcommand is absent from the CLI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gominimal-aw-bot
gominimal-aw-bot Bot requested a review from a team as a code owner October 17, 2026 11:14
@gominimal-aw-bot gominimal-aw-bot Bot added the agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. label Oct 17, 2026
@coderabbitai
coderabbitai Bot commented Oct 17, 2026 •
Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: ff7e07a0-928d-4c7a-a8bb-a367e9b3491c
📥 Commits

Reviewing files that changed from the base of the PR and between 11b0b44 and 6f826f1.

📒 Files selected for processing: 4
  • crates/minimal/src/cli.rs
  • crates/minimal/src/cmd/admin.rs
  • crates/minimal/src/cmd/mod.rs
  • crates/minimal/src/tests.rs

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

📝 Walkthrough

The Spin CLI command, its implementation, and its dispatch arm are now compiled only when debug assertions are enabled. A release-only test checks that the CLI command tree omits the spin subcommand.

Changes: Spin command availability

Layer / File(s) Summary
Gate Spin and verify release CLI
crates/minimal/src/cli.rs, crates/minimal/src/cmd/admin.rs, crates/minimal/src/cmd/mod.rs, crates/minimal/src/tests.rs
The CLI command variant, implementation, and dispatch arm are gated by debug assertions. A release-only test checks that the spin subcommand is absent.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: 0chroma

Merge Risk: ⚪ Minimal · up to 6f826

The Spin demo remains available in debug builds and is excluded from the release CLI, preventing it from appearing in release typo suggestions. The supplied changes show consistent gating and a release-only absence check; no actionable merge risk remains.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the main change. It follows the required Conventional Commit format and uses an imperative, lower-case summary.
Description check Passed The description explains the problem, the implementation, and verification results. It includes summary and testing information, but it omits the required Checklist section.
  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the command tree,
In release builds, Spin is gone.
Debug builds still keep the path,
The test confirms the change,
Then hops away at dawn.

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

@gominimal-aw-bot gominimal-aw-bot Bot added the agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch label Oct 17, 2026
@norrietaylor norrietaylor changed the title fix: compile the spin demo only in debug builds fix(minimal): compile the spin demo only in debug builds Oct 18, 2026
@norrietaylor
Copy link
Copy Markdown
Member

/review

@minimal-foundry
minimal-foundry Bot commented Oct 18, 2026 •
Copy link
Copy Markdown
Contributor

Approved: no findings at 6f826f1212dc.

Nothing to do.

Clobber: none: git log shows no recent fix to these lines being reverted.

@minimal-foundry minimal-foundry 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.

minimal-review — advisory review

Verdict COMMENT — No findings.

Panel: 2 of 3 personas ran (correctness, security); did not complete: supply-chain.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 18, 2026
@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved on ARCH PASS at 6f826f1.

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 18, 2026
Merged via the queue into main with commit 336c9b5 Oct 18, 2026
36 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/spin-debug-only-b22bbc330d4d6ad4 branch October 18, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5ABF

Labels

agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0