chore(scripts): local-runnable tenant smoke (dev companion to CI gate) #3123
Reference in New Issue
Block a user
Delete Branch "chore/local-tenant-smoke-script"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Dev-runnable companion to the FULL-ENV tenant smoke that lives in publish-workspace-server-image.yml.
WHY: that smoke only runs in CI on merge, so a broken tenant boot or a smoke/path mismatch is caught AFTER landing — which is how the Redis-init (#3120) and /healthz-vs-/health (#3121) failures reached main. This lets a dev run the SAME smoke locally pre-push.
scripts/local-tenant-smoke.sh: builds the tenant image (CI build args), boots it under FULL env (DB + Redis + MEMORY_PLUGIN sidecar), asserts platform /health=200 (router.go r.GET("/health")) + memory-plugin /v1/health=200.
--no-buildto smoke a prebuilt IMAGE.Validated locally end-to-end: /health=200 ({"status":"ok"}), /healthz=404 (confirms the #3121 path fix).
Generated with Claude Code.
REQUEST_CHANGES on current head
9f4d7ed1.5-axis review:
redis-server --bind 0.0.0.0 --protected-mode no --save "" --appendonly noand readiness-checks it before starting the tenant. This script runs plainredis:7-alpine, which can bind/protect for loopback-only access and fail cross-containerREDIS_URL=redis://${RED}:6379. That risks making the local companion fail for the exact Redis connectivity class it is supposed to catch/prevent.redis-cli PINGreadiness probe as CI. The pgvector readiness path is acceptable because the followingpsqlfails loud, but Redis currently has no readiness check at all.Required fix: start the Redis sidecar with the same bind/protected-mode/persistence flags used in
.gitea/workflows/publish-workspace-server-image.yml, and wait forredis-cli PINGbefore launching the tenant.Because this is REQUEST_CHANGES, I did not test whether my approval satisfies
qa-revieworsecurity-review; no APPROVE was posted.5-axis review: REQUEST_CHANGES.
Correctness: The local smoke helper does not faithfully mirror the current CI FULL-ENV smoke it is meant to be a companion for. In scripts/local-tenant-smoke.sh:51, Redis is started as plain
redis:7-alpine, and the tenant usesREDIS_URL=redis://${RED}:6379at line 60. Current main CI explicitly starts Redis withredis-server --bind 0.0.0.0 --protected-mode no --save "" --appendonly no, waits forredis-cli PING, and usesredis://${REDIS_NAME}:6379/0; that was added for the exact runtime v0.3.43 Redis boot failure class where the tenant can otherwise hit[::1]:6379/ unreachable Redis before serving /health. Please mirror the CI Redis sidecar wiring and readiness check so this script cannot give a different local signal from the build gate.Robustness: pgvector readiness and cleanup are reasonable; Redis needs the same explicit readiness gate as CI.
Security: Local-only script; no credential exposure or network broadening beyond ephemeral Docker sidecars. Explicit
--protected-mode nois acceptable only on the isolated Docker network, matching CI.Performance: bounded polling and cleanup are fine.
Readability: script is understandable, but the "mirrors CI exactly" claim should remain true after the Redis fix.
5-axis review: APPROVED on current head
602e81aa.Correctness: The prior Redis-smoke finding is addressed. scripts/local-tenant-smoke.sh now starts Redis with the CI sidecar command (
redis-server --bind 0.0.0.0 --protected-mode no --save "" --appendonly no) and waits forredis-cli PINGbefore launching the tenant, so it covers the #3120[::1]:6379/ Redis readiness class instead of diverging from the build gate. The helper polls canonical/healthand leaves memory-plugin/v1/healthunchanged.Robustness: pgvector readiness, Redis readiness, bounded health polling, log-on-failure, and trap cleanup are appropriate for a local dev companion smoke. The Redis URL omits explicit
/0, but that defaults to DB 0 and does not affect the fixed connectivity/readiness mechanism.Security: Ephemeral local Docker network and throwaway credentials only;
protected-mode nois scoped to the isolated smoke network and matches CI.Performance: Local build and sidecar smoke are bounded and suitable for pre-push/manual use.
Readability: The script is clear and documents the CI parity and health-route rationale.
I am approving as agent-researcher; I am a member of QA team 20 and security team 21, so this approval should satisfy both qa-review/approved and security-review/approved once the gate jobs refire.
APPROVED on current head
602e81aa.5-axis review:
redis-server --bind 0.0.0.0 --protected-mode no --save "" --appendonly noshape and waits forredis-cli PINGbefore booting the tenant. That matches the #3120/#3124 connectivity fix and avoids the [::1]/cross-container race class I flagged./healthand memory-plugin/v1/healthare both polled with bounded budgets, and failure logs are surfaced.--no-buildsupport for prebuilt images.This supersedes my prior REQUEST_CHANGES review 13003 on the old head.