Skip to content

fix(e2e): repair current lifecycle coverage - #7688

Merged
apurvvkumaria merged 4 commits into
mainfrom
fix/e2e-current-lifecycle-failures
Jul 28, 2026
Merged

fix(e2e): repair current lifecycle coverage#7688
apurvvkumaria merged 4 commits into
mainfrom
fix/e2e-current-lifecycle-failures

Conversation

@sandl99

@sandl99 sandl99 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Repair three current-lifecycle E2E failures from run 30318190116. Dockerfile rebuild fixtures now stage every logical COPY source, current EXDEV coverage keeps checkout source and sandbox base-image resolution coherent, and post-reboot recovery configures the gateway user service before restarting it.

Changes

  • Parse backslash-continued Dockerfile instructions and stage every direct source from multi-source COPY instructions. A regression test protects the missing package-lock.json case while retaining traversal and secret-pattern rejection.
  • Replace PR #7650's current-lifecycle EXDEV environment-only override with source-aware fixture selection. Release coverage retains the v0.0.71 source, image, and module path, while current coverage clones the checkout and validates the managed runtime's canonical OpenClaw module path.
  • Ensure OpenShell and the managed gateway user service are ready before post-reboot onboarding so onboarding writes the service's Docker-driver environment. Remove cleanup-time runtime restoration that overwrote primary failure artifacts, and capture bounded systemd status and journal diagnostics on health timeout.

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: the diff changes internal E2E fixtures, tests, metadata, and failure diagnostics without changing user-facing behavior or a supported product contract.
  • 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: Codex CLI reviewed bc6531f6b across the nine security categories. Result: PASS with no findings; command/path boundaries, secret-pattern rejection, managed-unit ownership guards, artifact redaction, and cleanup behavior remain constrained. The current module path is selected from a two-literal TypeScript union rather than external input.
  • 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: The origin/main...bc6531f6b diff remains limited to internal E2E fixtures, tests, metadata, and diagnostics. The amended test title names the managed OpenClaw module-path contract precisely. No user-facing documentation changes are needed. Biome, focused E2E-support tests, semantic phase coverage, title style, type-checking, hooks, and git diff --check passed.
  • Agent: Codex CLI

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: the original focused E2E-support set passed 48/48; after the E2E-discovered module-path fix, the four affected E2E-support files passed 31/31, the focused fixture passed 2/2 after the writing edit, and semantic phase coverage passed for 115 tests across 73 files.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result: npm test exceeded 10 minutes. Before timeout it reported unrelated environment/base-branch failures and one assertion-text mismatch fixed in ec9f6f0f0; the focused 48-test set then passed. Required CI will provide the broad gate.
  • 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

Summary by CodeRabbit

  • Bug Fixes
    • Improved post-reboot recovery by ensuring the OpenShell gateway CLI is available and the gateway user service is staged when missing.
    • Gateway health failures now surface a diagnostics artifact (including journalctl output) in the error for faster troubleshooting.
    • Improved Dockerfile base COPY parsing by supporting multiline instructions and better validating source tokens.
    • Registry target lifecycle now normalizes lifecycle profile earlier and runs post-reboot recovery prerequisites when applicable.
  • Tests
    • Refactored live OpenClaw plugin EXDEV flows to use resolved runtime fixtures, with stronger version/module-path assertions.
    • Centralized lifecycle “prepare post-reboot” setup and added coverage for the new gateway diagnostics path.
    • Added/updated unit tests for fixture resolution and multiline COPY extraction.
  • Documentation
    • Updated E2E manifest comments to reflect the lifecycle-driven post-reboot behavior.

sandl99 added 2 commits July 28, 2026 09:37
Signed-off-by: San Dang <sdang@nvidia.com>
Signed-off-by: San Dang <sdang@nvidia.com>
@sandl99 sandl99 self-assigned this Jul 28, 2026
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds prepared OpenShell gateway lifecycle handling and diagnostics, introduces typed release/current EXDEV fixtures with dynamic runtime validation, and supports multiline Dockerfile COPY parsing.

Changes

Post-reboot lifecycle handling

Layer / File(s) Summary
Gateway preparation and diagnostics
test/e2e/fixtures/phases/lifecycle.ts
Installs OpenShell when needed, stages the gateway service, caches preparation state, and captures diagnostics after health-check retries fail.
Prepared lifecycle dispatch
test/e2e/fixtures/phases/lifecycle.ts, test/e2e/live/registry-targets.test.ts, test/e2e/manifests/...
Requires preparation before simulation and dispatches recovery preparation before onboarding.
Lifecycle test coverage
test/e2e/support/e2e-phase-lifecycle.test.ts
Shares post-reboot setup across scenarios and verifies diagnostics artifact capture.

EXDEV runtime fixture orchestration

Layer / File(s) Summary
Runtime fixture contract
test/e2e/live/openclaw-plugin-runtime-exdev-fixture.ts, test/e2e/support/openclaw-plugin-runtime-exdev-fixture.test.ts
Defines and tests release/current selectors, source metadata, base-image environments, and module paths.
Fixture-aware plugin build
test/e2e/live/openclaw-plugin-runtime-exdev.test.ts
Selects source-specific images, validates OpenClaw versions, and derives the runtime version.
Deployment and assertions
test/e2e/live/openclaw-plugin-runtime-exdev.test.ts
Propagates resolved fixture values through deployment, runtime assertions, contract metadata, and artifacts.

Dockerfile COPY parsing

Layer / File(s) Summary
Logical COPY instruction parsing
test/e2e/live/rebuild-openclaw-old-base-context.ts, test/e2e/support/rebuild-openclaw-old-base-context.test.ts
Supports continued COPY instructions, validates multiple sources, reports logical line numbers, rejects dangling continuations, and tests extraction.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested labels: area: e2e, bug-fix, v0.0.97

Suggested reviewers: cv

🚥 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 matches the main E2E focus and accurately points to repairing current-lifecycle coverage.
✨ 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 fix/e2e-current-lifecycle-failures

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

@github-code-quality

github-code-quality Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit bc6531f in the fix/e2e-current-life... branch remains at 96%, unchanged from commit b92ef67 in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit bc6531f in the fix/e2e-current-life... branch remains at 80%, unchanged from commit b92ef67 in the main branch.

Show a code coverage summary of the most impacted files.
File main b92ef67 fix/e2e-current-life... bc6531f +/-
src/lib/domain/.../connect-env.ts 97% 89% -8%
src/lib/onboard...der-metadata.ts 100% 100% 0%
src/lib/sandbox...rce-identity.ts 88% 88% 0%

Updated July 28, 2026 05:55 UTC

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings reported

Advisor assessment: No blocking advisor findings reported
Next action: Review the warnings below.
Findings: 0 blockers · 1 warning · 0 suggestions

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-inference, cloud-onboard, security-posture, openclaw-plugin-runtime-exdev, openclaw-plugin-runtime-exdev-release, ubuntu-repo-docker-post-reboot-recovery

1 warning · 0 suggestions

Warnings

Warnings do not block.

PRA-1 Warning — Document the staged gateway-service workaround boundary

  • Location: test/e2e/fixtures/phases/lifecycle.ts:234
  • Category: docs
  • Problem: The new fallback stages a NemoClaw gateway user service when no upstream service exists, but its documentation does not identify the source of that invalid state, why the upstream service cannot be fixed here, or the condition that removes this workaround.
  • Impact: Future changes can retain or expand a test-only service fallback after upstream OpenShell provides the required service, obscuring the ownership and removal boundary.
  • Recommendation: Extend the `preparePostReboot` comment with the absent-service source boundary, the reason this fixture stages the service instead of fixing that source, and a concrete removal condition.
  • Verification: Read `preparePostReboot` and `buildOpenShellGatewayUserServiceStageScript` with the prepare-post-reboot tests to confirm the fallback only stages a marked service when the upstream service is absent.
  • Test coverage: Existing `LifecyclePhaseFixture.preparePostReboot` tests cover absent-service staging and the unprepared-simulation rejection; retain them when documenting the workaround boundary.
  • Evidence: test/e2e/fixtures/phases/lifecycle.ts:234-264 defines the pre-onboarding staged-service fallback. test/e2e/fixtures/phases/lifecycle.ts:56-96 stages a marked service when the upstream service is unavailable. test/e2e/support/e2e-phase-lifecycle.test.ts:125-153 covers staging and rejects an unprepared simulation.

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 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/e2e/live/openclaw-plugin-runtime-exdev.test.ts`:
- Around line 490-499: Update the OPENCLAW_VERSION extraction in the runtime
Dockerfile validation to collect all matching ARG declarations and assert
exactly one occurrence, consistent with the existing BASE_IMAGE and FROM anchor
checks. Continue validating the sole extracted value’s format and
release-fixture version match, and use that same unique value for the runtime
version assertion.

In `@test/e2e/live/registry-targets.test.ts`:
- Around line 106-117: Report the post-reboot preparation phase by calling
progress.phase(...) immediately before lifecycle.preparePostReboot() in the
post-reboot-recovery branch, using the established phase naming conventions.
Also add this phase to the declared E2E phases and any related lifecycle
whitelist/configuration required by the test fixture.
🪄 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: 692cdfac-2ab2-4ec9-b55c-36d1d859edd6

📥 Commits

Reviewing files that changed from the base of the PR and between b92ef67 and ec9f6f0.

📒 Files selected for processing (11)
  • test/e2e/fixtures/phases/lifecycle.ts
  • test/e2e/live/openclaw-plugin-runtime-exdev-env.ts
  • test/e2e/live/openclaw-plugin-runtime-exdev-fixture.ts
  • test/e2e/live/openclaw-plugin-runtime-exdev.test.ts
  • test/e2e/live/rebuild-openclaw-old-base-context.ts
  • test/e2e/live/registry-targets.test.ts
  • test/e2e/manifests/openclaw-nvidia-post-reboot-recovery.yaml
  • test/e2e/support/e2e-phase-lifecycle.test.ts
  • test/e2e/support/openclaw-plugin-runtime-exdev-env.test.ts
  • test/e2e/support/openclaw-plugin-runtime-exdev-fixture.test.ts
  • test/e2e/support/rebuild-openclaw-old-base-context.test.ts
💤 Files with no reviewable changes (2)
  • test/e2e/support/openclaw-plugin-runtime-exdev-env.test.ts
  • test/e2e/live/openclaw-plugin-runtime-exdev-env.ts

Comment thread test/e2e/live/openclaw-plugin-runtime-exdev.test.ts Outdated
Comment thread test/e2e/live/registry-targets.test.ts Outdated
Signed-off-by: San Dang <sdang@nvidia.com>
Signed-off-by: San Dang <sdang@nvidia.com>
@apurvvkumaria
apurvvkumaria merged commit 8a0f36f into main Jul 28, 2026
98 of 100 checks passed
@apurvvkumaria
apurvvkumaria deleted the fix/e2e-current-lifecycle-failures branch July 28, 2026 06:51
@cjagwani cjagwani added v0.0.98 and removed v0.0.97 labels Jul 28, 2026
@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 Jul 29, 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.

5 participants