Repository navigation
Harden preview capacity lifecycle state - #350
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6de1127f6b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| self.expire_overdue_previews( | ||
| self.active_prs_with_label(), | ||
| now=utc_now(), | ||
| exclude_pr_numbers={pr.number}, | ||
| ) |
There was a problem hiding this comment.
Make stale-preview expiry best-effort during start
In the pull_request_target start path, this new pre-admission expiry pass makes every label/synchronize start depend on active_prs_with_label(), which ultimately runs gh pr list through CommandRunner.json with check=True. If that GitHub list call has a transient failure, the controller raises before deploying the PR already present in the event payload and before posting the normal failure comment; stale-preview expiry is an optimization, so it should be caught/logged as best-effort rather than aborting all new preview starts during a list API hiccup.
Useful? React with 👍 / 👎.
| "public_route_cleanup_failed", | ||
| "public_route_unhealthy", | ||
| "start_cleanup_failed", |
There was a problem hiding this comment.
Clear cleanup-failed state after retry cleanup
When a PR is already in start_cleanup_failed or public_route_cleanup_failed, adding these values to FAILED_START_STATUSES makes a retry run cleanup_failed_start_preview() and then continue. If that cleanup succeeds but the retry fails before saving a replacement state, such as an envctl import failure, the old cleanup-failed state remains on disk and is still capacity-consuming even though the runtime was just blasted and leases may have been released, so unrelated previews can keep being denied. Clear/save the state after successful retry cleanup before proceeding.
Useful? React with 👍 / 👎.
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.