Skip to content

fix(ci): bound shadow E2E wait logs - #6648

Merged
cv merged 2 commits into
mainfrom
codex/bound-shadow-watch-logs
Jul 10, 2026
Merged

fix(ci): bound shadow E2E wait logs#6648
cv merged 2 commits into
mainfrom
codex/bound-shadow-watch-logs

Conversation

@cv

@cv cv commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replace the post-merge shadow controller's repeated child-job rendering with bounded status polling. The wait step now logs only child-run state transitions while preserving failure propagation, evidence collection, and the 105-minute hard bound.

Changes

  • Poll only the correlated child's status and conclusion instead of repeatedly rendering its full job matrix.
  • Emit concise transition, query-failure, terminal-failure, unsupported-state, and timeout diagnostics.
  • Add executable workflow tests for duplicate-state suppression, success, terminal failure, GitHub query failure, and timeout handling.

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 changes only internal post-merge GitHub Actions polling and diagnostics; no user command, configuration, API, policy, or runtime 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: independent shell and trust-boundary review confirmed positive numeric run-ID validation, fixed GitHub status fields, controlled annotation values, timeout/cancellation separation, and preserved always-run evidence/finalization behavior
  • 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 — command/result or justification: npx vitest run --project integration test/post-merge-e2e-risk-gate-workflow.test.ts — 11 tests passed; the exact embedded wait script also returned success for live run 29110351531 and a concise failure annotation for live run 29110867027
  • 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: Carlos Villela cvillela@nvidia.com

Summary by CodeRabbit

  • Bug Fixes

    • Improved automated end-to-end validation monitoring, with deterministic polling of correlated run status/conclusion.
    • Added robust handling for invalid run identifiers, query failures, non-success completions, and explicit timeout reporting.
  • Tests

    • Expanded end-to-end risk gate workflow tests with a local harness that simulates CLI behavior across success, failure, query-failure, and timeout scenarios.
    • Added assertions to ensure the wait logic avoids unintended commands and handles timeout exit codes correctly.

@cv cv self-assigned this Jul 10, 2026
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The shadow workflow replaces gh run watch with explicit polling of correlated E2E run state, timeout handling, and terminal-result checks. Tests execute the extracted shell step with fake commands across success, failure, query-failure, timeout, and invalid-state scenarios.

Changes

E2E risk gate wait

Layer / File(s) Summary
Correlated run polling
.github/workflows/post-merge-e2e-risk-gate-shadow.yaml
Validates RUN_ID, polls child-run status and conclusion, handles success and failure outcomes, and reports query or timeout errors.
Polling outcome tests
test/post-merge-e2e-risk-gate-workflow.test.ts
Adds a subprocess harness and assertions for generated polling logic, terminal outcomes, query failures, timeouts, invalid IDs, and unsupported states.

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

Sequence Diagram(s)

sequenceDiagram
  participant ShadowWorkflow
  participant gh_run_view
  participant ChildE2ERun
  ShadowWorkflow->>gh_run_view: query child-run status and conclusion
  gh_run_view->>ChildE2ERun: retrieve run state
  ChildE2ERun-->>gh_run_view: return state
  gh_run_view-->>ShadowWorkflow: return JSON state
  ShadowWorkflow->>ShadowWorkflow: sleep 10 and repeat until completion or timeout
Loading

Suggested labels: area: ci, area: e2e

🚥 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 matches the main change: bounding and tightening the shadow E2E wait logging behavior in CI.
✨ 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/bound-shadow-watch-logs

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

@github-code-quality

github-code-quality Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in the codex/bound-shadow-w... branch remains at 96%, unchanged from the main branch.

Show a code coverage summary of the most impacted files.
File main bce8c8b codex/bound-shadow-w... c7b6cf8 +/-
nemoclaw/src/sh...bject-record.ts 100% 0% -100%
nemoclaw/src/bl...print/runner.ts 96% 95% -1%
nemoclaw/src/co...ration-state.ts 94% 94% 0%
nemoclaw/src/onboard/config.ts 98% 98% 0%
nemoclaw/src/bl...eprint/state.ts 98% 98% 0%
nemoclaw/src/sh...cy-boundary.cts 100% 100% 0%

TypeScript / code-coverage/cli

The overall coverage in the codex/bound-shadow-w... branch remains at 77%, unchanged from the main branch.

