Skip to content

fix(trigger-coolify-deploy): retry PR-preview trigger on 2xx not-found body - #14

Merged
Andreas-Garcia merged 2 commits into
mainfrom
fix/preview-not-found-2xx-retry
Sep 15, 2026
Merged

Andreas-Garcia merged 2 commits into
mainfrom
fix/preview-not-found-2xx-retry

Conversation

@Andreas-Garcia

Copy link
Copy Markdown
Member

Summary

PR #253 on the-music-deck-admin hit a new failure after the v4.3.3 exit-22 fix: Deploy API (preview) and Deploy showcase (preview) both failed with ERROR: No deployment_uuid in response: {"deployments":[{"message":"Pull request 253 not found for this resource."...}]} on their very first attempt, despite the trigger loop being designed to retry "not found" responses for up to PREVIEW_NOT_FOUND_TIMEOUT_SECONDS (180s) while Coolify provisions the preview resource.

Root cause

Coolify's deploy-trigger endpoint returned HTTP 200 with the "not found" error embedded in the JSON body (no deployment_uuid), not a non-2xx status. The retry loop in trigger_deploy() only checked http_code to decide whether to break out of the retry loop — a 2xx response broke out immediately regardless of body content, then hard-failed a few lines later when deployment_uuid turned out to be empty.

Fix

The loop's break condition now also requires the response body to actually contain a deployment_uuid, so a 2xx response with an embedded "not found" message falls through to the existing "not found" retry branch instead of exiting the loop.

Test plan

  • No test harness for this action; verified by reading the actual PR #253 job logs that reproduced the exact failure mode this fix addresses.
  • Will re-verify PR #253's Deploy API (preview) / Deploy showcase (preview) checks pass once this is merged and the pin is bumped there.

Andreas-Garcia and others added 2 commits September 15, 2026 19:24
…d body

Coolify's deploy-trigger endpoint can return HTTP 200 with the "not
found" error embedded in the JSON body (no deployment_uuid) instead of
a non-2xx status, while a PR preview resource is still being
provisioned. The retry loop only retried on non-2xx responses, so a
2xx/not-found response broke out of the loop and hard-failed
immediately on the first attempt instead of retrying for up to
PREVIEW_NOT_FOUND_TIMEOUT_SECONDS.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Andreas-Garcia
Andreas-Garcia merged commit 7848d4f into main Sep 15, 2026
1 check passed
@Andreas-Garcia
Andreas-Garcia deleted the fix/preview-not-found-2xx-retry branch September 15, 2026 17:53
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