Skip to content

fix(e2e): redispatch complete plans after fixes - #7867

Closed
jyaunches wants to merge 2 commits into
mainfrom
codex/fix-e2e-remediation-loop
Closed

fix(e2e): redispatch complete plans after fixes#7867
jyaunches wants to merge 2 commits into
mainfrom
codex/fix-e2e-remediation-loop

Conversation

@jyaunches

@jyaunches jyaunches commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

After a same-repository PR fixes a failed E2E result, the next eligible ordinary CI completion now
rebuilds and immediately dispatches the complete selected E2E plan for the new PR commit. Fork PRs
retain their existing maintainer approval boundary.

Changes

  • Remove the same-repository control-plane branch that stopped before dispatch and instead route
    every internal selected plan through the existing automatic dispatch path.
  • Keep .github/workflows/pr-e2e-gate.yaml behavior unchanged. Its existing completed
    workflow_run trigger observes each new CI / Pull Request completion and passes every eligible
    run's PR commit to the controller, so the missing behavior was the controller decision after the
    trigger rather than workflow event routing.
  • Keep approve-e2e for fork PRs only, including maintainer-role, PR/base SHA, deterministic-plan,
    live-state, child-run, and evidence validation.
  • Add a lifecycle regression that records failed E2E for an old commit, advances the PR to a fixed
    commit, processes its successful CI completion, and asserts one dispatch containing
    cloud-inference, cloud-onboard, and security-posture. The test does not accept old-commit
    evidence or rerun only the formerly failed test.
  • Replace scoped exact head, exact-head, and exact revision terminology with plain PR
    vocabulary while retaining SHA fields required for checkout and evidence integrity.
  • Update only gate implementation, workflow, tests, and technical E2E documentation. Agent skills
    and maintainer skill-policy tests are unchanged.

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)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification:
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: The change removes the redundant same-repository stop after ordinary CI while retaining fork approval and all SHA, plan, coordination, live-state, child-run, and evidence checks. The lifecycle regression verifies a new commit receives a fresh complete-plan dispatch.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: docs-updated
  • Evidence: The reviewer independently confirmed complete-plan redispatch for a fixed new commit,
    fork-only approve-e2e, zero skill or maintainer-skill-policy changes, and zero scoped
    exact head, exact-head, or exact revision matches. No findings or additional documentation
    edits were needed.
  • Agent: Codex Desktop

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit: Not applicable
  • Station profile/scenario: Not applicable
  • Result: Not applicable
  • Supporting evidence: Not applicable

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run validate:pr passed after refreshing origin/main when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: Sixteen PR-gate integration files passed (295 tests); focused E2E-support files passed (58 tests); workflow-plan passed (25 tests); the review follow-up passed its focused integration test (2 tests); repository checks, CLI typecheck, test-size guard, commit hooks, npm run docs, and git diff --check passed.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result:
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • 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)

Signed-off-by: Julie Yaunches jyaunches@nvidia.com

@jyaunches jyaunches self-assigned this Jul 30, 2026
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR updates PR E2E gate authorization and dispatch semantics, removes internal control-plane credential authorization, restricts approve-e2e to fork PRs, adds remediation coverage, and aligns tests, documentation, and terminology.

Changes

PR E2E gate authorization and dispatch

Layer / File(s) Summary
Gate authorization and dispatch controller
tools/advisors/risk-plan.mts, tools/e2e/pr-e2e-gate.mts
Removes internal control-plane authorization checks and restricts authorized dispatch to fork pull requests.
Authorization contract tests
test/pr-e2e-gate-command.test.ts, test/pr-e2e-gate-fork-approval.test.ts, test/pr-e2e-gate-lifecycle.test.ts, test/pr-e2e-required.test.ts, test/pr-risk-plan.test.ts
Updates approval, fork, coordination, and risk-plan expectations while removing internal authorization scenarios.
Automatic dispatch and remediation validation
test/pr-e2e-gate-dispatch-recovery.test.ts, test/pr-e2e-gate-remediation.test.ts, test/pr-e2e-gate-retry-history.test.ts, test/pr-e2e-gate-typed-target.test.ts
Adds remediation coverage and verifies internal dispatch after failed or infrastructure-backed gate states.
PR E2E contract and terminology documentation
.github/workflows/e2e.yaml, test/e2e/README.md, tools/e2e/live-vitest-invocation.mts, tools/e2e/trusted-hermes-swap-workflow-boundary.mts
Documents PR E2E routing, concurrency, failure handling, fork approval inputs, and updated terminology.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PRGate
  participant GitHubChecks
  participant E2EWorkflow
  PRGate->>GitHubChecks: validate PR CI and coordination state
  PRGate->>E2EWorkflow: dispatch selected internal or approved fork plan
  E2EWorkflow-->>GitHubChecks: report E2E check status
Loading

Possibly related PRs

Suggested labels: area: ci, area: e2e, bug-fix, chore

Suggested reviewers: ericksoa, cv

🚥 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
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: redispatching complete E2E plans after fixes.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-e2e-remediation-loop

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.

@github-code-quality

github-code-quality Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 039f7dd in the codex/fix-e2e-remedi... branch remains at 96%, unchanged from commit 4dcb89e in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit 039f7dd in the codex/fix-e2e-remedi... branch remains at 81%, unchanged from commit 4dcb89e in the main branch.

Show a code coverage summary of the most impacted files.
File main 4dcb89e codex/fix-e2e-remedi... 039f7dd +/-
src/lib/onboard/docker-cdi.ts 80% 70% -10%
src/lib/onboard...host-anchors.ts 94% 90% -4%
src/lib/actions...eway-restart.ts 95% 94% -1%
src/lib/onboard/preflight.ts 80% 80% 0%
src/lib/actions...light-guards.ts 86% 90% +4%
src/lib/onboard...box-gpu-mode.ts 92% 97% +5%
src/lib/domain/.../connect-env.ts 89% 97% +8%
src/lib/actions...confirmation.ts 69% 79% +10%
src/lib/actions...ocker-health.ts 65% 82% +17%
src/lib/onboard...box-prebuild.ts 74% 92% +18%

Updated July 30, 2026 13:23 UTC

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Blocking findings reported

Advisor assessment: Blockers require maintainer review
Next action: Review the blockers below.
Findings: 1 blocker · 0 warnings · 0 suggestions

Model lanes

  • GPT-5.6 Terra (primary): Completed · medium confidence · 1 blocker · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 2 warnings · 0 suggestions
  • Model comparison: normalized findings differ; normalized E2E selections differ; Nemotron reported 1 fewer blocker, 2 more warnings, the same number of suggestions.

Nemotron output stays in workflow artifacts and does not change the assessment above.

E2E guidance

Advisory only. E2E / PR Gate selects and runs jobs independently.

Recommended E2E: cloud-inference, cloud-onboard, security-posture

Blockers

PRA-1 Blocker — Restore authorization before internal PR code receives E2E credentials

  • Location: tools/e2e/pr-e2e-gate.mts:3105
  • Category: security
  • Problem: The controller now dispatches every internal PR with selected E2E work after CI. The prior internal maintainer-approval path and its denial test were removed. An internal contributor can therefore run changed code in credential-bearing E2E jobs without an authorization decision.
  • Impact: Candidate code can access or exfiltrate credentials available to selected E2E jobs. SHA and repository checks bind the execution to the PR but do not prevent that PR code from using those credentials.
  • Fix: Restore an enforced authorization boundary before dispatching credential-bearing E2E for internal PRs, or limit automatic dispatch to an explicitly enforced trusted-author class. Keep fork approval separate.
  • Verification: Inspect the internal branch at tools/e2e/pr-e2e-gate.mts:3105 and the candidate checkout at .github/workflows/e2e.yaml:320-350.
  • Test coverage: Add a controller test that an internal PR with a credential-bearing selected plan makes no dispatch request until the required authorization state is present, and that an unauthorized internal PR cannot reach candidate checkout.
  • Evidence: tools/e2e/pr-e2e-gate.mts:3105-3144 dispatches selected work when the head repository equals the base repository and reserves approval only for forks. tools/e2e/pr-e2e-gate.mts:2229-2305 sends the PR checkout repository and SHA to the child workflow. .github/workflows/e2e.yaml:320-350 checks out inputs.checkout_repository at inputs.checkout_sha after trusted-dispatch validation. test/pr-e2e-gate-fork-approval.test.ts removes the test that required authorization before internal PR code received E2E credentials.

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

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

🧹 Nitpick comments (1)
test/pr-e2e-gate-retry-history.test.ts (1)

234-251: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the dispatch payload, not just the dispatch count.

toHaveLength(1) passes even if the controller dispatched for the wrong checkout SHA, base SHA, or job set — exactly the identity guarantees this gate is supposed to enforce. test/pr-e2e-gate-remediation.test.ts (Lines 300-309) already checks the body; mirroring that here keeps the "dispatches internal E2E" claim meaningful.

♻️ Suggested strengthening
       await expect(startPrGate(startCommand(workDir))).resolves.toBeUndefined();
-      expect(requests.filter((request) => request.url.endsWith("/dispatches"))).toHaveLength(1);
+      const dispatches = requests.filter((request) => request.url.endsWith("/dispatches"));
+      expect(dispatches).toHaveLength(1);
+      expect(dispatches[0]?.body).toMatchObject({
+        inputs: { checkout_sha: HEAD_SHA, base_sha: BASE_SHA },
+      });

As per path instructions, prefer observable outcomes through the public boundary over mock-call assertions that can pass without exercising the claim.

🤖 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 `@test/pr-e2e-gate-retry-history.test.ts` around lines 234 - 251, Strengthen
the dispatch assertion in the startPrGate test around startPrGate and the
/dispatches request by inspecting the captured request body, not only requests
count. Mirror the payload validation used in
test/pr-e2e-gate-remediation.test.ts to verify the dispatched checkout SHA, base
SHA, and expected job set through the public request boundary.

Source: Path instructions

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

Nitpick comments:
In `@test/pr-e2e-gate-retry-history.test.ts`:
- Around line 234-251: Strengthen the dispatch assertion in the startPrGate test
around startPrGate and the /dispatches request by inspecting the captured
request body, not only requests count. Mirror the payload validation used in
test/pr-e2e-gate-remediation.test.ts to verify the dispatched checkout SHA, base
SHA, and expected job set through the public request boundary.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 212cfa86-1ca9-4a4a-b453-9b15e9853173

📥 Commits

Reviewing files that changed from the base of the PR and between 376beb5 and c243cab.

📒 Files selected for processing (15)
  • .github/workflows/e2e.yaml
  • test/e2e/README.md
  • test/pr-e2e-gate-command.test.ts
  • test/pr-e2e-gate-dispatch-recovery.test.ts
  • test/pr-e2e-gate-fork-approval.test.ts
  • test/pr-e2e-gate-lifecycle.test.ts
  • test/pr-e2e-gate-remediation.test.ts
  • test/pr-e2e-gate-retry-history.test.ts
  • test/pr-e2e-gate-typed-target.test.ts
  • test/pr-e2e-required.test.ts
  • test/pr-risk-plan.test.ts
  • tools/advisors/risk-plan.mts
  • tools/e2e/live-vitest-invocation.mts
  • tools/e2e/pr-e2e-gate.mts
  • tools/e2e/trusted-hermes-swap-workflow-boundary.mts
💤 Files with no reviewable changes (2)
  • tools/advisors/risk-plan.mts
  • test/pr-risk-plan.test.ts

Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
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