Skip to content

ci(e2e): publish direct PR gate check - #7935

Merged
prekshivyas merged 6 commits into
mainfrom
codex/7451-direct-pr-e2e-required-v2
Aug 4, 2026
Merged

ci(e2e): publish direct PR gate check#7935
prekshivyas merged 6 commits into
mainfrom
codex/7451-direct-pr-e2e-required-v2

Conversation

@cjagwani

@cjagwani cjagwani commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Publish E2E / PR Gate directly from the trusted controller instead of mirroring the controller verdict through a six-hour polling job. The required check keeps the exact PR head, base, GitHub App, retry-history, and final-state validation already enforced by the controller.

Related Issue

Closes #7451

Changes

  • Remove the polling required workflow job and delete tools/e2e/pr-e2e-required.mts with its observer tests.
  • Rename the controller-owned custom check to the required E2E / PR Gate context and update the child-workflow authorization boundary.
  • Keep E2E / PR Gate Coordination as a rollout-only maintainer-inspection fallback when the current check is absent.
  • Update risk planning, watch triggers, merge-gate inspection, tests, and operator documentation for the direct lifecycle.
  • Preserve automatic internal dispatch and the unified exact-SHA approve-e2e route for selected fork work established by ci(e2e): let maintainers authorize internal runs #7826 and ci(e2e): unify maintainer approval #7832.

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: Nine-category security review passed all categories with no findings. Exact head/base identity, GitHub App ownership, retry lineage, final live-state checks, and child authorization remain fail closed.
  • 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: .agents/skills/nemoclaw-maintainer-day/MERGE-GATE.md, test/e2e/README.md, and test/e2e/docs/README.md accurately document the direct check, rollout fallback, automatic internal dispatch, and fork-only approve-e2e route. The exact-head documentation review corrected the seeded-check identity rule; a follow-up review confirmed the final test-only fixture change needs no additional prose. Focused documentation-policy validation passed 19 tests.
  • Agent: Codex Desktop

DGX Station Hardware Evidence

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

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 — npm exec -- vitest run --project integration test/pr-e2e-gate*.test.ts test/maintainer-skills-policy.test.ts test/pr-risk-plan.test.ts test/skills/check-gates*.test.ts test/vitest-watch-triggers.test.ts passed 23 files and 508 tests; the final ordered-comparison fixture passed 26/26 controller tests; npm exec -- vitest run --project e2e-support test/e2e/support/e2e-operations-workflow-boundary.test.ts passed 45 tests; npm run test:changed passed with no source-backed tests selected.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result: Not applicable. This is a focused controller/check-name migration; the targeted integration and workflow-boundary suites cover the changed behavior, and required CI supplies the broad result. npm run check:diff and npm run typecheck:cli passed against current main.
  • 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: Charan Jagwani cjagwani@nvidia.com

Summary by CodeRabbit

  • Bug Fixes

    • Improved E2E merge-gate verification using the trusted E2E / PR Gate check, with clearer retry semantics and fail-closed behavior.
    • Strengthened PR identity, stale-state, dispatch authorization, fork approval, and runner-loss recovery handling.
    • Improved verdict and evidence reporting, including compatibility with the former check name during rollout.
  • Documentation

    • Updated merge-gate and E2E CI documentation for revised lifecycle, authorization, retry, and rollout behavior.
  • Tests

    • Expanded coverage for lifecycle, retries, recovery, fork approval, rollout compatibility, and evidence handling.

Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
@cjagwani cjagwani self-assigned this Jul 30, 2026
@copy-pr-bot

copy-pr-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jul 30, 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: eaf2d783-5ae6-4f15-892c-9a16d4bc59d1

📥 Commits

Reviewing files that changed from the base of the PR and between 7844592 and 848d79a.

📒 Files selected for processing (1)
  • test/pr-e2e-gate.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/pr-e2e-gate.test.ts

📝 Walkthrough

Walkthrough

The PR makes E2E / PR Gate the controller-owned required check, removes the polling job and obsolete script, updates trusted evidence selection and rollout fallback, and revises E2E gate documentation and tests.

Changes

Controller-owned required check

Layer / File(s) Summary
Required-check lifecycle and workflow wiring
.github/workflows/*, tools/e2e/*, test/pr-e2e-gate*.test.ts, test/e2e/support/*
The controller uses E2E / PR Gate. The polling required job and tools/e2e/pr-e2e-required.mts are removed. Workflow, identity, comparison, and lifecycle tests are updated.
Trusted evidence rollup and rollout fallback
.agents/skills/.../scripts/check-gates.ts, test/skills/*
Evidence selection prefers E2E / PR Gate, exposes trustedCustomCheckId, and falls back to E2E / PR Gate Coordination only when the current check is absent.
Gate contract and operational documentation
.agents/skills/.../MERGE-GATE.md, test/e2e/README.md, test/e2e/docs/README.md
Documentation updates identity validation, fork approval, internal dispatch, retry history, evidence failures, cancellation, and required-check verdict rules.

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

Possibly related PRs

Suggested reviewers: cv, jyaunches, prekshivyas

🚥 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 summarizes the primary change: direct publication of the E2E PR gate check.
Linked Issues check ✅ Passed The PR fulfills the direct-check objectives in [#7451], including removing polling, preserving validation, and updating related workflows, tests, and documentation.
Out of Scope Changes check ✅ Passed The changes remain within [#7451] and support direct E2E gate ownership, rollout handling, validation, tests, and documentation.
✨ 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/7451-direct-pr-e2e-required-v2

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 848d79a in the codex/7451-direct-pr... branch remains at 96%, unchanged from commit f504948 in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit 848d79a in the codex/7451-direct-pr... branch remains at 81%, unchanged from commit 00c6111 in the main branch.

Show a code coverage summary of the most impacted files.
File main 00c6111 codex/7451-direct-pr... 848d79a +/-
src/lib/shields/index.ts 69% 68% -1%
src/lib/sandbox...rce-identity.ts 88% 88% 0%
src/lib/tunnel/services.ts 76% 76% 0%
src/lib/domain/.../connect-env.ts 89% 97% +8%

Updated August 04, 2026 08:46 UTC

@cjagwani

cjagwani commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict

PASS — safe to merge after required CI. The change removes a read-only polling/mirroring job and makes the existing trusted controller publish the already-required E2E / PR Gate context directly. It does not add a credential path, permission, dependency, parser, or mutable input. Exact PR head/base identity, GitHub Actions App 15368, external ID, retry lineage, live-state revalidation, and controller-to-child binding remain fail closed. The active main ruleset already requires this context from integration 15368.

Reviewed head: 217b10a

Findings

No security findings.

Detailed analysis

  1. Secrets and credentials — PASS. No secret, token, credential, environment file, key, or credential-handling code is added. The removed observer had read-only permissions. Existing credential-bearing child execution remains behind controller authorization and exact-identity checks.
  2. Input validation and data sanitization — PASS. Compatible-main parsing is strengthened against incomplete or synthetic GitHub comparison responses. It requires status ahead, a positive safe-integer ahead count, zero behind count, exact base and merge-base SHAs, total commits equal to the ahead count, a complete ordered commit list of that length ending at the current main SHA, and an enumerated files array. Missing or inconsistent fields fail closed before dispatch.
  3. Authentication and authorization — PASS. The child workflow authenticates E2E / PR Gate by check ID, GitHub Actions App ID/slug, exact head/base external ID, in-progress state, and controller-owned summary before untrusted checkout. Fork credentialed E2E still requires a current maintain or admin actor using the exact-SHA approve-e2e operation. Internal dispatch behavior is unchanged from current main.
  4. Dependencies and third-party libraries — PASS. No dependency or action pin changes.
  5. Error handling and logging — PASS. The direct controller retains bounded API reads, sanitized controller errors, immutable terminal history, and fail-closed handling for malformed, ambiguous, stale, unsupported, or incomplete state. Removing the observer removes duplicate polling logs and does not expose response bodies or secrets.
  6. Cryptography and data protection — PASS. Existing SHA-256 state/evidence bindings and private controller workspace handling are unchanged. No cryptographic primitive or data-protection boundary changes.
  7. Configuration and security headers — PASS. Workflow permissions are reduced overall by deleting the observer job; no new permission is granted. The active ruleset requires E2E / PR Gate from integration 15368. Full-SHA action pins, persist-credentials: false, and dependency-install safeguards remain.
  8. Security testing — PASS. The final suite covers direct check ownership, exact head and base identity, retry history, stale state, child authorization, remediation, and compatible-main advancement using the real GitHub comparison schema. It additionally rejects incomplete descendant commit lists. Fifteen focused gate files passed 229 tests, and CLI type-checking passed.
  9. System security — PASS. No TOCTOU or concurrency guard is removed from the authority that records the verdict. Compatible-main dispatch now binds the complete ordered comparison commit list to the observed current main SHA, retains bounded file-risk validation, and performs the existing second main read before dispatch. Initialization, coordination, cancellation, retry replacement, authorization, and rollout preference remain fail closed.

Files reviewed

  • .agents/skills/nemoclaw-maintainer-day/MERGE-GATE.md
  • .agents/skills/nemoclaw-maintainer-day/scripts/check-gates.ts
  • .github/workflows/e2e.yaml
  • .github/workflows/pr-e2e-gate.yaml
  • test/e2e/README.md
  • test/e2e/docs/README.md
  • test/e2e/support/e2e-operations-workflow-boundary.test.ts
  • test/helpers/vitest-watch-triggers.ts
  • test/maintainer-skills-policy.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-runner-loss-dispatch-recovery.test.ts
  • test/pr-e2e-gate-runner-loss-retry.test.ts
  • test/pr-e2e-gate-workflow.test.ts
  • test/pr-e2e-gate.test.ts
  • test/pr-e2e-required.test.ts (deleted observer tests)
  • test/pr-risk-plan.test.ts
  • test/skills/check-gates-evidence.test.ts
  • test/skills/check-gates-retry-history.test.ts
  • test/skills/check-gates-rollout.test.ts
  • test/skills/check-gates-test-fixtures.ts
  • test/vitest-watch-triggers.test.ts
  • tools/e2e/operations-workflow-boundary.mts
  • tools/e2e/pr-e2e-gate.mts
  • tools/e2e/pr-e2e-required.mts (deleted observer)

@cjagwani
cjagwani marked this pull request as ready for review July 30, 2026 19:10
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings reported

Advisor assessment: No blocking advisor findings reported
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Model comparison: normalized findings match; normalized terminology decisions differ; normalized E2E selections match; severity counts match.

Second-opinion terminology and E2E selections are advisory. They do not change the primary assessment or E2E / PR Gate.

1 semantic terminology decision

Terminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.

  • established — required check at .agents/skills/nemoclaw-maintainer-day/MERGE-GATE.md:75: Use required check for the policy-required E2E verdict. Name the controller workflow when its separate outcome is intended.

E2E guidance

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

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

Workflow run details

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

@cjagwani
cjagwani requested review from cv, jyaunches and prekshivyas July 30, 2026 19:28
cjagwani added 2 commits July 30, 2026 14:51
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/pr-e2e-gate.test.ts (1)

478-501: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Make the order-sensitive fixture contain multiple commits.

This test now claims to verify GitHub comparison commit order, but ahead_by: 1 with one commit cannot catch regressions in selecting the final commit. Use ahead_by: 2, total_commits: 2, and place a non-main SHA before ADVANCED_WORKFLOW_SHA.

As per path instructions, tests should prove the observable behavior rather than only exercise a one-element fixture.

Suggested fixture update
-                total_commits: 1,
+                total_commits: 2,
...
-                commits: [{ sha: ADVANCED_WORKFLOW_SHA }],
+                commits: [
+                  { sha: "f".repeat(40) },
+                  { sha: ADVANCED_WORKFLOW_SHA },
+                ],

Also update the surrounding ahead_by value to 2.

🤖 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.test.ts` around lines 478 - 501, Update the comparison
fixture in the “dispatches from a safe descendant in GitHub comparison commit
order” test to represent two commits: set ahead_by and total_commits to 2, and
place a non-main commit SHA before ADVANCED_WORKFLOW_SHA in commits. Keep the
expected observable dispatch behavior unchanged.

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.

Outside diff comments:
In `@test/pr-e2e-gate.test.ts`:
- Around line 478-501: Update the comparison fixture in the “dispatches from a
safe descendant in GitHub comparison commit order” test to represent two
commits: set ahead_by and total_commits to 2, and place a non-main commit SHA
before ADVANCED_WORKFLOW_SHA in commits. Keep the expected observable dispatch
behavior unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 62d2aa47-1235-44b0-bd73-f0fb26ee4726

📥 Commits

Reviewing files that changed from the base of the PR and between 385f598 and 217b10a.

📒 Files selected for processing (3)
  • test/e2e/README.md
  • test/pr-e2e-gate.test.ts
  • tools/e2e/pr-e2e-gate.mts

@wscurran wscurran added area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure chore Build, CI, dependency, or tooling maintenance labels Aug 3, 2026

@apurvvkumaria apurvvkumaria left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve — reviewed exact head 217b10a. The direct controller-owned E2E / PR Gate preserves exact PR head/base identity, GitHub Actions App ownership, retry lineage, live-state revalidation, and fail-closed child authorization while removing the duplicate polling mirror. Focused gate and workflow-boundary coverage is extensive, and I found no blocking correctness, security, compatibility, or regression defect. The recorded gate failure correctly propagated an unrelated flaky messaging cleanup test rather than exposing a defect in this PR.

Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>

# Conflicts:
#	.agents/skills/nemoclaw-maintainer-day/MERGE-GATE.md
#	test/e2e/README.md
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
@cjagwani

cjagwani commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

Security review — exact head 784459287e912524355df09c1147dc457bfa1d5b

Verdict: PASS. No security findings. The direct required-check design preserves the controller's fail-closed exact head/base identity, GitHub Actions App ownership, retry-lineage, dispatch authorization, and final live-state validation. Removing the read-only polling observer does not expand permissions or expose credentials.

Category Verdict Evidence
Secrets and credentials PASS No secrets or credential material added; diff-scoped gitleaks passed.
Input validation and data sanitization PASS Existing strict PR number, SHA, repository, workflow, check ID, title, and external-identity validation remains in the trusted controller.
Authentication and authorization PASS Fork execution still requires current maintain/admin permission and an exact pending fork-approval state; child dispatch authenticates the controller-owned check.
Dependencies and third-party libraries PASS No dependency or action-pin changes.
Error handling and logging PASS Terminal, malformed, stale, ambiguous, and lost-response states remain fail closed; refreshed diagnostics identify the required check without echoing untrusted output.
Cryptography and data protection PASS Existing SHA-256 state binding and HTTPS GitHub API transport are unchanged; no custom cryptography added.
Configuration and security headers PASS Workflow permissions remain job-scoped and least-privilege; the removed observer had read-only permissions.
Security testing PASS Exact-head validation passed 508 focused integration tests plus 45 E2E-support boundary tests, including fork approval, retry history, runner-loss recovery, rollout compatibility, and workflow contracts.
System security PASS No TOCTOU relaxation: the controller still revalidates live PR/head/base/check identity before dispatch and finalization, and superseded revisions cannot satisfy the current gate.

Files reviewed: all 28 files in the exact diff against origin/main, covering the two workflows, controller and merge-gate code, maintainer/E2E documentation, deletion of the polling observer, and all changed tests.

Local verification: npm run check:diff passed, including workflow/config validation, gitleaks, E2E phase plans, source-shape and test-size budgets, CLI typecheck, and pre-push checks.

@cjagwani cjagwani added the v0.0.102 Release target label Aug 4, 2026
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
@cjagwani

cjagwani commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

Security review refresh — exact head 848d79aba92175643793c287aebc6672bd9052a8

Verdict: PASS. No new security findings. I rechecked the full effective diff against current main; the only delta from the complete nine-category review at 784459287 is a test fixture in test/pr-e2e-gate.test.ts. It changes the mocked compatible-main comparison from one commit to two ordered commits and keeps the current-main SHA last, so the test now proves the controller uses GitHub comparison order.

This delta adds no production code, workflow permission, input surface, dependency, credential path, logging path, cryptographic behavior, or authorization state. The prior nine-category review therefore remains applicable to the exact head, with all nine categories PASS. The updated controller test passes 26/26; normal pre-commit and pre-push hooks passed.

@prekshivyas
prekshivyas merged commit df80015 into main Aug 4, 2026
77 of 80 checks passed
@prekshivyas
prekshivyas deleted the codex/7451-direct-pr-e2e-required-v2 branch August 4, 2026 11:43
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 chore Build, CI, dependency, or tooling maintenance v0.0.102 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: split E2E feedback-loop work into focused PRs

4 participants