Skip to content

cli: print warnings on the wasi-p2 family-gate error path (#1004 review follow-up)#1022

Merged
aallan merged 2 commits into
mainfrom
fix/wasi-p2-warnings-on-error-path
Jul 13, 2026
Merged

cli: print warnings on the wasi-p2 family-gate error path (#1004 review follow-up)#1022
aallan merged 2 commits into
mainfrom
fix/wasi-p2-warnings-on-error-path

Conversation

@aallan

@aallan aallan commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #1021: CodeRabbit's review flagged a third cmd_compile error path that drops warnings in text mode. The --target wasi-p2 family gate raises ValueError after a successful compile, and its text branch returned after printing only the error — dropping any accumulated warnings (the --json branch 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 — print all_warnings before the error in the wasi-p2 emit_wasi_component ValueError text 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_component raises after codegen succeeds, so the E602 warning must now print in text mode. Reproduced RED first (text mode showed only the family-gate error; --json carried 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

    • Fixed vera compile text output so warnings are shown alongside errors when compilation fails for --target wasi-p2.
    • Ensured skipped-function warnings remain visible across relevant compilation error scenarios.
  • Documentation

    • Updated project status and testing metrics to reflect the latest test totals and coverage.
    • Clarified the documented warning behaviour for compilation errors.

…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>
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4a9bbf88-76e8-455f-aa10-74bdb91d60be

📥 Commits

Reviewing files that changed from the base of the PR and between 6daa5c5 and d4fb9be.

📒 Files selected for processing (2)
  • TESTING.md
  • tests/test_cli.py
📝 Walkthrough

Walkthrough

The compile CLI now preserves accumulated E602 warnings on the --target wasi-p2 family-gate error path. Regression coverage, changelog wording, and reported test metrics were updated.

Changes

WASI-P2 warning preservation

Layer / File(s) Summary
Compile warning emission and regression coverage
vera/cli.py, tests/test_cli.py
The WASI-P2 error branch prints accumulated warnings before the final error, and a regression test verifies both [E602] and the family-gate message.
Release notes and test metrics
CHANGELOG.md, TESTING.md, README.md, ROADMAP.md
The changelog documents the corrected text-mode behaviour, and project test counts are updated from 7,403 to 7,404.

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

Suggested labels: compiler, tests, docs

🚥 Pre-merge checks | ✅ 8
✅ Passed checks (8 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: printing warnings on the wasi-p2 family-gate error path.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.
Changelog Covers Public-Surface Changes ✅ Passed CHANGELOG.md explicitly says the E602 warning fix also covers the type-error and --target wasi-p2 text paths, matching the CLI change.
Spec And Implementation Move Together ✅ Passed Only vera/cli.py output ordering changed; no parser/checker/verifier/codegen semantics or spec/ files were touched.
Diagnostics Carry An Error Code ✅ Passed PASS — the added wasi-p2 text-path warning is E602, and the branch only reorders existing output; no new uncoded diagnostic was introduced.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/wasi-p2-warnings-on-error-path

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

@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown

Greptile Summary

This PR completes the #1004 warning-suppression fix by patching the third and final error path in cmd_compile — the --target wasi-p2 family-gate ValueError branch — which was printing the error without first flushing accumulated warnings in text mode (the JSON branch already carried them).

  • vera/cli.py: Inserts a for w in all_warnings print loop immediately before the family-gate error print, exactly mirroring the codegen-error and type-error paths fixed in earlier PRs.
  • tests/test_cli.py: Adds test_compile_wasi_p2_warnings_shown_on_error_path_1004, which uses a program with an uncalled skipped function (E602) plus a <Http>-effect main that triggers the family gate, and asserts both warning presence and ordering (warning index < error index).
  • Documentation files (CHANGELOG.md, README.md, ROADMAP.md, TESTING.md) are updated to reflect the expanded fix description and the incremented test count.

Confidence Score: 5/5

This 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.

Important Files Changed

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

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.51%. Comparing base (b87d02a) to head (d4fb9be).

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           
Flag Coverage Δ
javascript 78.41% <ø> (ø)
python 95.29% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aallan

aallan commented Jul 13, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@coderabbitai coderabbitai 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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between b87d02a and 6daa5c5.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • README.md
  • ROADMAP.md
  • TESTING.md
  • tests/test_cli.py
  • vera/cli.py
🔗 Linked repositories identified

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

  • aallan/vera-bench (manual)

Comment thread tests/test_cli.py
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>
@aallan aallan merged commit c9a9b37 into main Jul 13, 2026
28 checks passed
@aallan aallan deleted the fix/wasi-p2-warnings-on-error-path branch July 13, 2026 16:48
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.

1 participant