Skip to content

fix(ttl): reconcile closed pull request namespaces#190

Merged
vigneshrajsb merged 1 commit intomainfrom
codex/ttl-closed-pr-orphan-cleanup
Apr 28, 2026
Merged

fix(ttl): reconcile closed pull request namespaces#190
vigneshrajsb merged 1 commit intomainfrom
codex/ttl-closed-pr-orphan-cleanup

Conversation

@vigneshrajsb
Copy link
Copy Markdown
Contributor

Summary

  • Teach TTL cleanup to treat expired namespaces for non-open pull requests as cleanup targets instead of skipping them.
  • Reuse the existing BuildService.deleteQueue for closed/merged PR teardown so the TTL worker remains a scanner/reconciler and teardown stays in the existing delete path.
  • Preserve the current open-PR TTL behavior that updates labels and posts the inactivity comment.
  • Add focused TTL service tests using neutral dummy repositories and namespace data.

Root cause

TTL cleanup previously only handled expired namespaces tied to open pull requests. If a close webhook or an in-flight deploy race left a closed-PR namespace behind, TTL would load the build and PR, see pullRequest.status !== 'open', and skip it forever.

Validation

  • pnpm test -- src/server/services/__tests__/ttlCleanup.test.ts passed.
  • pnpm test passed: 178 suites, 1605 tests.
  • pnpm run lint passed.
  • pnpm exec prettier --check src/server/services/ttlCleanup.ts src/server/services/__tests__/ttlCleanup.test.ts passed.
  • git diff --check passed.
  • pnpm run ts-check still fails on existing repo-wide type errors outside this change, including stale .next/types route references, script strict-null errors, and unrelated service/model strictness issues. After fixing the optional comment fields in ttlCleanup.ts, the rerun no longer reports ttlCleanup.ts errors.

@vigneshrajsb vigneshrajsb marked this pull request as ready for review April 28, 2026 20:22
@vigneshrajsb vigneshrajsb requested a review from a team as a code owner April 28, 2026 20:22
@vigneshrajsb vigneshrajsb merged commit 91b484c into main Apr 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant