Skip to content

test(advisor): add simple E2E suite review lens#5170

Merged
cv merged 4 commits into
mainfrom
pr-advisor/e2e-simple-first
Jun 11, 2026
Merged

test(advisor): add simple E2E suite review lens#5170
cv merged 4 commits into
mainfrom
pr-advisor/e2e-simple-first

Conversation

@jyaunches

@jyaunches jyaunches commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a prompt-only simple-first review lens to the PR Review Advisor for PRs touching the Vitest E2E suite.

Related Issue

Refs #5098

Changes

  • Updates the advisor rubric so PRs changing test/e2e-scenario/, .github/workflows/e2e-vitest-scenarios.yaml, or tools/e2e-scenarios/ get closer architecture review for new systems.
  • Tells the advisor to favor focused Vitest tests and local test helpers.
  • Tells the advisor to flag unnecessary new runners, framework layers, registries/matrix abstractions, generalized fixture APIs, workflow validators, or support systems unless the PR proves they are small, reused, and clearly needed.
  • Explicitly preserves simple direct tests that spawn real shell/system commands from Vitest.
  • Does not add ledgers, deterministic bookkeeping, generated inventories, or new advisor detection systems.

Verification

  • npm run typecheck:cli -- --pretty false
  • npx vitest run --project cli test/pr-review-advisor.test.ts --reporter=default
  • git diff --check

Summary by CodeRabbit

  • New Features

    • PR review advisor adds a “Vitest E2E suite simplicity” rule to better flag architectural/scope concerns versus allowing focused local Vitest tests.
  • Tests

    • Tests expanded to assert the advisor includes the new Vitest E2E guidance and validate its expected behavior.

@jyaunches jyaunches added area: e2e End-to-end tests, nightly failures, or validation infrastructure chore Build, CI, dependency, or tooling maintenance labels Jun 10, 2026
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 3f6f2156-7187-449f-8383-8d038338b67f

📥 Commits

Reviewing files that changed from the base of the PR and between 4e3f93c and 413ff84.

📒 Files selected for processing (2)
  • test/pr-review-advisor.test.ts
  • tools/pr-review-advisor/analyze.mts
🚧 Files skipped from review as they are similar to previous changes (1)
  • tools/pr-review-advisor/analyze.mts

📝 Walkthrough

Walkthrough

Adds a new "Vitest E2E suite simplicity" rubric item to the PR review advisor system prompt and updates the test to assert the new guidance text about architecture review and favoring focused Vitest tests with local helpers.

Changes

Vitest E2E Simplicity Prompt & Tests

Layer / File(s) Summary
System prompt rubric insertion
tools/pr-review-advisor/analyze.mts
buildSystemPrompt() adds a new rubric item "Vitest E2E suite simplicity" (inserted as item 7) and renumbers subsequent rubric items.
Test assertions update
test/pr-review-advisor.test.ts
Test assertions were extended to require the new Vitest E2E guidance text about taking a closer architecture look for new systems and favoring focused Vitest tests with local test helpers.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • cv

Poem

🐰 I hopped through prompts, precise and bright,
I nudged a rule for Vitest into light,
Tests now seek the wording true,
A tidy change to check and view,
Small carrot cheer for reviewers tonight.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately describes the main change: adding a new E2E suite review lens to the PR Review Advisor test and system prompt.
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pr-advisor/e2e-simple-first

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

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: None
Optional E2E: None

Workflow run

Full advisor summary

E2E Recommendation Advisor

Failed: Could not parse JSON from advisor output; see /home/runner/work/NemoClaw/NemoClaw/artifacts/e2e-advisor/e2e-advisor-raw-output.txt

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Recommendation

Required Vitest E2E scenarios: None
Optional Vitest E2E scenarios: None

Workflow run

Full Vitest E2E advisor summary

Vitest E2E Scenario Advisor

Failed: Could not parse JSON from advisor output; see /home/runner/work/NemoClaw/NemoClaw/artifacts/e2e-advisor/e2e-scenario-advisor-raw-output.txt

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor

Findings: 0 needs attention, 0 worth checking, 0 nice ideas
Since last review: 0 prior items resolved, 0 still apply, 0 new items found

Consider writing more tests for

Workflow run details

This is an automated advisory review. A human maintainer must make the final merge decision.

@jyaunches jyaunches added the v0.0.64 Release target label Jun 10, 2026

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
tools/pr-review-advisor/analyze.mts (1)

457-529: ⚡ Quick win

Reduce detector branch complexity with data-driven rules.

This function packs multiple rule families into one long conditional chain, which makes future edits error-prone. Extracting path-match rules into a table of {pattern, signalFactory} handlers would keep complexity lower and make behavior easier to extend/test.

As per coding guidelines, "Keep function complexity low in JavaScript and TypeScript code".

🤖 Prompt for 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.

In `@tools/pr-review-advisor/analyze.mts` around lines 457 - 529, The function
detectE2eVitestSimplicitySignals is too branch-heavy; refactor by replacing the
long conditional chain with a data-driven rule table. Create an array of rule
objects (e.g., {test: RegExp | (f)=>boolean, factory:
(file)=>E2eVitestSimplicitySignal}) and iterate it for each changed file instead
of the many ifs; reuse the existing push(signals) logic and keep the duplicate
check in push, preserving existing kinds like "repo-local E2E migration ledger",
"shared Vitest E2E fixture/support change", "Vitest E2E registry or manifest
expansion", "Vitest E2E workflow expansion", and "one-off E2E workflow validator
expansion" so behavior is unchanged while complexity is reduced in
detectE2eVitestSimplicitySignals.

Source: Coding guidelines

🤖 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 `@tools/pr-review-advisor/analyze.mts`:
- Around line 533-569: The hunk line numbering (nextLine) only advances when an
added line (+) is processed because the loop continues before the shared
increment; as a result context lines (" ") are not counted and reported line
numbers are shifted. Modify the loop to inspect the first character once (e.g.,
const lineType = rawLine[0]) and skip diff meta headers ("+++","---") but do not
early-return before adjusting nextLine: process added lines when lineType ===
'+' (and not "+++") to push signals using nextLine, and then increment nextLine
when lineType === '+' or lineType === ' ' (context) but do not increment for
removed lines ('-'); keep file/hunk detection using fileMatch/hunkMatch and
preserve the existing push(...) calls (references: nextLine, rawLine, fileMatch,
hunkMatch, push, signals).

---

Nitpick comments:
In `@tools/pr-review-advisor/analyze.mts`:
- Around line 457-529: The function detectE2eVitestSimplicitySignals is too
branch-heavy; refactor by replacing the long conditional chain with a
data-driven rule table. Create an array of rule objects (e.g., {test: RegExp |
(f)=>boolean, factory: (file)=>E2eVitestSimplicitySignal}) and iterate it for
each changed file instead of the many ifs; reuse the existing push(signals)
logic and keep the duplicate check in push, preserving existing kinds like
"repo-local E2E migration ledger", "shared Vitest E2E fixture/support change",
"Vitest E2E registry or manifest expansion", "Vitest E2E workflow expansion",
and "one-off E2E workflow validator expansion" so behavior is unchanged while
complexity is reduced in detectE2eVitestSimplicitySignals.
🪄 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: CHILL

Plan: Enterprise

Run ID: e23a9309-5710-4040-9876-090a3da0da00

📥 Commits

Reviewing files that changed from the base of the PR and between e1240df and 5953d72.

📒 Files selected for processing (2)
  • test/pr-review-advisor.test.ts
  • tools/pr-review-advisor/analyze.mts

Comment thread tools/pr-review-advisor/analyze.mts Outdated
@jyaunches jyaunches changed the title test(advisor): enforce simple E2E migrations test(advisor): add simple E2E suite review lens Jun 10, 2026
@prekshivyas prekshivyas self-assigned this Jun 10, 2026

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

Reviewed (code + 9-cat security). Adds a "Vitest E2E suite simplicity" rubric lens (step 7) to the PR Review Advisor prompt, renumbering 7→8/8→9, plus 3 prompt-assertion tests. The change itself is clean and the new assertions match the head prompt strings.

🔴 Request changes — stale base / merge collision. Since this PR opened, #5126 ("simplify legacy migration tracking") landed on main and edited the same file and same rubric region (tools/pr-review-advisor/analyze.mts) — it added its own step 8 ("Legacy E2E migration governance") plus a deterministic ledger blocker, and also edited test/pr-review-advisor.test.ts. A naive merge collides on the step numbering and the test file (mergeable reports UNKNOWN).

Please: merge main into the branch, reconcile so both lenses coexist with unique step numbers, re-run the assertions, and sanity-check the two overlapping "simplicity/governance" rules don't produce duplicate findings on the same E2E PR.

Security: all 9 pass (prompt-only string edit). Nit: the test-file import reordering is unrelated noise that adds to the merge surface.

@cv cv merged commit d2b8d6b into main Jun 11, 2026
42 checks passed
@cv cv deleted the pr-advisor/e2e-simple-first branch June 11, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: e2e End-to-end tests, nightly failures, or validation infrastructure chore Build, CI, dependency, or tooling maintenance v0.0.64 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants