Repository navigation
fix(deletes): keep deployments behind custom domains during retention - #14663
Conversation
Retention deleted every non-active deployment past its window, and deleting a deployment deletes the rules pointing at it. A custom domain pinned to a branch points at that branch's latest build, which is rarely the active deployment, so retention removed the user's domain along with the build. Previews still expire with their deployment; only manual rules protect one.
|
Review complete. No issues found — approved ✅. This PR extends the project-deletion cleanup worker so that deployments past their retention window are removed, while deployments still referenced by custom-domain rules (manual trigger) and each resource's active deployment are preserved and excluded from deletion via a
Reviewed commit: 9544e45 |
🟢 Tier S · Ready to merge
Deployment retention now preserves both active deployments and deployments referenced by manual proxy rules, including branch-pinned custom domains. An E2E regression test ages a pinned branch build and an unrelated build, then verifies that maintenance removes only the unrelated one.
📂 Walkthrough · 2
Reviewed |
Security rulesNo new WARNING or ERROR findings from security rules. 19 existing findings tracked in
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
Workers are covered by e2e, not unit tests. The Gitea suite can pin a custom domain to a branch build that is not the active deployment, which is the state retention used to break.
|
@hansi-codes review |
Deployment retention deletes every non-active deployment past the window, and deleting a deployment deletes the rules pointing at it. A custom domain pinned to a branch serves that branch's latest build, usually not the active deployment, so retention took the domain down with it.
Kept: the active deployment and any deployment a
trigger = manualrule points at. Previews (per-deployment, branch, commit) still expire with their deployment.Test:
VCSGiteaConsoleClientTest::testDeploymentRetentionKeepsTheBuildBehindABranchDomainpins a custom domain tomain, buildsmainwithout activating (the domain moves to that build), buildsfeature, time-travels both, runs maintenance: thefeaturebuild goes, the domain's build and the domain stay. Red without the fix: #14664.