Skip to content

fix(e2e): reuse CLI artifact for failed-job retries - #8478

Merged
apurvvkumaria merged 11 commits into
mainfrom
fix/e2e-main-full-rerun
Aug 7, 2026
Merged

fix(e2e): reuse CLI artifact for failed-job retries#8478
apurvvkumaria merged 11 commits into
mainfrom
fix/e2e-main-full-rerun

Conversation

@sandl99

@sandl99 sandl99 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Failed-job reruns now reuse the successful producer's immutable CLI artifact from an earlier attempt of the same workflow run. This avoids repeating successful E2E jobs while preserving candidate, workflow, run, artifact, and payload provenance.

Changes

  • Keep E2E / Main Retry on GitHub's failed-job rerun endpoint, which reruns failed jobs and their dependent jobs.
  • Treat the recorded attempt as the producer attempt. Consumers accept an earlier producer attempt from the same workflow run and reject a producer attempt newer than the consumer.
  • Continue requiring the recorded run ID, workflow SHA, candidate repository and SHA, immutable artifact ID, archive digest, and payload digest.
  • Have every E2E consumer invoke the reviewed reusable restore action revision.
  • Exercise the complete cross-attempt path from identity validation through producer-attempt manifest verification and file restoration, including rejection of an attempt mismatch.
  • Use fixed, content-free positive-path assertion diagnostics so child stdout and stderr cannot enter test failure messages.
  • Document failed-job retry behavior, the 3-day artifact retention period, and the failure mode when the artifact is unavailable.

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: Independent nine-category review of the pushed branch revision passed with no findings. Positive-path test diagnostics are fixed, content-free strings; no child stdout or stderr enters those failure messages. Artifact reuse remains limited to the same workflow run and reviewed workflow revision, the producer attempt cannot be newer than the consumer, and immutable artifact and payload verification remains 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: Independently reviewed test/e2e/README.md and test/e2e/docs/README.md against the retry controller, restore action, identity-to-restore fixture, manifest-attempt mismatch coverage, and focused tests. The internal E2E guidance accurately covers failed-job reruns, producer-artifact reuse and retention, same-run identity and attempt ordering, manifest verification, and fail-closed restoration. The content-free assertion diagnostics are test-only. No user-facing Fern page is affected.
  • Agent: Codex

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit: Not applicable; scripts/prepare-dgx-station-host.sh is unchanged.
  • 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 — npx vitest run --project e2e-support test/e2e/support/main-run-retry.test.ts test/e2e/support/cli-artifact-workflow-boundary.test.ts passed 49 tests. Repository project-membership, test-title, source-shape, pre-commit, commit-message, and pre-push checks 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: San Dang sdang@nvidia.com
Signed-off-by: Carlos Villela cvillela@nvidia.com
Signed-off-by: Apurv Kumaria akumaria@nvidia.com

Summary by CodeRabbit

  • Bug Fixes

    • Improved end-to-end workflow retries by rerunning failed jobs and dependents without rerunning successful artifact-producing jobs.
    • Reused immutable CLI artifacts from earlier attempts with stronger validation of workflow identity, provenance, attempt order, and payload integrity.
    • Preserved retry limits and exclusions for manual or superseded main-branch runs.
    • Retry results now retain cumulative attempt and runner-minute summaries, with later successful attempts identified as flaky.
  • Documentation

    • Updated end-to-end retry guidance to describe artifact reuse, validation, failure handling, runner behavior, and evidence collection.

@sandl99 sandl99 self-assigned this Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The E2E retry flow reruns failed jobs and dependents, reuses the successful producer artifact, and validates producer and consumer workflow attempts during restoration. Tests, workflow pins, and documentation cover the updated behavior.

Changes

E2E retry behavior

Layer / File(s) Summary
Producer artifact restore validation
.github/actions/restore-e2e-cli-artifact/action.yaml, tools/e2e/cli-artifact-workflow-boundary.mts
Restore validation distinguishes producer and consumer attempts. It accepts producer attempts that do not exceed the consumer attempt and passes the producer attempt to manifest verification.
Failed-job retry integration and coverage
test/e2e/support/*
Retry and restore tests cover failed-job reruns, artifact reuse, attempt mismatches, invalid consumer attempts, and the absence of full workflow reruns.
Workflow wiring and retry documentation
.github/workflows/e2e.yaml, test/e2e/README.md, test/e2e/docs/README.md
E2E jobs use the updated restore action pin. Documentation describes immutable artifact reuse, attempt ordering, retry limits, and retry reporting.

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

Sequence Diagram(s)

sequenceDiagram
  participant E2EMainRetry
  participant FailedJobRerun
  participant RestoreAction
  participant ArtifactProvenance
  E2EMainRetry->>FailedJobRerun: Request failed-job and dependent rerun
  FailedJobRerun->>RestoreAction: Restore CLI artifact
  RestoreAction->>ArtifactProvenance: Validate run IDs, attempts, and payload digest
  ArtifactProvenance-->>RestoreAction: Return validated producer artifact
Loading

Possibly related PRs

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

🚥 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 and concisely describes the main change: reusing the CLI artifact for failed-job E2E retries.
✨ 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 fix/e2e-main-full-rerun

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

@github-code-quality

github-code-quality Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 1ca71dc in the fix/e2e-main-full-re... branch remains at 96%, unchanged from commit 312f8d1 in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit 1ca71dc in the fix/e2e-main-full-re... branch remains at 81%, unchanged from commit 312f8d1 in the main branch.

Show a code coverage summary of the most impacted files.
File main 312f8d1 fix/e2e-main-full-re... 1ca71dc +/-
src/lib/onboard...flight-ports.ts 67% 33% -34%
src/lib/domain/.../connect-env.ts 97% 89% -8%
src/lib/core/immutable.ts 97% 97% 0%
src/lib/messagi...flow-planner.ts 93% 93% 0%
src/lib/sandbox...rce-identity.ts 87% 87% 0%
src/lib/tunnel/services.ts 80% 80% 0%
src/lib/onboard...-transaction.ts 94% 95% +1%

Updated August 07, 2026 03:53 UTC

@github-actions

github-actions Bot commented Aug 6, 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 differ; severity counts match.
4 terminology differences from the second opinion

Advisory only. These are normalized differences from the primary terminology receipt.

  • failed-job rerun at test/e2e/README.md:462: primary classified it as justified; the second opinion classified it as established.
  • cross-attempt at test/e2e/support/cli-artifact-workflow-boundary.test.ts:469: selected only by the second-opinion lane as established.
  • producer_run_attempt at .github/actions/restore-e2e-cli-artifact/action.yaml:85: selected only by the second-opinion lane as justified.
  • consumer_run_attempt at .github/actions/restore-e2e-cli-artifact/action.yaml:90: selected only by the second-opinion lane as justified.
1 additional E2E selection from the second opinion

Advisory only. The primary lane did not select these E2E jobs or targets.

  • rebuild-hermes: The completed second-opinion lane identified E2E coverage that the primary lane omitted.

Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests.

Since last review: 0 prior items resolved · 0 still apply · 0 new items found

3 semantic terminology decisions

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

  • justified — failed-job rerun at test/e2e/README.md:462: Keep `failed-job rerun` where the distinction from a full workflow rerun affects artifact reuse.
  • justified — producer attempt at test/e2e/README.md:461: Keep `producer attempt` when stating artifact provenance or ordering rules.
  • justified — consumer attempt at test/e2e/README.md:465: Keep `consumer attempt` when stating the producer-before-consumer ordering rule.

E2E guidance

Advisory only. A maintainer can dispatch the default E2E suite against this exact revision.

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.

@coderabbitai coderabbitai Bot mentioned this pull request Aug 6, 2026
23 tasks

@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

🤖 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/e2e/support/cli-artifact-workflow-boundary.test.ts`:
- Around line 410-413: Update the test around runIdentityValidation to exercise
the complete artifact-reuse boundary, including payload verification, manifest
attempt matching, and file restoration through the public workflow. Ensure the
scenario validates the immutable producer artifact during the later failed-job
rerun; otherwise rename the test to describe identity validation only.
🪄 Autofix

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: cd31d970-62c5-4c6c-822f-04327ce33473

📥 Commits

Reviewing files that changed from the base of the PR and between f084b3d and c246409.

📒 Files selected for processing (6)
  • .github/actions/restore-e2e-cli-artifact/action.yaml
  • test/e2e/README.md
  • test/e2e/docs/README.md
  • test/e2e/support/cli-artifact-workflow-boundary.test.ts
  • test/e2e/support/main-run-retry.test.ts
  • tools/e2e/cli-artifact-workflow-boundary.mts

Comment thread test/e2e/support/cli-artifact-workflow-boundary.test.ts
@apurvvkumaria apurvvkumaria self-assigned this Aug 6, 2026
@cv cv changed the title fix(e2e): rerun full workflow for CLI artifact fix(e2e): reuse CLI artifact for failed-job retries Aug 6, 2026
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@apurvvkumaria

Copy link
Copy Markdown
Collaborator

Addressed the artifact-reuse review request in 4dad1c8.

The test now carries the validated producer attempt into manifest verification and file restoration during a later failed-job rerun. It also proves that a producer-attempt value that disagrees with the artifact manifest fails before activation. CodeRabbit has marked the thread resolved.

Validation completed on the current branch revision:

  • Focused E2E-support suite: 49/49 passed.
  • Repository project-membership, test-title, source-shape, pre-commit, commit-message, and pre-push gates passed.
  • All five commits appear as Verified in GitHub; the PR-body DCO declarations are present.
  • Independent documentation-writer review passed. The internal E2E guides match the workflow behavior; no user-facing Fern page is affected.

Nine-category security review: PASS, no findings.

Category Verdict Evidence
Secrets and credentials PASS No credential flow, secret input, or logging surface changed.
Input validation and sanitization PASS Provenance remains schema-constrained; workflow, run, repository, candidate, artifact, digest, and attempt ordering are validated before download or activation.
Authentication and authorization PASS Reuse is limited to the authenticated workflow run and reviewed workflow revision; workflow permissions are unchanged.
Dependencies and third-party libraries PASS No dependency or package-lock changes.
Error handling and logging PASS Invalid identity, future producer attempts, manifest mismatch, missing artifacts, unsafe archives, and digest mismatch all fail closed without exposing credentials.
Cryptography and data protection PASS Existing artifact and payload SHA-256 integrity checks remain enforced; no custom confidentiality mechanism was introduced.
Configuration and security controls PASS Candidate checkout code cannot replace the restore action, and restrictive artifact restoration controls remain intact.
Security testing PASS Positive cross-attempt restore coverage and negative attempt-order/manifest-mismatch coverage exercise the enforcing boundary.
System security PASS A later failed-job attempt can reuse only an earlier successful producer artifact from the same run; stale, future, cross-run, or mismatched state remains denied.

The earlier amd64 and arm64 image-job failures were infrastructure failures: both runners received Service Unavailable while resolving action downloads during job setup, before PR code ran. I have not spammed reruns during the current GitHub Actions outage. The fresh required checks remain queued, so this PR is not merge-ready yet.

@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

🤖 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/e2e/support/cli-artifact-workflow-boundary.test.ts`:
- Line 423: Replace the raw identity.stderr assertion message in the identity
status check with fixed text or a bounded, sanitized diagnostic, and apply the
same change to the corresponding fixture.output assertion around the other
referenced location. Ensure failure messages never expose child process output,
credentials, or tokens while retaining concise debugging context.
🪄 Autofix

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: 222252f8-376b-4383-99ae-76f6ba5a763d

📥 Commits

Reviewing files that changed from the base of the PR and between 5a63023 and 4dad1c8.

📒 Files selected for processing (1)
  • test/e2e/support/cli-artifact-workflow-boundary.test.ts

Comment thread test/e2e/support/cli-artifact-workflow-boundary.test.ts Outdated
@apurvvkumaria

Copy link
Copy Markdown
Collaborator

Security-review addendum for the current branch revision:

  • The later CodeRabbit finding was valid: two positive-path test assertions could include raw child-process output in Vitest failure messages.
  • The contributor and follow-up commits replaced both with fixed, content-free diagnostics. Expected identity, manifest, payload, and restored-file assertions remain intact.
  • Focused E2E-support validation passed 49/49 tests, and the review thread is resolved with CodeRabbit confirmation.
  • The refreshed nine-category review is PASS with no remaining findings. In particular, the error-handling/logging category now confirms that the changed positive-path assertions cannot expose child stdout, stderr, credentials, or unbounded logs.
  • Independent documentation review passed; the internal E2E guides remain accurate and no Fern documentation change is needed.

Required GitHub Actions checks are still queued during the service outage, and human approval is still missing, so the PR remains blocked from merge.

@apurvvkumaria

Copy link
Copy Markdown
Collaborator

Broad-gate validation update for the current branch revision:

  • Locked root and plugin dependencies installed successfully; CLI and plugin builds pass.
  • Focused E2E-support coverage passes 49/49, including all 39 artifact-boundary tests.
  • A full local npm test run could not produce valid repository-wide evidence in the restricted runner: unrelated suites were blocked from creating local IPC sockets and writing the npm cache. Those are runner restrictions, not failures in this seven-file E2E retry change.
  • The authoritative hosted gates remain queued during GitHub Actions degraded availability. I have not requested another hosted rerun.

The broad-gate checkbox remains intentionally open until trusted CI completes. This PR also still requires independent approval; there is no focused PR-related failure to fix at this point.

@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 — the current branch revision preserves failed-job reruns while reusing only an earlier successful CLI artifact from the same workflow run and reviewed workflow revision. Producer/consumer attempt ordering, workflow and candidate identity, immutable artifact identity, archive and payload digests, manifest matching, safe extraction, and restored-file checks remain fail closed. Both actionable review findings are resolved, the focused E2E-support suite passes 49/49, fixed diagnostics cannot expose child output, the documentation and nine-category security reviews are current, and all contributor attribution, DCO, and verification evidence is preserved. Trusted hosted gates remain required before merge.

Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@apurvvkumaria

Copy link
Copy Markdown
Collaborator

Current branch revision review receipt for b401641:

  • CI fix: removed the newly added if from the restore fixture by selecting the restore path after identity validation. Failure results and collected diagnostics remain unchanged; production and workflow behavior are untouched.
  • Validation: the focused E2E-support suite passed 49/49 tests, the repository conditional scan reports no if in the changed fixture, file hooks passed, the full commit hooks passed, and the pushed commit is GitHub Verified with DCO sign-off.
  • Documentation writer review: PASS / no docs needed. This follow-up changes only test-helper control flow and does not change production code, workflow contracts, CLI behavior, user-visible output, configuration, or documentation paths.
  • Security review: PASS with no findings in all nine categories. The follow-up adds no secrets, inputs, authorization paths, dependencies, cryptography, configuration, or runtime behavior. Error and logging behavior is not broadened; the helper continues to return the same failure result and diagnostics, while the existing content-free positive-path assertions remain in place. Existing artifact provenance, digest verification, attempt ordering, safe extraction, and restored-file coverage are unchanged.

Fresh CI, automated review, current independent approval, and all repository gates remain required before merge. No waiver or bypass is requested.

@github-actions github-actions Bot added v0.0.105 Release target and removed v0.0.104 labels Aug 7, 2026
@apurvvkumaria
apurvvkumaria merged commit bfcfb00 into main Aug 7, 2026
46 checks passed
@apurvvkumaria
apurvvkumaria deleted the fix/e2e-main-full-rerun branch August 7, 2026 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants