8000 test(minimal): gate the debug-only command assertion on debug builds by bryan-minimal · Pull Request #3684 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

test(minimal): gate the debug-only command assertion on debug builds - #3684

Merged
bryan-minimal merged 2 commits into
mainfrom
fix/release-build-debug-only-commands
Nov 22, 2026
Merged

bryan-minimal merged 2 commits into
mainfrom
fix/release-build-debug-only-commands

Conversation

@bryan-minimal
@bryan-minimal bryan-minimal commented Nov 20, 2026 •
Copy link
Copy Markdown
Member

What

main does not compile in release mode since #3644. A release build of the minimal crate stops at:

error[E0599]: no variant, associated function, or constant named `Spin` found for enum `cli::Command`
error[E0599]: no variant, associated function, or constant named `DebugAnswererCommand` found for enum `cli::Command`
error: could not compile `minimal` (lib) due to 2 previous errors

shows_native_boxes_notice in crates/minimal/src/cmd/mod.rs names Command::Spin and Command::DebugAnswererCommand in its pattern. Both variants are #[cfg(debug_assertions)], so a release build has no such names. Every other use of the two in that file carries the gate already.

The change

The two names move into a debug-only early return at the top of the function. A debug build behaves as before (neither command prints the notice); a release build compiles.

One test in crates/minimal/src/update_check/tests.rs named DebugAnswererCommand without the gate as well. That stopped a release build of the tests, and has since #2650. That one assertion has the gate now.

15 lines added, 6 removed. No behaviour change in either build mode.

How it was found, and checked

A release build of two unrelated branches failed on this error after they took today's main. Branches based on main from before #3644 build.

With this change: format, clippy, the workspace tests, doctests and the native e2e pass, and the release build of the workspace completes.

Why CI did not catch it

No required check compiles the minimal crate with debug assertions off: the CI lanes build the dev profile. The release workflow builds min with --release, so the next release or nightly build is the first thing that would hit it. A check of the release profile in CI would catch this class of mistake; that is not added here.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Fixed release-build compatibility for command notice handling.
    • Kept debug-only command exclusions and aligned the related test with debug build settings.

The function that decides whether a command prints the native-boxes
notice named the spinner run and the answerer aid in its pattern. Both
commands exist in debug builds only, so a release build of the crate
stopped at "no variant named Spin" and "no variant named
DebugAnswererCommand". The other uses of the two names carry the debug
gate already.

The two names move into a debug-only early return, which keeps the debug
behaviour as it was. One test named the answerer aid without the gate as
well, which stopped a release build of the tests; it has the gate now.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@bryan-minimal
bryan-minimal requested a review from a team as a code owner November 20, 2026 17:18
@coderabbitai
coderabbitai Bot commented Nov 20, 2026 •
Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The notice-visibility helper now handles debug-only command variants inside a debug-assertions block. Its shared predicate excludes Pr 10000 oxy and CompleteSessionStr. The related test assertion for DebugAnswererCommand is also conditional on debug assertions.

Changes: Native boxes notice visibility

Layer / File(s) Summary
Separate debug-only exclusions and test assertion
crates/minimal/src/cmd/mod.rs, crates/minimal/src/update_check/tests.rs
The helper excludes Spin and DebugAnswererCommand in debug builds and keeps Proxy and CompleteSessionStr in its shared predicate. The test gates the DebugAnswererCommand assertion on debug assertions.

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

Possibly related PRs

  • gominimal/minimal#3682: This PR changes the same helper and debug-only variants to avoid naming those variants in release builds.

Suggested reviewers: norrietaylor, mitodrummer

Merge Risk: Minimal · up to 6dd5a

This fixes the release-mode build failure without changing debug behavior. No merge-blocking risk is apparent.

Pre-merge checks: Passed 4

Check name Status Explanation
Description check Passed The description follows the template's main parts. It has a What section and a Testing section with evidence of format, clippy, workspace tests, doctests, native e2e, and a release build. It also expl…
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 names the test change in crates/minimal, which matches the raw summary: the debug-command assertion is now gated on debug_assertions. It is a real and specific part of the change. It does no…
Full details: Description check

Explanation

The description follows the template's main parts. It has a What section and a Testing section with evidence of format, clippy, workspace tests, doctests, native e2e, and a release build. It also explains the change and why CI missed the error. The Checklist items are not ticked, and the Summary section is not headed as in the template. The description does not link an issue with Refs or Closes. The description is mostly complete, so the check passes.