Show a code coverage summary of the most impacted files.
File main 2b84a04 codex/bound-shadow-w... c7b6cf8 +/-
src/lib/runner.ts 80% 72% -8%
src/lib/sandbox-base-image.ts 99% 92% -7%
src/lib/actions...de-preflight.ts 51% 60% +9%
src/lib/actions...e-validation.ts 81% 90% +9%
src/lib/actions...x/mcp-bridge.ts 35% 44% +9%
src/lib/inferen...apter-server.ts 0% 67% +67%
src/lib/onboard...uter-runtime.ts 0% 70% +70%
src/lib/actions...pter-cleanup.ts 0% 85% +85%
src/lib/inferen...pter-forward.ts 0% 88% +88%
src/lib/inferen...apter-common.ts 0% 88% +88%

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

@github-actions

github-actions Bot commented Jul 10, 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 is required. The deterministic risk plan lists no required jobs, and the changed files are limited to post-merge CI risk-gate workflow behavior plus its workflow contract tests. The modified wait/query behavior is not exercised by NemoClaw live user-flow E2E jobs; targeted workflow/unit tests are the appropriate validation path.

Optional E2E

  • None.

New E2E recommendations

  • None.

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

E2E Target Recommendation

Required E2E targets: None
Optional E2E targets: None

Workflow run

Full E2E target advisor summary

E2E Target Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E targets

  • None. The PR changes the post-merge E2E risk-gate shadow controller and its non-test/e2e workflow contract test, but does not change the canonical .github/workflows/e2e.yaml target workflow, typed target registry/runtime support, live target tests, or shared test/e2e fixtures/support. No E2E target dispatch is required by this advisor.

Optional E2E targets

  • None.

Relevant changed files

  • .github/workflows/post-merge-e2e-risk-gate-shadow.yaml

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor (Nemotron Ultra) — No blocking findings

Merge posture: No blocking advisor findings
Primary next action: Add or justify PRA-T1 and any related test follow-ups.
Open items: 0 required · 0 warnings · 0 suggestions · 1 test follow-up
Since last review: 2 prior items resolved · 0 still apply · 0 new items found

Action checklist

  • PRA-T1 Add or justify test follow-up: Runtime validation
Test follow-ups to resolve or justify

If these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.

  • PRA-T1 Runtime validation — Add or identify targeted runtime/integration validation for the changed behavior; do not report external E2E job pass/fail here.. Runtime/sandbox/infrastructure paths need behavioral runtime validation: .github/workflows/post-merge-e2e-risk-gate-shadow.yaml. Unit tests exhaustively cover all changed wait-script behavior (6 scenarios with mocked gh/timeout/sleep); full controller lifecycle (dispatch→wait→evidence→finish→check-run update) cannot be unit-tested; PR body cites live validation against runs 29110351531 (success) and 29110867027 (concise failure annotation)

Workflow run details

This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision.

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings

Merge posture: No blocking advisor findings
Primary next action: Add or justify PRA-T1 and any related test follow-ups.
Open items: 0 required · 0 warnings · 0 suggestions · 2 test follow-ups
Since last review: 2 prior items resolved · 0 still apply · 0 new items found

Action checklist

  • PRA-T1 Add or justify test follow-up: Runtime validation
  • PRA-T2 Add or justify test follow-up: Runtime validation
Test follow-ups to resolve or justify

If these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.

  • PRA-T1 Runtime validation — Add or identify targeted runtime/integration validation for the changed behavior; do not report external E2E job pass/fail here.. Runtime/sandbox/infrastructure paths need behavioral runtime validation: .github/workflows/post-merge-e2e-risk-gate-shadow.yaml. This PR changes workflow/infrastructure behavior, so targeted runtime validation is useful; checked-in shell-boundary tests cover the main changed behavior and prior regression gaps.
  • PRA-T2 Runtime validation — If maintainers want extra runtime confidence, identify or run targeted workflow/integration validation for the changed post-merge shadow wait behavior; do not substitute external E2E pass/fail claims for checked-in regression tests.. Runtime/sandbox/infrastructure paths need behavioral runtime validation: .github/workflows/post-merge-e2e-risk-gate-shadow.yaml. This PR changes workflow/infrastructure behavior, so targeted runtime validation is useful; checked-in shell-boundary tests cover the main changed behavior and prior regression gaps.

Workflow run details

This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision.

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

🧹 Nitpick comments (1)
test/post-merge-e2e-risk-gate-workflow.test.ts (1)

43-99: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Make the fake commands enforce the external contract.

The fake gh accepts any command, while the timeout scenario returns 124 without validating the 105-minute bound. Consequently, incorrect CLI arguments can pass, and the exact wait.run string assertions lock tests to shell spelling.

Have the fakes reject unexpected subcommands, JSON fields, and timeout options, then rely on subprocess outcomes instead of positive source-text assertions.

As per path instructions, prefer observable outcomes and flag broad mocks that bypass the behavior under test.

Also applies to: 150-161, 192-227

🤖 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/post-merge-e2e-risk-gate-workflow.test.ts` around lines 43 - 99,
Strengthen runWaitStep and its related tests so the fake gh validates the
expected subcommand and JSON fields, while the fake timeout validates the
required 105-minute option before simulating outcomes. Update scenarios to fail
on unexpected arguments or options, and replace exact wait.run source-text
assertions with subprocess outcome assertions that exercise the workflow
behavior. Apply the same contract-focused changes to the additional test
sections referenced in the review, avoiding broad mocks that bypass the commands
under test.

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.

Nitpick comments:
In `@test/post-merge-e2e-risk-gate-workflow.test.ts`:
- Around line 43-99: Strengthen runWaitStep and its related tests so the fake gh
validates the expected subcommand and JSON fields, while the fake timeout
validates the required 105-minute option before simulating outcomes. Update
scenarios to fail on unexpected arguments or options, and replace exact wait.run
source-text assertions with subprocess outcome assertions that exercise the
workflow behavior. Apply the same contract-focused changes to the additional
test sections referenced in the review, avoiding broad mocks that bypass the
commands under test.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: d31b57fb-5c83-4aa5-a26d-0b2890987597

📥 Commits

Reviewing files that changed from the base of the PR and between 5be42a9 and 9fb3c46.

📒 Files selected for processing (2)
  • .github/workflows/post-merge-e2e-risk-gate-shadow.yaml
  • test/post-merge-e2e-risk-gate-workflow.test.ts

@cv cv added the v0.0.80 label Jul 10, 2026
@cv

cv commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

Automated-review follow-up rationale:

  • Advisor runtime follow-up: The checked-in harness executes the exact YAML wait.run body across repeated-state success, terminal failure, GitHub query failure, timeout, invalid run ID, and unsupported state. A full privileged controller dispatch is restricted to pushes on NVIDIA/NemoClaw main; broadening that trigger for this PR would change the trust boundary. The live-run probes in the PR body validate real gh payloads but are supplemental to, not a substitute for, the checked-in regression tests.
  • CodeRabbit docstring warning: The only new function is a file-local test harness with a descriptive name and no public API contract. Repository Biome/lint, source-shape, and test-size checks all pass; adding API-style documentation to this fixture helper would not improve the changed behavior contract.

@cv
cv enabled auto-merge (squash) July 10, 2026 17:49
@cv
cv disabled auto-merge July 10, 2026 17:49
@cv
cv merged commit ee9eb13 into main Jul 10, 2026
49 of 50 checks passed
@cv
cv deleted the codex/bound-shadow-watch-logs branch July 10, 2026 17:57
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
<!-- markdownlint-disable MD041 -->
## Summary
Replace the post-merge shadow controller's repeated child-job rendering
with bounded status polling. The wait step now logs only child-run state
transitions while preserving failure propagation, evidence collection,
and the 105-minute hard bound.

## Changes
- Poll only the correlated child's `status` and `conclusion` instead of
repeatedly rendering its full job matrix.
- Emit concise transition, query-failure, terminal-failure,
unsupported-state, and timeout diagnostics.
- Add executable workflow tests for duplicate-state suppression,
success, terminal failure, GitHub query failure, and timeout handling.

## 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 changes only internal
post-merge GitHub Actions polling and diagnostics; no user command,
configuration, API, policy, or runtime 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: independent shell and
trust-boundary review confirmed positive numeric run-ID validation,
fixed GitHub status fields, controlled annotation values,
timeout/cancellation separation, and preserved always-run
evidence/finalization behavior
- [ ] 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 --project integration
test/post-merge-e2e-risk-gate-workflow.test.ts` — 11 tests passed; the
exact embedded wait script also returned success for live run
`29110351531` and a concise failure annotation for live run
`29110867027`
- [ ] 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: Carlos Villela <cvillela@nvidia.com>


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

## Summary by CodeRabbit

* **Bug Fixes**
* Improved automated end-to-end validation monitoring, with
deterministic polling of correlated run status/conclusion.
* Added robust handling for invalid run identifiers, query failures,
non-success completions, and explicit timeout reporting.

* **Tests**
* Expanded end-to-end risk gate workflow tests with a local harness that
simulates CLI behavior across success, failure, query-failure, and
timeout scenarios.
* Added assertions to ensure the wait logic avoids unintended commands
and handles timeout exit codes correctly.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@wscurran wscurran added area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure bug-fix PR fixes a bug or regression labels Aug 1, 2026
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 bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants