Skip to content

fix(e2e): preserve managed-image producer attempts - #10451

Closed
prekshivyas wants to merge 1 commit into
mainfrom
fix/managed-image-producer-attempts
Closed

fix(e2e): preserve managed-image producer attempts#10451
prekshivyas wants to merge 1 commit into
mainfrom
fix/managed-image-producer-attempts

Conversation

@prekshivyas

@prekshivyas prekshivyas commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Preserve each managed-image cohort entry's producer run attempt instead of replacing it with the selected publication attempt. This allows a retried cohort publication to reuse successful platform artifacts from earlier attempts while still binding every SLSA provenance builder ID to the exact producing workflow attempt.

Changes

  • Copy each candidate artifact's run identity into the final cohort platform entry.
  • Validate platform run keys, run ID, attempt bounds, and the SLSA builder ID before publishing or consuming the cohort.
  • Add regression coverage for mixed-attempt cohorts, mismatched builder identities, and impossible future producer attempts.
  • Document the per-platform producer identity contract in the owning E2E guide.

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:
  • 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: Reviewed artifact identity validation end to end; the consumer rejects missing, malformed, mismatched, or future producer attempts and requires the SLSA builder ID to match the exact producing workflow attempt.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

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 — command/result or justification: npx vitest run --project e2e-support test/e2e/support/managed-image-cohort-contract.test.ts (12 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: Prekshi Vyas prekshiv@nvidia.com

Summary by CodeRabbit

  • Bug Fixes

    • Strengthened artifact verification to ensure published platform images are tied to the correct workflow runs and attempts.
    • Rejected image publications with mismatched, incomplete, or newer provenance information.
    • Improved cohort validation so earlier valid publication attempts remain supported.
  • Tests

    • Added coverage for valid earlier attempts and invalid provenance or newer producer attempts.
    • Updated end-to-end validation guidance for workflow and provenance checks.

@prekshivyas prekshivyas self-assigned this Aug 27, 2026
@github-code-quality

github-code-quality Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall line coverage in commit 8df1bd2 in the fix/managed-image-pr... branch remains at 96%, unchanged from commit ba12fc0 in the main branch.

TypeScript / code-coverage/cli

The overall line coverage in commit 8df1bd2 in the fix/managed-image-pr... branch remains at 84%, unchanged from commit ba12fc0 in the main branch.

Show a line coverage summary of the most impacted files.
File main ba12fc0 fix/managed-image-pr... 8df1bd2 +/-
src/lib/actions...sor-relaunch.ts 98% 91% -7%
src/lib/onboard...eate-attempt.ts 96% 90% -6%
src/lib/onboard...eate-journal.ts 90% 85% -5%
src/lib/onboard...vider/docker.ts 88% 85% -3%
src/lib/onboard...uild-context.ts 74% 74% 0%
src/lib/onboard...trap/adapter.ts 70% 71% +1%
src/lib/onboard...ndbox-create.ts 88% 89% +1%
src/lib/onboard...cker-journal.ts 73% 75% +2%
src/lib/onboard...er-gpu-patch.ts 79% 81% +2%
src/lib/actions...ary-recovery.ts 92% 97% +5%

Updated August 27, 2026 04:12 UTC

@coderabbitai

coderabbitai Bot commented Aug 27, 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: 536f33e5-9433-4f65-bfbd-87bf520763aa

📥 Commits

Reviewing files that changed from the base of the PR and between ba12fc0 and 8df1bd2.

📒 Files selected for processing (4)
  • .github/workflows/managed-images.yaml
  • test/e2e/README.md
  • test/e2e/support/managed-image-cohort-contract.test.ts
  • tools/e2e/managed-image-cohort-contract.mts

Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review.


📝 Walkthrough

Walkthrough

The change adds producer workflow run metadata to managed-image cohort records. Validation now checks run IDs, positive attempts, attempt ordering, and SLSA builder identities. End-to-end fixtures and documentation cover earlier, mismatched, and newer producer attempts.

Changes

Provenance validation

Layer / File(s) Summary
Platform evidence contract
tools/e2e/managed-image-cohort-contract.mts
validatePlatformEvidence validates producer run fields, run identity, attempt ordering, and SLSA builder identity.
Workflow manifest validation
.github/workflows/managed-images.yaml
The workflow stages candidate run metadata and passes repository, run ID, and attempt values to cohort and platform validation.
Attempt-aware fixtures and coverage
test/e2e/support/managed-image-cohort-contract.test.ts, test/e2e/README.md
Fixtures record producer runs. Tests cover earlier, mismatched, and newer producer attempts. Documentation describes the provenance rules.

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

Merge Risk: ⚪ Minimal · up to 8df1b

The change preserves producer-attempt identity and adds validation and regression coverage; no actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant ManagedImagesWorkflow
  participant CohortManifest
  participant jqValidation
  participant SLSAProvenance
  ManagedImagesWorkflow->>CohortManifest: stage candidate run metadata
  ManagedImagesWorkflow->>jqValidation: provide repository, run ID, and attempt
  jqValidation->>SLSAProvenance: validate builder identity for producer attempt
  SLSAProvenance-->>jqValidation: accept or reject provenance
  jqValidation-->>ManagedImagesWorkflow: validation result
Loading

Suggested reviewers: brandonpelfrey

🚥 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (2 skipped: 2 … 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 concisely describes the main change: preserving managed-image producer attempts in E2E 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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ 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/managed-image-producer-attempts

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

@prekshivyas

Copy link
Copy Markdown
Collaborator Author

Superseded by #10450. The consolidated PR now includes the per-platform producer run contract, exact SLSA builder-attempt binding, bounded mixed-attempt validation, documentation, and regression tests.

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