Full details: Title check

Explanation

The title names the test change in crates/minimal, which matches the raw summary: the debug-command assertion is now gated on debug_assertions. It is a real and specific part of the change. It does not name the main fix in the PR objectives, which is making the release build compile again, so it is partially related. The title's scope is accurate and it is not vague.

Finishing Touches

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 notice with care,
Debug-only names stay in their lair.
Shared exclusions stand in the light,
Tests guard their claims just right.
Then off hops the rabbit, pleased and bright.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: bc96662c-c938-40d4-a766-3edcd3228630
Commits

Reviewing files that changed from the base of the PR and between 14b5723 and 6dd5ae6.

Files selected for processing: 2

  • crates/minimal/src/cmd/mod.rs
  • crates/minimal/src/update_check/tests.rs

Included review availability: This review used your included allowance. Your plan provides up to 5 included reviews per hour; 1 remain after this review.

@minimal-foundry
minimal-foundry Bot commented Nov 20, 2026 •
Copy link
Copy Markdown
Contributor

Reviewed: no findings; approval withheld, 1 thread unresolved at 5a468ac5df03.

APPROVE withheld: 1 unresolved thread — norrietaylor crates/minimal/src/cmd/mod.rs. Resolving the last thread releases the approval on this head.

Resolve the open threads. Resolving the last one releases the approval on this head; no new review is required.

Clobber: none seen.

@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 — approved

Verdict APPROVE — No findings.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Nov 20, 2026
Main gates the two debug-only commands in cmd/mod.rs now (#3682). This
branch keeps main's form there and carries only the gate on the one test
assertion that names DebugAnswererCommand.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@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.

Scope matches the title. The diff touches two files, and each hunk gates a use of a #[cfg(debug_assertions)] variant of cli::Command.

Clobber none. git log on both files shows #3644 as the last change to shows_native_boxes_notice, and the diff keeps its behaviour.

Correctness The change is good. In a debug build, Spin and DebugAnswererCommand return false before and after the change. In a release build, the two names are absent from the function. rg finds no other use of the two variants without the gate in crates/minimal. leaves_the_notice_visible does not name them. The two comments that the diff adds explain the code.

One low finding: no check in the repository compiles this crate with debug assertions off, so the same defect can return. The PR body says this.

Not checked I did not compile. The claim that the release build completes is from the PR body.

Comment thread crates/minimal/src/cmd/mod.rs Outdated
Some(Command::Spin(_) | Command::DebugAnswererCommand)
) {
return false;
}
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.

low · The fix has no guard against the same defect. No just recipe compiles the minimal crate with debug assertions off, so the next ungated use of Command::Spin or Command::DebugAnswererCommand passes every required check again. The existing #[cfg(not(debug_assertions))] test spin_absent_in_release at crates/minimal/src/tests.rs:1624 also never runs. The PR body says a release-profile check is not added here. Add a just recipe that checks the release profile, or link a follow-up issue from the PR. The ungated use itself is local: rg finds no other instance.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Right, nothing stops the next one. Since this review, #3682 landed the gate in cmd/mod.rs, so this PR now carries only the gate on the one test assertion, and neither PR adds the guard. I will open a follow-up PR with a just recipe that checks the minimal crate with debug assertions off and runs the #[cfg(not(debug_assertions))] tests (spin_absent_in_release among them), and link it here.

@bryan-minimal
Copy link
Copy Markdown
Member Author

5a468ac merges main. #3682 gates the two debug-only commands in cmd/mod.rs, so this branch keeps main's form there and now carries only the gate on the one test assertion that names DebugAnswererCommand (two lines in update_check/tests.rs). The title says more than the change does now; I will retitle it.

@bryan-minimal bryan-minimal changed the title fix(minimal): build in release mode again test(minimal): gate the debug-only command assertion on debug builds Nov 22, 2026
@minimal-foundry minimal-foundry Bot removed the review:approved minimal-review approved the current head label Nov 22, 2026
@bryan-minimal
bryan-minimal added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 9772424 Nov 22, 2026
39 checks passed
@bryan-minimal
bryan-minimal deleted the fix/release-build-debug-only-commands branch November 22, 2026 08:52
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.

2 participants

0