Skip to content

fix(ci): bind canonical E2E check authorization#7529

Closed
apurvvkumaria wants to merge 2 commits into
mainfrom
codex/e2e-child-auth-check-url
Closed

fix(ci): bind canonical E2E check authorization#7529
apurvvkumaria wants to merge 2 commits into
mainfrom
codex/e2e-child-auth-check-url

Conversation

@apurvvkumaria

@apurvvkumaria apurvvkumaria commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Trusted PR E2E dispatches currently fail before checkout when GitHub preserves an Actions-owned coordination check's canonical URL instead of the requested child-run URL. This change binds the exact child run in the trusted check summary and accepts either GitHub URL representation only when every existing identity and plan check also matches.

Changes

  • Publish the selected child-run ID and URL in the controller-owned coordination summary.
  • Accept GitHub's canonical coordination-check URL while retaining exact check ID, app, head/base SHA, external ID, status, plan, and child-run summary validation.
  • Preserve the 45-attempt, two-second authorization poll with explicit no-cache request headers.
  • Add executable regression coverage for direct child-run URLs, canonical check URLs, mismatched child-run rejection, and polling-contract drift.

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: Internal trusted-controller authentication repair only; no command, configuration, contributor procedure, or product behavior changes.
  • 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: Maintainer self-review by @apurvvkumaria confirmed that canonical URLs are accepted only when the trusted summary binds the exact child-run ID and URL; the mismatch regression remains fail-closed. Independent approval remains required before merge.
  • 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: no-docs-needed
  • Evidence: This changes only internal CI authorization and focused tests. The documentation writer reviewed the effective exact-head diff against NemoClaw WRITING.md and docs/CONTRIBUTING.md, including terminology, structure, voice, test titles, and code-sample presentation. No user-facing documentation contract changes.
  • 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 check:diff passed 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: npx vitest run test/e2e/support/e2e-operations-workflow-boundary.test.ts test/pr-e2e-gate.test.ts passed 67/67; file-scoped hooks, repository checks, E2E semantic plans, source-shape budget, and test-size budget 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: Apurv Kumaria akumaria@nvidia.com

Summary by CodeRabbit

  • New Features

    • PR E2E check summaries now include a direct “Selected E2E run” hyperlink to the active run.
    • “Running … E2E checks” updates are now multi-line, combining the selected run link with risk-plan selection details.
  • Bug Fixes

    • Controller authentication validation now treats either the selected run URL or its canonical check URL as valid, preventing mismatches.
    • Workflow check output formatting and validation were tightened to keep run status reporting consistent.

Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@apurvvkumaria apurvvkumaria added area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure v0.0.96 Release target labels Jul 25, 2026
@apurvvkumaria apurvvkumaria self-assigned this Jul 25, 2026
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR updates E2E check summaries to link the selected child run and broadens controller authentication to accept either the child-run URL or canonical controller check URL, with boundary and gate tests covering both forms.

Changes

PR E2E controller authentication

Layer / File(s) Summary
Selected E2E run reporting
tools/e2e/pr-e2e-gate.mts, test/pr-e2e-gate.test.ts
Running check summaries now include the selected E2E run link and risk-plan selections, with assertions for both values.
Controller URL authentication
.github/workflows/e2e.yaml, tools/e2e/operations-workflow-boundary.mts, test/e2e/support/e2e-operations-workflow-boundary.test.ts
Controller validation accepts either the child-run or canonical check URL, and tests cover accepted URL forms and rejection of mismatched child-run summaries.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: cv

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 accurately reflects the main change: CI authorization now accepts the canonical E2E check URL under tighter validation.
✨ 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 codex/e2e-child-auth-check-url

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

@github-code-quality

github-code-quality Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 5c0ea66 in the codex/e2e-child-auth... branch remains at 96%, unchanged from commit 2ac4a0d in the main branch.


Updated July 25, 2026 19:48 UTC

@github-actions

github-actions Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Informational

Advisor assessment: Informational / high confidence
Next action: Review the warnings below.
Findings: 0 blockers · 1 warning · 0 suggestions
Status: Canonical ledger: 0 blocker(s), 1 warning(s), 0 suggestion(s).

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 0 blockers · 1 warning · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Model comparison: normalized findings differ; normalized E2E selections differ; Nemotron reported the same number of blockers, 1 fewer warning, 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-onboard, credential-sanitization, security-posture

1 warning · 0 suggestions

Warnings

Warnings do not block.

PRA-1 Warning — Record the canonical check-URL compatibility contract

  • Location: .github/workflows/e2e.yaml:231
  • Category: correctness
  • Problem: The authorization guard accepts the check URL as an alternative to the selected child-run URL, but the changed code does not record the GitHub state that requires this exception, its source, or when the exception can be removed.
  • Impact: A later change can retain or broaden this authorization exception without evidence that GitHub still produces the canonical URL state.
  • Recommendation: Add a concise comment or checked-in contract reference that names GitHub canonicalization, states that the check ID and exact child-run summary bind the exception, and defines the removal condition.
  • Verification: Read the authorization guard and its boundary test. Confirm that the documented producer and removal condition match the accepted check-URL branch.
  • Test coverage: Existing coverage already proves this boundary: the canonical URL test accepts only the URL derived from CONTROLLER_CHECK_ID, and the mismatched-summary case fails. No additional regression test is required.
  • Evidence: .github/workflows/e2e.yaml:231-255 constructs expected_check_url from CONTROLLER_CHECK_ID and accepts it as an alternative details_url. test/e2e/support/e2e-operations-workflow-boundary.test.ts: accepts the canonical check URL and rejects a summary that names a different child run. No linked issue or checked-in source supplied a documented producer or removal condition for the compatibility branch. test/e2e/support/e2e-operations-workflow-boundary.test.ts runControllerAuthentication uses CONTROLLER_CHECK_ID=17 and accepts https://github.com/NVIDIA/NemoClaw/runs/17. The same test file rejects that canonical URL when the exact summary identifies child run 24 rather than RUN_ID 23.

Workflow run details

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

@apurvvkumaria
apurvvkumaria requested a review from cv July 25, 2026 18:14
@apurvvkumaria

Copy link
Copy Markdown
Collaborator Author

Exact-head standard CI, image builds, and self-hosted tests are green at 71334537096916e3003d00f85f8bc8dcf11fed90. The trusted E2E controller then failed closed before dispatch because approve-credentialed-e2e-for-internal-pr did not record a required-reviewer approval (run 30169436141, job 89707944228). This is repository environment configuration, not a PR-code failure. An administrator must configure the documented required-reviewer protection; after that, this PR needs a fresh signed commit/SHA and fresh CI so the approval is recorded on a new first attempt. I am not bypassing or waiving this gate.

@apurvvkumaria

Copy link
Copy Markdown
Collaborator Author

Documented internal maintainer fallback was dispatched for the exact head/base pair (controller run 30170038805). It selected cloud-onboard, credential-sanitization, and security-posture, then child run 30170056708 failed before checkout or any credential-bearing job at Authenticate controller dispatch: trusted controller authorization was not published for this run. The child was still executing the current-main URL-equality guard that #7529 corrects, so this is the expected bootstrap catch-22 and direct production evidence for the patch. No selected E2E job ran and no repository secret was exposed. The gate remains unwaived; landing requires an authorized bootstrap path that can certify this workflow-boundary fix without pretending current-main authentication passed.

@apurvvkumaria apurvvkumaria added the area: security Security controls, permissions, secrets, or hardening label Jul 25, 2026
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@apurvvkumaria

Copy link
Copy Markdown
Collaborator Author

Synchronized current main in signed, GitHub-verified commit 5c0ea66eb8.

The conflict resolution preserves both authorization contracts:

  • The coordination summary binds and links the exact selected child run.
  • Authentication accepts only the exact child-run URL or GitHub's canonical URL for the same check.
  • Exact check ID, app, head/base SHA, external ID, status, plan, and summary validation remain required.
  • The 45-attempt, two-second poll retains Cache-Control: no-cache and Pragma: no-cache.

Validation on the merged tree:

  • Focused workflow and controller tests pass 67/67.
  • File-scoped hooks, YAML, Biome, repository checks, E2E semantic plans, source-shape budget, and test-size budget pass.
  • Pre-push JavaScript and CLI type checks pass.
  • Documentation-writer review: no-docs-needed; exact-head receipt refreshed.

This push does not request or re-request a reviewer. Fresh exact-head CI and an independent approval remain required before 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.

Actionable comments posted: 2

🤖 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 `@test/pr-e2e-gate.test.ts`:
- Around line 1260-1264: Update the summary assertion in the running update
expectation to verify the complete selected-run Markdown hyperlink, including
the exact URL for run 23, rather than only matching its label. Keep the existing
details_url assertion and ensure the assertion rejects summaries linking to a
different child run.
- Line 1424: Update the assertion for checkUpdates[1] to inspect only
body.output?.summary, rather than stringifying the entire body. Preserve the
existing expectation that the summary contains "upgrade-stale-sandbox".
🪄 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: fefae5a7-a0d1-43e1-865c-d8465552a899

📥 Commits

Reviewing files that changed from the base of the PR and between 7133453 and 5c0ea66.

📒 Files selected for processing (4)
  • .github/workflows/e2e.yaml
  • test/e2e/support/e2e-operations-workflow-boundary.test.ts
  • test/pr-e2e-gate.test.ts
  • tools/e2e/operations-workflow-boundary.mts
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/e2e.yaml
  • tools/e2e/operations-workflow-boundary.mts

Comment thread test/pr-e2e-gate.test.ts
Comment on lines 1260 to 1264
expect(runningUpdate?.body).toMatchObject({
details_url: "https://github.com/NVIDIA/NemoClaw/actions/runs/23",
output: {
summary: expect.stringContaining(
"Child run: https://github.com/NVIDIA/NemoClaw/actions/runs/23.",
),
summary: expect.stringContaining("[Selected E2E run 23]"),
},

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Assert the complete selected-run hyperlink.

The test only checks [Selected E2E run 23], so it would pass if the summary linked to the wrong child run. Assert the full [Selected E2E run 23](https://github.com/NVIDIA/NemoClaw/actions/runs/23) value, or the exact summary contract.

🤖 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 1260 - 1264, Update the summary
assertion in the running update expectation to verify the complete selected-run
Markdown hyperlink, including the exact URL for run 23, rather than only
matching its label. Keep the existing details_url assertion and ensure the
assertion rejects summaries linking to a different child run.

Source: Path instructions

Comment thread test/pr-e2e-gate.test.ts
),
},
});
expect(JSON.stringify(checkUpdates[1]?.body)).toContain("upgrade-stale-sandbox");

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep the assertion scoped to output.summary.

Matching JSON.stringify(checkUpdates[1]?.body) allows upgrade-stale-sandbox to appear in any body field and does not prove that the summary reports the selected job. Assert directly on checkUpdates[1]?.body.output?.summary.

🤖 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` at line 1424, Update the assertion for
checkUpdates[1] to inspect only body.output?.summary, rather than stringifying
the entire body. Preserve the existing expectation that the summary contains
"upgrade-stale-sandbox".

Source: Path instructions

@apurvvkumaria

Copy link
Copy Markdown
Collaborator Author

Superseded by merged PR #7515. Current main already binds the exact child Actions run in the trusted check summary, polls uncached state for the reviewed 45x2-second window, and deliberately does not authorize via details_url because GitHub canonicalizes that field. This PR's remaining production delta reintroduces an unstable details_url predicate and conflicts with the merged operator contract, so it should not be merged. The useful wrong-summary regression idea can be retained separately if coverage later proves incomplete.

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 area: security Security controls, permissions, secrets, or hardening v0.0.96 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant