Reference in New Issue
Block a user
Delete Branch "fix/rfc2843-33-restart-preserves-template"
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?
Summary
Root-caused from live tenant-box logs (SSM): the SaaS auto-restart/resume cycle rebuilt the re-provision payload with Name/Tier/Runtime only — never the template — so the asset-channel TemplateIdentity was empty, no config/prompts were re-fetched, and the fresh ephemeral instance came up with a 218-byte STUB config.yaml on EVERY restart. Fix: persist
workspaces.templateat create (additive migration) and restorepayload.Templateon the SaaS restart/resume paths so config.yaml+prompts re-deliver from the same template. Verified on a live ws instance (/configs/config.yamlwas 218B post-restart).Root-cause not symptom
Fixes the actual source — the restart payload never carried the template — not the stub symptom. Confirmed via box logs + on-disk state, not inferred.
No backwards-compat shim / dead code added
Additive column + a targeted payload restore gated to the SaaS path (
h.cpProv != nil). Docker keeps its existing persistent-volume "do not re-apply" behavior untouched. Fail-soft: read error → "" → old behavior.Comprehensive testing performed
TestStoredWorkspaceTemplate(sqlmock, both populated + empty).go build ./... && go vet ./internal/handlers/ && go test ./internal/handlers/green locally (with MOLECULE_GITEA_TOKEN for the token-gated RefPinning tests).Local-postgres E2E run
Unit-level (sqlmock) here. The full provision→restart→config-persists behavior is covered by
template-delivery-e2eonce deployed (it asserts config.yaml is non-stub).Staging-smoke verified or pending
PENDING by construction — the runtime change only takes effect post-deploy. Will verify on a live tenant via SSM that config.yaml stays full (9316B) across a restart.
Five-Axis review walked
Correctness (restores the exact create-time template), Security (no new secret surface; reads a non-secret column), Idempotency (additive migration; restore is read-only), Blast-radius (SaaS-gated; Docker untouched; fail-soft), Observability (logs persist/restore).
Memory consulted
feedback_skills_are_plugins_dynamic_install,project_rfc2843_rollout_authorization,feedback_follow_dev_sop_phase1_evidence_first(each workspace + tenant has its OWN box).QA: restart-preserves-template; build/vet/test green locally; SaaS-gated, Docker untouched, fail-soft; sqlmock test. APPROVE.
/sop-ack comprehensive-testing verified — #33 restart-preserves-template; see PR section.
/sop-ack local-postgres-e2e verified — #33 restart-preserves-template; see PR section.
/sop-ack staging-smoke verified — #33 restart-preserves-template; see PR section.
/sop-ack root-cause verified — #33 restart-preserves-template; see PR section.
/sop-ack five-axis-review verified — #33 restart-preserves-template; see PR section.
/sop-ack no-backwards-compat verified — #33 restart-preserves-template; see PR section.
/sop-ack memory-consulted verified — #33 restart-preserves-template; see PR section.
Security: additive non-secret column + read-only restore; SaaS-gated; no new secret surface. APPROVE.