fix(e2e): pin old gateway base for resolved digests#4077
Conversation
📝 WalkthroughWalkthroughGeneralizes the old docker wrapper's base/pull and BASE_IMAGE build-arg rewrites, injects a pinned OpenClaw install when Dockerfiles contain a min_openclaw_version gate, and improves installer failure diagnostics and post-install log verification for the old NemoClaw installer. ChangesGateway Upgrade Test Hardening
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 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 Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
Selective E2E Results — ❌ Some jobs failedRun: 26301123575
|
PR Review AdvisorRecommendation: blocked This is an automated advisory review. A human maintainer must make the final merge decision. Limitations: I did not execute scripts, tests, Docker builds, package-manager commands, or fetch external artifacts; review is based on trusted metadata, the provided diff, and read-only file inspection.; No linked issues were present, so acceptance mapping is based on PR body clauses and PR comments rather than linked issue clauses.; The exact root causes of prior selective E2E failures require run artifacts/logs that were not included in the provided context.; No selective Full advisor summaryPR Review AdvisorBase: Test-only gateway-upgrade harness change is narrow, but mergeability is blocked and the current diff still appears to contain the v0.0.36 Dockerfile marker mismatch that can fail the old-install fixture. Gate status
🔴 Blockers
🟡 Warnings
🔵 Suggestions
Acceptance coverage
Security review
Test / E2E status
✅ What looks good
Review completeness
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/e2e/test-openshell-gateway-upgrade.sh (1)
563-575: ⚡ Quick winUse fixed-string equality for pinned-version checks.
The pin guard is good, but regex-based equality can still match unexpectedly for version strings. Prefer fixed-string comparisons for deterministic pass/fail behavior.
Proposed adjustment
wrong_old_openclaw="$( - grep -Eo "OpenClaw [0-9]{4}\\.[0-9]+\\.[0-9]+ is current \\(>= ${OLD_OPENCLAW_VERSION}\\)" "$OLD_INSTALL_LOG" 2>/dev/null \ + grep -Eo "OpenClaw [0-9]{4}\\.[0-9]+\\.[0-9]+ is current \\(>= [0-9]{4}\\.[0-9]+\\.[0-9]+\\)" "$OLD_INSTALL_LOG" 2>/dev/null \ | awk '{print $2}' \ - | grep -v "^${OLD_OPENCLAW_VERSION}$" \ + | grep -Fxv "$OLD_OPENCLAW_VERSION" \ | head -n 1 || true )" @@ - if ! grep -q "OpenClaw ${OLD_OPENCLAW_VERSION}\\|openclaw@${OLD_OPENCLAW_VERSION}" "$OLD_INSTALL_LOG" 2>/dev/null; then + if ! grep -Fq "OpenClaw ${OLD_OPENCLAW_VERSION}" "$OLD_INSTALL_LOG" 2>/dev/null \ + && ! grep -Fq "openclaw@${OLD_OPENCLAW_VERSION}" "$OLD_INSTALL_LOG" 2>/dev/null; then fail "old ${OLD_NEMOCLAW_REF} fixture did not show pinned OpenClaw ${OLD_OPENCLAW_VERSION}" fi🤖 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 563 - 575, The pinned-version checks should use fixed-string exact matches instead of regex: in the wrong_old_openclaw pipeline (variable wrong_old_openclaw using OLD_INSTALL_LOG and OLD_OPENCLAW_VERSION) replace the regex-based exclusion grep -v "^${OLD_OPENCLAW_VERSION}$" with a fixed-string exact exclude (e.g., grep -F -x -v) so the version comparison is literal, and change the final presence check that currently uses grep -q "OpenClaw ${OLD_OPENCLAW_VERSION}\|openclaw@${OLD_OPENCLAW_VERSION}" to a fixed-strings check (e.g., grep -F -q -e "OpenClaw ${OLD_OPENCLAW_VERSION}" -e "openclaw@${OLD_OPENCLAW_VERSION}") to ensure deterministic equality matching.
🤖 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/e2e/test-openshell-gateway-upgrade.sh`:
- Around line 563-575: The pinned-version checks should use fixed-string exact
matches instead of regex: in the wrong_old_openclaw pipeline (variable
wrong_old_openclaw using OLD_INSTALL_LOG and OLD_OPENCLAW_VERSION) replace the
regex-based exclusion grep -v "^${OLD_OPENCLAW_VERSION}$" with a fixed-string
exact exclude (e.g., grep -F -x -v) so the version comparison is literal, and
change the final presence check that currently uses grep -q "OpenClaw
${OLD_OPENCLAW_VERSION}\|openclaw@${OLD_OPENCLAW_VERSION}" to a fixed-strings
check (e.g., grep -F -q -e "OpenClaw ${OLD_OPENCLAW_VERSION}" -e
"openclaw@${OLD_OPENCLAW_VERSION}") to ensure deterministic equality matching.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 518b73b2-556a-45de-93a7-ce4976e9ae02
📒 Files selected for processing (1)
test/e2e/test-openshell-gateway-upgrade.sh
Selective E2E Results — ❌ Some jobs failedRun: 26301551200
|
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 239-249: The injection fails because the marker string assigned to
marker ("MIN_VER=$(grep -m 1 'min_openclaw_version'") doesn't match the actual
Dockerfile line which uses OPENCLAW_MIN_VERSION; update the marker value in
test/e2e/test-openshell-gateway-upgrade.sh to match the real substring (e.g.
"OPENCLAW_MIN_VERSION=$(grep -m 1 'min_openclaw_version'") or make the check
more robust by searching for "min_openclaw_version" only, then keep the existing
injection/insertion logic (variables marker, injection, text.replace) so the old
OpenClaw install block is correctly inserted instead of raising the SystemExit.
🪄 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: 38e91855-fc6a-4c2e-bd1e-35547e5077d1
📒 Files selected for processing (1)
test/e2e/test-openshell-gateway-upgrade.sh
Selective E2E Results — ❌ Some jobs failedRun: 26301970629
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
test/e2e/test-openshell-gateway-upgrade.sh (1)
615-633:⚠️ Potential issue | 🟠 Major | ⚡ Quick winCover the Dockerfile's
upgrading to ...branch in the guard.This check only fails on the
OpenClaw X is currentlog path. If the old fixture logsBase image has OpenClaw X, upgrading to Y (minimum required), the injectedopenclaw@${OLD_OPENCLAW_VERSION}lines still satisfy the later presence check, so the test can pass after consuming a newer OpenClaw than the pin.🛠️ Suggested fix
- local wrong_old_openclaw - wrong_old_openclaw="$( - grep -Eo "OpenClaw [0-9]{4}\\.[0-9]+\\.[0-9]+ is current \\(>= ${OLD_OPENCLAW_VERSION}\\)" "$OLD_INSTALL_LOG" 2>/dev/null \ - | awk '{print $2}' \ - | grep -v "^${OLD_OPENCLAW_VERSION}$" \ - | head -n 1 || true - )" - if [ -n "$wrong_old_openclaw" ]; then - fail "old ${OLD_NEMOCLAW_REF} fixture used OpenClaw ${wrong_old_openclaw} instead of pinned ${OLD_OPENCLAW_VERSION}" + local selected_old_openclaw + selected_old_openclaw="$( + { + grep -Eo "OpenClaw [0-9]{4}\\.[0-9]+\\.[0-9]+ is current \\(>= [0-9]{4}\\.[0-9]+\\.[0-9]+\\)" "$OLD_INSTALL_LOG" 2>/dev/null \ + | awk '{print $2}' || true + grep -Eo "upgrading to [0-9]{4}\\.[0-9]+\\.[0-9]+ \\(minimum required\\)" "$OLD_INSTALL_LOG" 2>/dev/null \ + | awk '{print $3}' || true + } | tail -n 1 + )" + if [ -n "$selected_old_openclaw" ] && [ "$selected_old_openclaw" != "$OLD_OPENCLAW_VERSION" ]; then + fail "old ${OLD_NEMOCLAW_REF} fixture used OpenClaw ${selected_old_openclaw} instead of pinned ${OLD_OPENCLAW_VERSION}" fi🤖 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 615 - 633, The current wrong_old_openclaw detection only considers the "OpenClaw X is current" log line and misses the "Base image has OpenClaw X, upgrading to Y (minimum required)" branch; update the command that sets wrong_old_openclaw (which reads from OLD_INSTALL_LOG) to also grep and extract the base-image version from the "Base image has OpenClaw ... , upgrading to ..." message (in addition to the existing "OpenClaw X is current" pattern), then continue to filter out the pinned OLD_OPENCLAW_VERSION and fail if a different older base image version is found; keep references to wrong_old_openclaw, OLD_INSTALL_LOG and OLD_OPENCLAW_VERSION so the change is localized.
🤖 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.
Outside diff comments:
In `@test/e2e/test-openshell-gateway-upgrade.sh`:
- Around line 615-633: The current wrong_old_openclaw detection only considers
the "OpenClaw X is current" log line and misses the "Base image has OpenClaw X,
upgrading to Y (minimum required)" branch; update the command that sets
wrong_old_openclaw (which reads from OLD_INSTALL_LOG) to also grep and extract
the base-image version from the "Base image has OpenClaw ... , upgrading to ..."
message (in addition to the existing "OpenClaw X is current" pattern), then
continue to filter out the pinned OLD_OPENCLAW_VERSION and fail if a different
older base image version is found; keep references to wrong_old_openclaw,
OLD_INSTALL_LOG and OLD_OPENCLAW_VERSION so the change is localized.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 04586233-67c3-46ca-8720-2cad2267b2c7
📒 Files selected for processing (1)
test/e2e/test-openshell-gateway-upgrade.sh
Selective E2E Results — ✅ All requested jobs passedRun: 26302400688
|
Summary
BASE_IMAGE=*build arg, including resolved sandbox-base digests2026.4.24Why
The full nightly showed
openshell-gateway-upgrade-e2efailing before upgrade validation: the old v0.0.36 install received a resolved current sandbox-base digest containing OpenClaw 2026.5.18. Because the old Dockerfile treats 2026.4.24 as a minimum, it skipped installing the intended OpenClaw and then the old source-shape patch failed.Test plan
bash -n test/e2e/test-openshell-gateway-upgrade.shgit diff --checkE2E / Nightlywithjobs=openshell-gateway-upgrade-e2eagainst this PR headSummary by CodeRabbit
Note: This release contains no user-visible changes.