Skip to content

ci(release): dispatch Brev image on lkg promotion - #6774

Merged
cv merged 2 commits into
mainfrom
codex/issue-6772-lkg-brev-image
Jul 13, 2026
Merged

ci(release): dispatch Brev image on lkg promotion#6774
cv merged 2 commits into
mainfrom
codex/issue-6772-lkg-brev-image

Conversation

@jyaunches

@jyaunches jyaunches commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Promoting lkg now dispatches the downstream Brev production-image workflow with the immutable NemoClaw release tag. The source workflow validates the tag target, records non-secret correlation details, and leaves downstream image validation and promotion unchanged.

Related Issue

Fixes #6772

Changes

  • Add a trusted lkg tag workflow with read-only repository permissions and an immutable checkout action pin.
  • Resolve the promoted tag to its commit and highest exact vX.Y.Z tag before calling brevdev/nemoclaw-image on main.
  • Fail before dispatch for invalid targets or missing credentials, fail without rolling back lkg for rejected requests, and skip tag deletions.
  • Record the selected release, commit, target workflow, and dispatch result without exposing the cross-repository token.
  • Protect the behavior and secret boundary with focused script and workflow contract tests.
  • Document the downstream image-build side effect, token scope, and scheduled reconciliation fallback in the maintainer release skill.

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: This is internal maintainer release automation; the maintainer-facing side effect and secret requirements are documented in the release skill, with no end-user behavior or Fern docs impact.
  • 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: Focused local review verified read-only built-in permissions, disabled persisted checkout credentials, secret-free request and summary data, debug suppression, and negative tests for missing and rejected credentials.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Verification

  • PR description includes the DCO sign-off declaration 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 — npx vitest run test/release-lkg-brev-image.test.ts (1 file, 6 tests), bash -n scripts/release-lkg-brev-image.sh, and npm run source-shape: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: Not applicable to this focused workflow change.
  • 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

Summary by CodeRabbit

  • New Features
    • Added an event-driven production image dispatch for the LKG flow when an lkg tag targets a commit with an exact immutable vX.Y.Z release tag.
    • Dispatches builds using the immutable vX.Y.Z tag to improve release reliability.
    • Skips dispatch for deleted lkg tags and reports clear accepted/rejected outcomes.
  • Documentation
    • Documented the LKG production image dispatch behavior, expected failure modes, and required permissions.
  • Tests
    • Added end-to-end script tests covering success, missing/invalid tags, deletion handling, missing credentials, and dispatch rejection.

@jyaunches jyaunches added area: ci CI workflows, checks, release automation, or GitHub Actions area: security Security controls, permissions, secrets, or hardening area: skills Skills, agent behaviors, prompts, or skill packaging labels Jul 13, 2026
@jyaunches jyaunches self-assigned this Jul 13, 2026
@coderabbitai

coderabbitai Bot commented Jul 13, 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: d5609fb1-0d66-43c9-9405-db6833976416

📥 Commits

Reviewing files that changed from the base of the PR and between 18d7eae and fae5d09.

📒 Files selected for processing (1)
  • ci/source-shape-test-budget.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • ci/source-shape-test-budget.json

📝 Walkthrough

Walkthrough

Adds a GitHub Actions workflow and Bash dispatcher that resolve an exact release tag from lkg, dispatch the downstream production image workflow, handle deletion and failure cases, record summaries, and validate behavior through Vitest tests.

Changes

LKG production image dispatch

Layer / File(s) Summary
Resolve and dispatch the production image release
scripts/release-lkg-brev-image.sh
Validates the LKG SHA, resolves the matching exact semver tag, dispatches the downstream workflow on main, and records accepted, rejected, or skipped results.
Wire the lkg tag workflow and document its behavior
.github/workflows/release-lkg-brev-image.yaml, .agents/skills/.../SKILL.md
Triggers dispatch on non-deleted lkg pushes with read-only contents permissions and documents the downstream image-build behavior.
Validate dispatch behavior and secret boundaries
test/release-lkg-brev-image.test.ts, ci/source-shape-test-budget.json
Tests tag resolution, deletion handling, missing tokens, rejected requests, summary output, workflow configuration, and token isolation.

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

Possibly related PRs

Suggested labels: chore

Sequence Diagram(s)

sequenceDiagram
  participant LKGPush
  participant ReleaseLKGWorkflow
  participant DispatcherScript
  participant GitHub
  participant ProductionImageWorkflow
  LKGPush->>ReleaseLKGWorkflow: push lkg tag
  ReleaseLKGWorkflow->>DispatcherScript: pass LKG_SHA and token
  DispatcherScript->>DispatcherScript: resolve exact vX.Y.Z tag
  DispatcherScript->>GitHub: dispatch build-scheduled.yml on main
  GitHub->>ProductionImageWorkflow: start with nemoclaw_ref
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately describes the main change: dispatching the Brev image when lkg is promoted.
Linked Issues check ✅ Passed The workflow, script, docs, and tests implement the lkg-promotion dispatch, exact-tag resolution, deletion handling, and rejected-request behavior in #6772.
Out of Scope Changes check ✅ Passed The added files stay within the lkg-to-production-dispatch scope and only include supporting docs, workflow, script, tests, and a test-budget exception.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-6772-lkg-brev-image

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

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings

Merge posture: No blocking advisor findings
Primary next action: No advisor follow-up required beyond maintainer review.
Findings: 0 required · 0 warnings · 0 optional suggestions
Since last review: 0 prior items resolved · 0 still apply · 0 new items found

Workflow run details

This is an automated review. Required findings need action before merge. Warnings and optional suggestions do not require a response or follow-up. A human maintainer makes the final merge decision.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: None
Optional E2E: None

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • None. No existing live E2E job exercises the new cross-repository GitHub Actions release dispatch safely. The added hermetic Vitest coverage is the applicable current validation; running unrelated assistant, onboarding, or sandbox E2E jobs would not validate this deployment path.

Optional E2E

  • None.

New E2E recommendations

  • deployment (high): The hermetic script and workflow-contract tests do not prove that a real lkg tag push can authenticate to brevdev/nemoclaw-image and trigger the intended production workflow with the immutable semver input. Existing NemoClaw live E2E jobs cover assistant and sandbox flows, not this cross-repository release dispatch.
    • Suggested test: Add a protected release-dispatch integration lane using a non-production downstream test workflow/repository. Move a fixture lkg tag to a commit with an exact semver tag, verify the downstream workflow-dispatch event and nemoclaw_ref input, and verify deletion or an untagged target produces no dispatch.

@github-code-quality

github-code-quality Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage remains at 96%, unchanged from the main branch.

TypeScript / code-coverage/cli

The overall coverage in the codex/issue-6772-lkg... branch remains at 79%, unchanged from the main branch.

Show a code coverage summary of the most impacted files.
File main 3de1de6 codex/issue-6772-lkg... fae5d09 +/-
src/lib/security/redact.ts 99% 95% -4%
src/lib/sandbox/config.ts 66% 67% +1%
src/lib/securit...ntial-filter.ts 98% 99% +1%
src/lib/runner.ts 72% 75% +3%
src/lib/state/m...-acquisition.ts 77% 80% +3%
src/lib/name-validation.ts 94% 100% +6%
src/lib/actions...ge-preflight.ts 74% 89% +15%

Updated July 13, 2026 16:10 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@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

🧹 Nitpick comments (1)
.github/workflows/release-lkg-brev-image.yaml (1)

18-34: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Add a job-level timeout-minutes to bound the dispatch.

No timeout is set, so a network stall on gh api or checkout would let the job run for up to the default 360-minute ceiling before GitHub kills it, needlessly consuming CI minutes for what should be a sub-minute dispatch.

⏱️ Proposed fix
   dispatch-production-image:
     if: ${{ github.repository == 'NVIDIA/NemoClaw' && github.event.deleted == false }}
     runs-on: ubuntu-latest
+    timeout-minutes: 5
     steps:
🤖 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 @.github/workflows/release-lkg-brev-image.yaml around lines 18 - 34, Add a
job-level timeout-minutes setting to the dispatch-production-image job, using a
short bound appropriate for the checkout and sub-minute gh api dispatch. Keep
the existing job condition, checkout configuration, and dispatch script
unchanged.
🤖 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 `@ci/source-shape-test-budget.json`:
- Around line 369-373: Reorder the `test/release-lkg-brev-image.test.ts` entry
in `ci/source-shape-test-budget.json` so it appears after all
`regression-e2e-workflow` entries, preserving the file-name sort order and
leaving the entry’s contents unchanged.

