cli: print warnings on the wasi-p2 family-gate error path (#1004 review follow-up)#1022
Conversation
…ew follow-up) PR #1021's CodeRabbit review flagged a third sibling of the #1004 warning-drop: cmd_compile's --target wasi-p2 emit_wasi_component ValueError text path returned after printing only the error, dropping accumulated warnings (the JSON branch already carried them). The family gate rejects AFTER a successful compile, so warnings can be present. Print them, tested with an <Http> program (unsupported family) carrying an uncalled E602 skip warning. Counts +1 -> 7404. Co-Authored-By: Claude <noreply@anthropic.invalid>
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 1 minute Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe compile CLI now preserves accumulated E602 warnings on the ChangesWASI-P2 warning preservation
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: 🚥 Pre-merge checks | ✅ 8✅ Passed checks (8 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThis PR completes the #1004 warning-suppression fix by patching the third and final error path in
Confidence Score: 5/5This is a safe, narrow bug fix with no behaviour change on the success path and no change to the JSON error path. The fix is six lines that exactly replicate an already-proven pattern used twice elsewhere in the same function. The new test is well-constructed: it independently triggers the E602 warning and the family-gate rejection, verifies both appear in stderr, and pins their relative order. No other paths in cmd_compile are touched. No files require special attention.
|
| Filename | Overview |
|---|---|
| vera/cli.py | Adds six-line warning-print loop before the wasi-p2 family-gate text error, completing the trio of #1004 fixes; mirrors the identical pattern at the codegen-error and type-error paths above it. |
| tests/test_cli.py | Adds one new test (test_compile_wasi_p2_warnings_shown_on_error_path_1004) with a carefully constructed program that triggers the E602 skip warning before emit_wasi_component raises; also asserts the ordering invariant (warning index < error index). |
| CHANGELOG.md | Expands the existing #1004 changelog entry to mention the wasi-p2 family-gate path; no structural changes. |
| TESTING.md | Bumps test_cli.py count from 263 to 264 and test lines from 4,109 to 4,142; consistent with the single new test added. |
| README.md | Updates total test count from 7,403 to 7,404 in the project status line. |
| ROADMAP.md | Updates total test count from 7,403 to 7,404 in the current-state header. |
Reviews (2): Last reviewed commit: "test: assert the wasi-p2 warning precede..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1022 +/- ##
=======================================
Coverage 93.51% 93.51%
=======================================
Files 96 96
Lines 32017 32019 +2
Branches 456 456
=======================================
+ Hits 29941 29943 +2
Misses 2063 2063
Partials 13 13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/test_cli.py`:
- Around line 830-847: Strengthen
test_compile_wasi_p2_warnings_shown_on_error_path_1004 by asserting the warning
text "[E602]" appears before the family-gate "does not support" error in
captured stderr. Preserve the existing assertions that both messages are
present, and validate their relative positions to enforce the documented output
order.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 06b77199-e683-435f-ba94-5b62fd31d32e
📒 Files selected for processing (6)
CHANGELOG.mdREADME.mdROADMAP.mdTESTING.mdtests/test_cli.pyvera/cli.py
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
aallan/vera-bench(manual)
CodeRabbit flagged that the wasi-p2 warning-on-error-path test checked both strings' presence but not their order — it would pass even if the family-gate error printed first. Add the ordering assertion (warning is flushed before the error) to lock the documented output contract. Co-Authored-By: Claude <noreply@anthropic.invalid>
Summary
Follow-up to #1021: CodeRabbit's review flagged a third
cmd_compileerror path that drops warnings in text mode. The--target wasi-p2family gate raisesValueErrorafter a successful compile, and its text branch returned after printing only the error — dropping any accumulated warnings (the--jsonbranch already included them).This completes the class the #1004 fix started: with it, all of
cmd_compile's text error paths (type-error, codegen-error, and now the wasi-p2 family gate) print accumulated warnings alongside the error.Change
vera/cli.py— printall_warningsbefore the error in the wasi-p2emit_wasi_componentValueErrortext branch (the JSON branch already carried them).tests/test_cli.py— a program using<Http>(a family wasi-p2 rejects) that also carries an uncalled E602-skip warning:emit_wasi_componentraises after codegen succeeds, so the E602 warning must now print in text mode. Reproduced RED first (text mode showed only the family-gate error;--jsoncarried the E602).Validation
test_cli.py::TestCmdCompile(264) green; mypy, ruff, doc-counts, and site-assets gates green.Refs #1004, #1021
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
vera compiletext output so warnings are shown alongside errors when compilation fails for--target wasi-p2.Documentation