← Back to Pull requests

fix(readiness): resolve container engine for legacy-cluster gateway inspection #11067

Closed
unknown closed this pull request without merging on Sep 04, 2026 19:23 UTC
View on GitHub
unknown unknown commented on Sep 04, 2026 14:49 UTC
Author

Outcome

Before: observeManagedGateway()'s legacy-cluster check hardcoded "docker" for its three container-inspect calls, regardless of the active runtime provider. On a Podman-selected host with no Docker installed, every call failed with ENOENT, surfacing as an opaque gateway.reuse.ready/gateway.version.compatible/gateway.port.uncontested readiness failure. After: the container engine bound to the active provider's gateway-inspection operation is resolved and used instead, so the check runs against podman when Podman is selected.

Reason

This is the root cause behind #10984: native Podman onboarding (activated by #9923) fails at the gateway readiness step because this specific check never became runtime-aware. The registry needed to fix it already exists — PR #9923 built runtime-provider/registry.ts's gateway-inspection operation and registered it for both docker.ts and podman.ts — gateway-production.ts just wasn't using it for these three calls.

Related issues

Fixes #10984

Changes

  • src/lib/readiness/gateway-production.ts: added resolveGatewayInspectionEngineId(), which resolves the current runtime provider bundle and asks it for the gateway-inspection engine identity ("docker" or "podman"). inspectLegacyCluster() now takes this resolved engine id and uses it for its three inspect calls instead of the literal "docker". Fails closed (skips the check entirely) when no engine or openshell binary can be resolved, rather than guessing a binary. Added containerEngineId as an injectable option on createProductionGatewayReadinessDependencies, matching the existing isLegacyClusterBound/gatewayName injection pattern. Exported inspectLegacyCluster for direct unit testing, matching this file's existing convention (classifyManagedGatewayPortConflict, gatewayProcessIdentityMatchesTrustedBinary, etc. are already exported the same way).

  • src/lib/readiness/gateway-production.test.ts: two new tests — one proving a Podman-selected engine reaches an active legacy-cluster result via podman inspect (not docker), one proving a null engine id skips inspection entirely with zero subprocess calls.
  • Verification

  • npx vitest run src/lib/readiness/gateway-production.test.ts src/lib/readiness/gateway.test.ts — 68 passed (66 existing + 2 new)

  • npm run typecheck:cli — clean

  • npm run test:changed — 161 passed, no regressions
  • <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    Summary by CodeRabbit

    Bug Fixes
    Improved production gateway readiness checks for environments using Podman or other configured container runtimes.
    Legacy cluster inspection now uses the active container engine to verify container state, port bindings, and image details.
    Skips legacy inspection when no container runtime is configured, avoiding incorrect Docker-based checks.
    * Explicitly disabling container-engine inspection now prevents fallback checks through other runtimes.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 385 lines (+288 / -97) across 4 files Reviewer: politerealism Review duration: 274m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 385 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.356
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #11067"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 43% (MEDIUM) · Higher = larger blast radius
    43%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.0% · Safe to merge
    17.0%