---

Nitpick comments:
In @.github/workflows/release-lkg-brev-image.yaml:
- Around line 18-34: Add a job-level timeout-minutes setting to the
dispatch-production-image job, using a short bound appropriate for the checkout
and sub-minute gh api dispatch. Keep the existing job condition, checkout
configuration, and dispatch script unchanged.
🪄 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: 6e86c8a9-aa6f-4396-b8f3-b36b7e8a877d

📥 Commits

Reviewing files that changed from the base of the PR and between 3de1de6 and 18d7eae.

📒 Files selected for processing (5)
  • .agents/skills/nemoclaw-maintainer-cut-release-tag/SKILL.md
  • .github/workflows/release-lkg-brev-image.yaml
  • ci/source-shape-test-budget.json
  • scripts/release-lkg-brev-image.sh
  • test/release-lkg-brev-image.test.ts

Comment thread ci/source-shape-test-budget.json Outdated
@cv
cv merged commit 79a42b9 into main Jul 13, 2026
55 checks passed
@cv
cv deleted the codex/issue-6772-lkg-brev-image branch July 13, 2026 18:44
jyaunches added a commit that referenced this pull request Jul 20, 2026
<!-- markdownlint-disable MD041 -->
## Summary
This follow-up to #6774 captures the downstream Brev image workflow run
returned by GitHub and links it from the LKG trigger summary. The
maintainer release skill now explains how to hand that link to the
maintainer and treats downstream runtime validation and
production-family promotion as the success gate.

## Related Issue
Follow-up to #6772 and #6774.

## Changes
- Request `return_run_details` when dispatching `brevdev/nemoclaw-image`
and validate the returned numeric run ID and exact repository Actions
URL.
- Include the downstream run ID, clickable URL, and follow-through
instruction in the source workflow summary and log output.
- Fail safely when GitHub accepts a dispatch without valid run details,
while preserving the existing secret and `lkg` immutability boundaries.
- Teach `nemoclaw-maintainer-cut-release-tag` how to locate the source
run, extract the downstream link, and require runtime E2E plus
`nemoclaw-brev-cpu` family promotion.
- Add a five-minute timeout to the short source dispatch job and expand
its contract tests.

## Type of Change

- [x] 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
<!-- Check exactly one tests line and one docs line. Check other lines
when applicable. Add every requested justification or approval
reference. -->
- [x] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [ ] Tests not applicable — justification:
- [ ] Docs updated for user-facing behavior changes
- [x] Docs not applicable — justification: This is internal maintainer
release automation; the required documentation-writer review confirmed
the maintainer skill is the canonical guidance and no published user
behavior changes.
- [x] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [x] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification: The response is
validated as a numeric run ID plus the exact expected repository Actions
URL; the PAT remains environment-only, the summary remains secret-free,
and the security contract plus gitleaks passed.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification
<!-- Check each applicable item only when supported by the requested
evidence. Run targeted tests once per relevant change set and rerun
after later edits or hook autofixes that can affect the tested behavior.
Do not rerun hook-covered checks. -->
- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run check:diff` passed when hooks were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — command/result or justification: `npx
vitest run test/release-lkg-brev-image.test.ts
test/skills-frontmatter.test.ts test/changelog-docs.test.ts` (41/41
after merging current main).
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — command/result:
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only)
- [ ] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

---
<!-- DCO sign-off is required in this PR description, and every commit
must appear as Verified in GitHub. Run: git config user.name && git
config user.email -->
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Release Process**
* Release automation now includes downstream production image workflow
run details in the job summary, with a direct run link when available.
* Production image dispatches are rejected when returned downstream run
details are missing or inconsistent.
* Updated production image promotion guidance with clearer trigger steps
and success validation.
* **Reliability**
* The production image dispatch job now auto-terminates after five
minutes.
* **Tests**
* Extended workflow contract checks for optional timeouts and added
negative coverage for invalid downstream run details.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
Co-authored-by: Carlos Villela <cvillela@nvidia.com>
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: security Security controls, permissions, secrets, or hardening area: skills Skills, agent behaviors, prompts, or skill packaging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trigger the Brev production image build when lkg is promoted

3 participants