Skip to content

fix(deploy): stabilize webhook trigger rollout and URL retries - #185

Merged
LucasSantana-Dev merged 3 commits into
mainfrom
fix/deploy-webhook-trigger-stability
Mar 12, 2026
Merged

LucasSantana-Dev merged 3 commits into
mainfrom
fix/deploy-webhook-trigger-stability

Conversation

@LucasSantana-Dev

@LucasSantana-Dev LucasSantana-Dev commented Mar 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • prevent deploy-trigger self-termination by decoupling nginx startup from webhook
  • make deploy rollout explicit with docker compose up --no-deps for target services
  • normalize and dedupe deploy webhook retry candidates in CI to avoid malformed retry paths
  • document webhook stability behavior and troubleshooting in CI/CD docs and changelog

Changes

  1. fix(deploy): prevent webhook self-termination during rollout
  2. ci(deploy): normalize webhook URL retry candidates
  3. docs(changelog): document webhook trigger hardening

Verification

  • bash -n scripts/deploy.sh scripts/deploy-remote.sh
  • workflow YAML parse (python3 + yaml.safe_load)
  • compose check: nginx.depends_on no longer includes webhook

Notes

  • host-side emergency recovery was executed before this PR (docker compose up -d webhook) and webhook DNS resolution from lucky-nginx was restored.
  • no product/API behavior changes; deploy-path hardening only.

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced deploy webhook retry mechanism with URL normalization to prevent malformed retry paths and improve reliability.
    • Improved service startup sequencing to prevent deployment self-termination and DNS resolution issues.
  • Documentation

    • Added troubleshooting guides for webhook stability and DNS resolution failures in deployment workflows.

@netlify

netlify Bot commented Mar 12, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for regal-bunny-0c8efe ready!

Name Link
🔨 Latest commit 5c9fb80
🔍 Latest deploy log https://app.netlify.com/projects/regal-bunny-0c8efe/deploys/69b310c68f74500008b8593d
😎 Deploy Preview https://deploy-preview-185--regal-bunny-0c8efe.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel

vercel Bot commented Mar 12, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lucky Ready Ready Preview, Comment Mar 12, 2026 7:15pm

Request Review

@coderabbitai

coderabbitai Bot commented Mar 12, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR enhances the deployment webhook retry mechanism by replacing a single-retry path with normalized, multi-candidate retry logic. It removes webhook from nginx startup dependencies and updates the deployment script to use --no-deps during service rollout, preventing self-termination during deploys.

Changes

Cohort / File(s) Summary
Webhook retry mechanism
.github/workflows/deploy.yml, CHANGELOG.md
Replaced single canonical webhook retry path with dynamic multi-candidate normalization. Introduced normalize_webhook_candidates to parse DEPLOY_WEBHOOK_URL into candidates, validates non-empty, and loops through each candidate attempting POST requests. Returns 0 on first 2xx response; exits 1 after all candidates fail with error reporting.
Docker compose and deployment configuration
docker-compose.yml, scripts/deploy.sh
Removed webhook from nginx depends_on list to prevent circular dependencies. Added --no-deps flag to docker_compose invocation during service rollout to avoid automatic startup of dependent services.
Documentation
docs/CI_CD.md
Updated CD workflow narrative to explain normalized, deduplicated webhook candidate derivation and multi-candidate retry with backoff. Added troubleshooting sections for webhook stability, DNS resolution issues, and service dependency management. Clarified canonicalization logic and fallback behaviors.

Sequence Diagram

sequenceDiagram
    participant GA as GitHub Actions
    participant Parser as normalize_webhook_candidates
    participant Webhook as Webhook Service
    participant Log as Deployment Log

    GA->>Parser: Parse DEPLOY_WEBHOOK_URL
    Parser->>Parser: Normalize & deduplicate candidates
    Parser-->>GA: Return candidate list

    loop For each candidate
        GA->>Webhook: POST signed request to candidate
        Webhook-->>GA: Response (2xx or error)
        alt 2xx Response
            GA->>Log: Report success
            GA->>GA: Exit 0
        else Error Response
            GA->>Log: Print candidate + response body
        end
    end

    alt All candidates failed
        GA->>Log: Emit final error
        GA->>GA: Exit 1
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

ci, infra, size/m

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: stabilizing webhook trigger rollout (removing webhook from nginx dependencies) and URL retries (normalizing/deduplicating retry candidates).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/deploy-webhook-trigger-stability
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@sonarqubecloud

Copy link
Copy Markdown

@LucasSantana-Dev
LucasSantana-Dev enabled auto-merge (squash) March 12, 2026 19:15
@sonarqubecloud

Copy link
Copy Markdown

@LucasSantana-Dev
LucasSantana-Dev merged commit 122673c into main Mar 12, 2026
14 of 15 checks passed
@LucasSantana-Dev
LucasSantana-Dev deleted the fix/deploy-webhook-trigger-stability branch March 15, 2026 14:07
LucasSantana-Dev added a commit that referenced this pull request May 13, 2026
* fix(deploy): prevent webhook self-termination during rollout

* ci(deploy): normalize webhook URL retry candidates

* docs(changelog): document webhook trigger hardening

This branch was successfully deployed

1 active deployment
Preview — 5c9fb804 Deployed Mar 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant