Skip to content

test: harden tool_nudge assertions after UBS scan#328

Merged
jamiepine merged 1 commit intospacedriveapp:mainfrom
vsumner:chore/bug-scanner-autopilot-pr315-hardening
Mar 7, 2026
Merged

test: harden tool_nudge assertions after UBS scan#328
jamiepine merged 1 commit intospacedriveapp:mainfrom
vsumner:chore/bug-scanner-autopilot-pr315-hardening

Conversation

@vsumner
Copy link
Contributor

@vsumner vsumner commented Mar 5, 2026

Summary

  • ran bug-scanner-autopilot workflow on the changed-file scope (HEAD~1..HEAD fallback)
  • triaged UBS findings and applied the smallest behavior-preserving fix for actionable criticals
  • replaced panic! match fallthroughs in tests/tool_nudge.rs with assert!(matches!(...)) plus focused field assertions

Why

  • UBS flagged panic-surface criticals in this test path
  • this keeps the test intent the same while removing panic-style branches UBS treats as critical

Verification

  • cargo test --test tool_nudge
  • just preflight
  • just gate-pr

All commands passed locally.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: df3d104b-8cc5-435d-9840-bbacdad70944

📥 Commits

Reviewing files that changed from the base of the PR and between fd0a76e and 778e1be.

📒 Files selected for processing (1)
  • tests/tool_nudge.rs

Walkthrough

Test code in tests/tool_nudge.rs was refactored to replace exhaustive enum-variant match assertions with assert!(matches!(...)) checks followed by if let for targeted field assertions; only test assertions and messages changed, no production behavior or public signatures modified.

Changes

Cohort / File(s) Summary
Test Assertion Refactoring
tests/tool_nudge.rs
Replaced verbose match-based enum/event assertions with assert!(matches!(...)) + if let field checks. Adjusted test error messages and assertion flow. No code behavior or public API changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • jamiepine
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: hardening test assertions in tool_nudge after a UBS security scan, which matches the changeset focus.
Description check ✅ Passed The description is directly related to the changeset, explaining the UBS scan findings, the rationale for replacing panic statements, and verification steps performed.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@vsumner vsumner force-pushed the chore/bug-scanner-autopilot-pr315-hardening branch from 998c998 to 778e1be Compare March 7, 2026 04:13
@jamiepine jamiepine merged commit 18d1a1a into spacedriveapp:main Mar 7, 2026
4 checks passed
rktmeister pushed a commit to rktmeister/spacebot that referenced this pull request Mar 11, 2026
…utopilot-pr315-hardening

test: harden tool_nudge assertions after UBS scan
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