test(matrix): deploy-lifecycle block integration tests (move exempt→mapped)#251
Merged
Merged
Conversation
…apped) Close the deploy-lifecycle routes in the done-bar guard's routeCoverageExemptions with real DB-backed integration tests and move them exempt→mapped. USER-FLOW-INVENTORY-AND-TEST-MATRIX.md §D5–D10. New suite: internal/handlers/deploy_lifecycle_block_integration_test.go (testhelpers.SetupTestDB + NewTestAppWithServices, the production RequireAuth chain against a real Postgres; reuses seedInternalDeploy / MustCreateTeamDB / MustSignSessionJWT — no helper redefinition). 12 tests: GET /api/v1/deployments/:id/events — timeline DESC order + cross-team 404 PATCH /deploy/:id/env — merge + secret redaction + cross-team 404 POST /deploy/:id/redeploy — CAS happy 202 + terminal-row 409 PATCH /api/v1/deployments/:id — Pro sets-private 200 + hobby 402 tier-gate POST /api/v1/deployments/:id/make-permanent — happy + cross-team 404 POST /api/v1/deployments/:id/ttl — happy + out-of-range 400 Heavy Kaniko-build legs assert the accepted/contract surface (noop compute), not a live build — deferred to the W4 e2e specs. Guard: 6 deploy-lifecycle routes moved routeCoverageExemptions → routeTestMap (85→91 mapped, 86→80 exempt). GitHub-link rows (:id/github) stay exempt (D17/W6). Both done-bar guards green (TestDoneBar_EveryRouteCovered + TestDoneBar_TestMapPointsAtRealTests). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes the deploy-lifecycle routes in the done-bar guard's
routeCoverageExemptionswith real DB-backed integration tests and movesthem exempt→mapped. Follows #249 (the guard) and #250 (team/member block);
reuses the
../handlersmapped-test-dir scanning #250 introduced.USER-FLOW-INVENTORY-AND-TEST-MATRIX.md (2026-06-04) §D rows D5–D10.
Routes moved (routeCoverageExemptions → routeTestMap)
GET /api/v1/deployments/:id/eventsTestDeployLifecycle_Events_Timeline_OwnerReadsDescOrderPATCH /deploy/:id/envTestDeployLifecycle_UpdateEnv_MergesAndRedactsPOST /deploy/:id/redeployTestDeployLifecycle_Redeploy_HealthyRow_Accepts202PATCH /api/v1/deployments/:idTestDeployLifecycle_Patch_Pro_SetsPrivatePOST /api/v1/deployments/:id/make-permanentTestDeployLifecycle_MakePermanent_HappyPathPOST /api/v1/deployments/:id/ttlTestDeployLifecycle_SetTTL_HappyPathCounts: 85→91 mapped, 86→80 exempt (net 6 moved). The
/api/v1/deployments/:id/githubrows stay exempt (D17 / W6 github-app flow);GET /approve/:tokenstays exempt (no integration cover yet).New suite
internal/handlers/deploy_lifecycle_block_integration_test.go— 12 tests.DB-backed via
testhelpers.SetupTestDB+NewTestAppWithServices(theproduction
RequireAuthchain against a real Postgres). Reuses existinghelpers (
seedInternalDeploy,MustCreateTeamDB,MustSignSessionJWT,models.UpdateDeploymentProviderID) — no helper redefinition.Cross-cutting matrix asks covered: create→accepted (202), status/events read
(timeline DESC), redeploy CAS (healthy→202 / terminal→409), tier-gating
(hobby PATCH private→402 + agent_action), authz/cross-team (404 not 403 on
events / env / make-permanent), bounds (TTL out-of-range→400). Heavy
Kaniko-build legs assert the accepted/contract surface (noop compute), not a
live build — deferred to the W4 e2e specs.
Gates
TestDoneBar_EveryRouteCovered+TestDoneBar_TestMapPointsAtRealTests.internal/handlers+internal/routergreen under
make gate. The only red in the full./...local run is thepre-existing
internal/models/TestLinkGitHubIDUUID-ordering flake (verifiedidentical on clean origin/master with this PR's files stashed) — CI
authoritative.
🤖 Generated with Claude Code