fix(e2e): pin old gateway base fallback#4047
Conversation
📝 WalkthroughWalkthroughThis PR modifies the ChangesDocker base image override for gateway upgrade testing
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
E2E Advisor RecommendationRequired E2E: None Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
|
There was a problem hiding this comment.
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/test-openshell-gateway-upgrade.sh`:
- Around line 176-177: The fallback BASE_IMAGE arg is being appended even when
an explicit non-`latest` BASE_IMAGE was provided because `rewrote_base` is only
set when matching the `:latest` pattern; update the logic that decides to append
(the code around `args+=("--build-arg" "BASE_IMAGE=${base_ref}")` and the
`rewrote_base` flag) to detect any explicit override: either set
`rewrote_base=true` when an explicit BASE_IMAGE build-arg was passed in (or when
`base_ref` was set from user input), or instead check `args` for an existing
`--build-arg` "BASE_IMAGE=" entry before adding the fallback; ensure the log
write to `"$log_file"` remains 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: 41b18465-c8a2-4b9c-800f-c8090c242164
📒 Files selected for processing (1)
test/e2e/test-openshell-gateway-upgrade.sh
| args+=("--build-arg" "BASE_IMAGE=${base_ref}") | ||
| printf 'add build-arg BASE_IMAGE=%s\n' "$base_ref" >>"$log_file" |
There was a problem hiding this comment.
Fallback currently overrides explicit non-latest BASE_IMAGE args.
This add-path is correct only if rewrote_base truly means “a BASE_IMAGE override already exists.” Right now it is set only for the :latest pattern, so an explicit custom BASE_IMAGE=... still gets a second arg appended and overridden by this fallback.
Suggested fix
while [ "$#" -gt 0 ]; do
case "$1" in
--build-arg)
+ if [ "$#" -ge 2 ] && [ "${2#BASE_IMAGE=}" != "$2" ]; then
+ rewrote_base=1
+ fi
if [ "$#" -ge 2 ] && [ "${2#OPENCLAW_VERSION=}" != "$2" ]; then
args+=("--build-arg" "OPENCLAW_VERSION=${old_openclaw}")
rewrote_openclaw=1
printf 'rewrite build-arg %s -> OPENCLAW_VERSION=%s\n' "$2" "$old_openclaw" >>"$log_file"
shift 2
continue
fi
if [ "$#" -ge 2 ] && [ "$2" = "BASE_IMAGE=ghcr.io/nvidia/nemoclaw/sandbox-base:latest" ]; then
args+=("--build-arg" "BASE_IMAGE=${base_ref}")
rewrote_base=1
printf 'rewrite build-arg %s -> BASE_IMAGE=%s\n' "$2" "$base_ref" >>"$log_file"
shift 2
continue
fi
;;
+ --build-arg=BASE_IMAGE=*)
+ rewrote_base=1
+ ;;
--build-arg=OPENCLAW_VERSION=*)
args+=("--build-arg=OPENCLAW_VERSION=${old_openclaw}")
rewrote_openclaw=1
printf 'rewrite build-arg %s -> OPENCLAW_VERSION=%s\n' "$1" "$old_openclaw" >>"$log_file"
shift
continue
;;🤖 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/e2e/test-openshell-gateway-upgrade.sh` around lines 176 - 177, The
fallback BASE_IMAGE arg is being appended even when an explicit non-`latest`
BASE_IMAGE was provided because `rewrote_base` is only set when matching the
`:latest` pattern; update the logic that decides to append (the code around
`args+=("--build-arg" "BASE_IMAGE=${base_ref}")` and the `rewrote_base` flag) to
detect any explicit override: either set `rewrote_base=true` when an explicit
BASE_IMAGE build-arg was passed in (or when `base_ref` was set from user input),
or instead check `args` for an existing `--build-arg` "BASE_IMAGE=" entry before
adding the fallback; ensure the log write to `"$log_file"` remains unchanged.
PR Review AdvisorRecommendation: blocked This is an automated advisory review. A human maintainer must make the final merge decision. Limitations: Review is based on trusted metadata and the provided diff; no commands, package-manager operations, or E2E scripts were executed.; The full file was not re-read beyond the provided diff, so line references are based on trusted review metadata and diff hunk locations.; No linked issues were present; acceptance coverage uses PR body clauses and E2E advisor comment clauses as available acceptance evidence.; The optional openshell-gateway-upgrade-e2e result for this exact head SHA was not provided. Full advisor summaryPR Review AdvisorBase: Small E2E harness fix is plausible, but merge is blocked by mergeStateStatus=BLOCKED, one unresolved review thread, and a likely correctness bug where the new fallback can override explicit non-latest BASE_IMAGE build args. Gate status
🔴 Blockers
🟡 Warnings
🔵 Suggestions
Acceptance coverage
Security review
Test / E2E status
✅ What looks good
Review completeness
|
## Summary - address the unresolved CodeRabbit comment from PR #4047 - mark any explicit `BASE_IMAGE` Docker build arg as present, not just the mutable `:latest` literal - keep the #4047 fallback path for old installers that pass no `BASE_IMAGE` at all ## Why PR #4047 fixed the nightly gateway-upgrade fixture by appending a pinned `BASE_IMAGE` when the old installer omitted one. CodeRabbit correctly noted that `rewrote_base` was only set for the `ghcr.io/nvidia/nemoclaw/sandbox-base:latest` literal, so a caller-provided non-latest `BASE_IMAGE` could receive a second fallback arg and be overridden by Docker last-arg-wins behavior. ## Test plan - `bash -n test/e2e/test-openshell-gateway-upgrade.sh` - `git diff --check` - shell wrapper smoke: verified no-BASE adds pinned fallback, latest rewrites to pinned fallback, explicit custom BASE_IMAGE does not add pinned fallback - `npm run build:cli` - `npm run typecheck:cli` - `npm run test -- test/onboard-openshell-version.test.ts` Follow-up to PR #4047. Resolves CodeRabbit thread: #4047 (comment) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Improved Docker wrapper in test suite to correctly handle pre-specified build arguments, preventing duplicate argument injection and ensuring reliable test execution. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/NVIDIA/NemoClaw/pull/4048?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
Why
The openshell-gateway-upgrade E2E prepares a v0.0.36 install before exercising the current upgrade path. PR #4041 pinned the old OpenClaw version, but if the old installer does not pass
BASE_IMAGE=ghcr.io/nvidia/nemoclaw/sandbox-base:latest, the wrapper only logged that no override was seen and left the old Dockerfile default in place. That allowed the fixture to consume a current base containing OpenClaw 2026.5.18, causing the oldrcf_patch.pyPatch 4 to fail before the upgrade path ran.Test plan
bash -n test/e2e/test-openshell-gateway-upgrade.shgit diff --checknpm run typecheck:clinpm run test -- test/onboard-openshell-version.test.tsFixes the nightly
openshell-gateway-upgrade-e2epreparation failure after PR #4041.Summary by CodeRabbit