Skip to content

ci(e2e): route scenario advisor to Vitest workflow - #5105

Merged
cv merged 4 commits into
mainfrom
codex/e2e-advisor-vitest-workflow
Jun 10, 2026
Merged

ci(e2e): route scenario advisor to Vitest workflow#5105
cv merged 4 commits into
mainfrom
codex/e2e-advisor-vitest-workflow

Conversation

@cv

@cv cv commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Route the E2E scenario advisor to the Vitest scenario workflow so new recommendations no longer point at the legacy typed-shell dispatch workflows. This keeps the advisor aligned with #5098 while the typed-shell retirement audit continues separately.

Related Issue

Refs #5098

Changes

  • Updates tools/e2e-advisor/scenarios.mts so canonical targeted and fan-out dispatch commands both use e2e-vitest-scenarios.yaml.
  • Refreshes the advisor system prompt to use Vitest registry, runtime-support, live test, and fixture paths as the authoritative scenario surfaces.
  • Rejects legacy e2e-scenarios.yaml and e2e-scenarios-all.yaml recommendations during normalization.
  • Updates advisor contract tests to pin the Vitest workflow export, prompt routing, canonical commands, and legacy workflow rejection.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Verification

  • npx prek run --all-files passes
  • npm test passes
  • Tests added or updated for new or changed behavior
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Focused verification run:

  • npx vitest run --project cli test/e2e-scenario-advisor.test.ts --silent=false --reporter=default
  • npm run typecheck:cli
  • git diff --check
  • SKIP=test-cli npx prek run --files tools/e2e-advisor/scenarios.mts test/e2e-scenario-advisor.test.ts

Signed-off-by: Carlos Villela cvillela@nvidia.com

Summary by CodeRabbit

  • Tests

    • Updated E2E scenario advisor test suite to validate Vitest workflow integration and ensure correct prompt construction, dispatch command generation, and result normalization.
  • Chores

    • Consolidated E2E advisor tooling to use a unified Vitest scenario workflow, improving consistency and removing legacy workflow cross-pairing logic.

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv cv added area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure labels Jun 10, 2026
@cv cv self-assigned this Jun 10, 2026
@copy-pr-bot

copy-pr-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@cv, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 35 minutes and 18 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7224ca1b-1816-433d-b6ad-b6c45c73b94e

📥 Commits

Reviewing files that changed from the base of the PR and between cf77030 and 47e20ac.

📒 Files selected for processing (2)
  • test/e2e-scenario-advisor.test.ts
  • tools/e2e-advisor/scenarios.mts
📝 Walkthrough

Walkthrough

The PR consolidates scenario E2E testing from multiple workflows to a single e2e-vitest-scenarios.yaml workflow. It introduces strict validation of recommendations, updates system prompts to reference the new workflow, and refreshes test fixtures and assertions to validate the consolidated behavior end-to-end.

Changes

Vitest Scenario E2E Consolidation

Layer / File(s) Summary
Workflow constants, allowlist, and canonicalization
tools/e2e-advisor/scenarios.mts, test/e2e-scenario-advisor.test.ts
Introduces SCENARIO_WORKFLOW (e2e-vitest-scenarios.yaml), synthetic fan-out id e2e-scenarios-all, restricts the allowlist to only the single workflow, and rewrites canonicalDispatchCommand to emit validated forms for single-scenario (--field scenarios=<id>) and fan-out (no --field) dispatch. Test setup imports SCENARIO_ADVISOR_WORKFLOWS and defines VITEST_SCENARIO_WORKFLOW constant with updated metadata.
System prompt alignment with new workflow
tools/e2e-advisor/scenarios.mts, test/e2e-scenario-advisor.test.ts
Reworks the scenario advisor system prompt to reference the single Vitest scenario workflow and updates authoritative sources to the typed scenario registry under test/e2e-scenario/. Hard rules constrain to only e2e-vitest-scenarios.yaml and require canonical dispatch formats. Tests assert correct diff snippets, changed file paths, base/head refs, and workflow routing in built prompts.
Recommendation validation and sanitization
tools/e2e-advisor/scenarios.mts, test/e2e-scenario-advisor.test.ts
Hardens normalizeScenarioAdvisorResult to allowlist only the single Vitest workflow, enforce kebab-case ids, and validate non-fan-out ids exist in the scenario registry via getScenario(id). Tests cover rejecting legacy workflows, enforcing canonical dispatch commands for both required and optional recommendations, validating required/optional flag correctness, rejecting malformed ids (shell metacharacters, non-kebab casing), deduplicating recommendations, filtering relevantChangedFiles against metadata, and ensuring default noScenarioE2eReason behavior.
Public API export and output validation
tools/e2e-advisor/scenarios.mts, test/e2e-scenario-advisor.test.ts
Updates exported SCENARIO_ADVISOR_WORKFLOWS.all to resolve to SCENARIO_WORKFLOW instead of a separate constant. Sample result data and rendering assertions are updated so summary/comment output matches the consolidated Vitest workflow and its canonical dispatch command form.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 One workflow now, no more the split,
Vitest reigns supreme—a perfect fit!
Dispatch canonicalized, prompts align,
Tests dancing in their newfound shrine.
The consolidation's done, clean and bright! ✨

🚥 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 specifically describes the main change: routing the E2E scenario advisor to the Vitest workflow, which aligns with the core objective to migrate from legacy typed-shell workflows.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/e2e-advisor-vitest-workflow

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

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • None. No existing product E2E is required. The PR only changes CI E2E-advisor tooling and its unit tests; running installer, onboarding, sandbox, credentials, inference, deployment, or live assistant E2E jobs would not validate the changed code path.

Optional E2E

  • None.

New E2E recommendations

  • None.

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

E2E Scenario Advisor Recommendation

Required scenario E2E: None
Optional scenario E2E: None

Workflow run

Full scenario advisor summary

E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required scenario E2E

  • None. Changes are limited to scenario advisor tooling/tests and do not affect scenario E2E runtime, workflows, scenario metadata, suites, or expected-state contracts.

Optional scenario E2E

  • None.

Relevant changed files

  • None.

@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: 2 prior items resolved, 0 still apply, 0 new items found

Consider writing more tests for
  • **Runtime validation** — scenario advisor CLI uses trusted registry/runtime-support when `process.cwd()` points at an analyzed PR workdir containing PR-local scenario-support changes. Unit and negative-path coverage is strong for the changed normalizer and rendering contract. Runtime validation would add confidence for the production split-checkout boundary, where trusted advisor code runs with `cwd` pointed at analyzed PR data.
  • **Runtime validation** — scenario advisor final result JSON never contains legacy `e2e-scenarios.yaml` or `e2e-scenarios-all.yaml` workflows after normalizing model output. Unit and negative-path coverage is strong for the changed normalizer and rendering contract. Runtime validation would add confidence for the production split-checkout boundary, where trusted advisor code runs with `cwd` pointed at analyzed PR data.
  • **Runtime validation** — system prompt names the Vitest workflow, registry, runtime-support, live registry test, and framework fixture paths as authoritative scenario surfaces. Unit and negative-path coverage is strong for the changed normalizer and rendering contract. Runtime validation would add confidence for the production split-checkout boundary, where trusted advisor code runs with `cwd` pointed at analyzed PR data.
  • **Acceptance clause:** This keeps the advisor aligned with Epic: Migrate legacy bash E2E into the Vitest E2E system #5098 while the typed-shell retirement audit continues separately. — add test evidence or identify existing coverage. The diff routes advisor recommendations away from legacy typed-shell workflows while `.github/workflows/e2e-scenarios.yaml` and `.github/workflows/e2e-scenarios-all.yaml` still exist. Exact Epic: Migrate legacy bash E2E into the Vitest E2E system #5098 issue text/comments were not available in the deterministic linked-issue context, so clause-level alignment with that issue could not be independently verified.

Workflow run details

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

cv added 3 commits June 9, 2026 20:49
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants