TESTING / RELEASE CORE · 124
Deploy 後:Smoke Test、Observability、Rollback、Release Evidence
Deploy command 成功只代表平台接受了 artifact;真正 release 必須驗證 production 能服務關鍵頁面/API,並留下 commit、workflow run、deployment version、smoke evidence 與 rollback 路徑。
Learning outcomes
- 能設計 production smoke。
- 能區分 deploy success 與 service success。
- 能建立 release evidence chain。
- 能決定 rollback vs forward fix。
1. Deploy success 不等於 user success
artifact upload PASS
platform deploy PASS
↓
still need:
DNS/routing
static assets
API endpoints
auth/data dependencies
critical user flow2. Smoke test
GET /
expect 200 + marker
GET /exercises
expect 200 + marker
GET /incident-lab
expect 200 + marker
GET /api/lab/health
expect 200 + body
GET /api/lab/status/404
expect intentional 404Smoke 不是完整 regression suite,而是快速證明 deployment 的核心 contract 還活著。
3. 本站 production workflow 已實作 smoke
目前 Deploy Production 在 Wrangler deploy 後真的對公開 workers.dev URL 送 HTTP request,並驗 status/content。之前甚至抓到 extensionless static route 的 404,證明 smoke 是有效 gate,不是裝飾。
4. Release evidence chain
Git commit SHA
↓
GitHub Actions run
↓
Build artifact
↓
Cloudflare deployment version
↓
Production URL
↓
Smoke PASS這讓你可以回答「現在 production 到底是哪份 code」。
5. Observability
Smoke 只看部署當下。持續 production 還需要 error rate、latency、logs、request id、service health 等 evidence。
6. Rollback vs forward fix
Rollback
新版本造成重大 user impact,先恢復已知可用版本。
Forward fix
影響小、修復明確且 rollback 成本更高時,可直接補修。
Incident 期間優先恢復服務,再做完整 root-cause analysis。
Project checkpoint:Release checklist
1. CI all green
2. identify commit SHA
3. deploy artifact
4. capture deployment version
5. production smoke
6. observe errors/latency
7. record outcome
8. rollback if neededDebug evidence:Smoke fail
先分 status mismatch、content mismatch、API response mismatch、routing/redirect,再判斷是否需要 rollback。不要只看到 curl exit code 就猜原因。
Knowledge check
- Deploy PASS 為何不代表 production PASS?
- Smoke 和 full E2E suite 差在哪?
- Release evidence chain 至少要包含哪些 ID?
- 什麼情況優先 rollback?