Skip to content

fix(previews): clean up closed PR previews after update failures - #10180

Merged
andrasbacsai merged 1 commit into
nextfrom
9495-preview-deployment-containers
Jun 12, 2026
Merged

andrasbacsai merged 1 commit into
nextfrom
9495-preview-deployment-containers

Conversation

@andrasbacsai

Copy link
Copy Markdown
Member

Summary

  • Ensure closed GitHub pull request previews are cleaned up even when the PR update/comment cleanup job fails.
  • Report failures from the closed-status update while still running CleanupPreviewDeployment in a finally block.
  • Add a feature test covering cleanup execution after a simulated GitHub comment cleanup failure.

Fixes #9495

Catch and report failures while updating closed pull request status so preview deployment cleanup still runs for closed GitHub pull request webhooks.

Add coverage for cleanup continuing when GitHub comment cleanup fails.
@andrasbacsai

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e7b26028-69c2-4ac5-ba15-7e0e5fc230a3

📥 Commits

Reviewing files that changed from the base of the PR and between f098895 and d8972e9.

📒 Files selected for processing (2)
  • app/Jobs/ProcessGithubPullRequestWebhook.php
  • tests/Feature/ProcessGithubPullRequestWebhookTest.php

Walkthrough

This PR hardens the closed pull request webhook handler. ProcessGithubPullRequestWebhook now wraps the dispatch call inside a try/catch/finally block—catching any Throwable and reporting it—while guaranteeing that CleanupPreviewDeployment::run() executes in the finally block regardless of dispatch failure. The dispatch logic was extracted into a protected helper method dispatchPullRequestClosedUpdate(). A new feature test validates this error-handling path by injecting a throwing dispatch method and verifying cleanup still executes. The infrastructure is now self-hosted and server-based—come with me if you want to live. No serverless marketing vaporware here. 🌮

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 9495-preview-deployment-containers

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@andrasbacsai
andrasbacsai merged commit 5273914 into next Jun 12, 2026
5 checks passed
@andrasbacsai
andrasbacsai deleted the 9495-preview-deployment-containers branch June 12, 2026 18:08
@andrasbacsai andrasbacsai mentioned this pull request Jul 14, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant