Skip to content

feat(trigger-coolify-deploy): cancel stale deploys and alert on failure - #15

Merged
Andreas-Garcia merged 3 commits into
mainfrom
feature/coolify-deploy-stale-cancel-and-alert
Oct 7, 2026
Merged

Andreas-Garcia merged 3 commits into
mainfrom
feature/coolify-deploy-stale-cancel-and-alert

Conversation

@Andreas-Garcia

Copy link
Copy Markdown
Member

Summary

A Coolify deployment whose job dies mid-run stays queued/in_progress forever. Coolify runs one deployment per app, so every later trigger is silently dropped and the poll 404s until timeout. This happened on staging (stuck worker deploy, ~hours of stale code) and nothing alerted, because a failed deploy step is only a red run on GitHub.

Changes

  • trigger-coolify-deploy: before triggering, list the app's deployments (filtered to this PR / the main app) and cancel any queued/in_progress one older than poll_timeout_seconds.
  • New optional discord_webhook_url input: posts a Discord embed (app, env, repo@ref, sha, run link) when the action fails. Backwards-compatible: empty by default.
  • tests/stale_deployment_filter.sh: regression test for the jq filter (both timestamp formats, PR scoping, status filtering), wired into test-actions.yml.
  • README inputs table and CHANGELOG [Unreleased]; README poll_timeout_seconds default corrected from 900 to 1800.

Test plan

  • bash tests/stale_deployment_filter.sh and tests/deployment_uuid_format.sh pass locally
  • CI test-actions
  • Consumers opt in by passing discord_webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}

🤖 Generated with Claude Code

Andreas-Garcia and others added 2 commits October 8, 2026 01:38
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 23:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Use the active-deployments endpoint instead of the paginated per-app
history, a dedicated stale_deployment_after_seconds threshold above the
poll timeout, a null-safe timestamp parse, SSH force-stop of stale
in-progress builds, and alert on cancelled jobs too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 23:48
@Andreas-Garcia
Andreas-Garcia merged commit aa42a30 into main Oct 7, 2026
1 of 2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@Andreas-Garcia
Andreas-Garcia deleted the feature/coolify-deploy-stale-cancel-and-alert branch October 8, 2026 02:12
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.

2 participants