Skip to content

fix(ci): send X-GitHub-Event on the CDN deploy webhook - #45

Merged
elkaix merged 1 commit into
mainfrom
fix/cdn-webhook-github-event
Aug 8, 2026
Merged

fix(ci): send X-GitHub-Event on the CDN deploy webhook#45
elkaix merged 1 commit into
mainfrom
fix/cdn-webhook-github-event

Conversation

@elkaix

@elkaix elkaix commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Related Issue

No issue — the 0.13.1 release run failed in CI; the problem is described below.

Problem

The Redeploy CDN job of the 0.13.1 release reported success but deployed
nothing, and Verify release consistency then failed after 600s with
cdn=0.13.0 latest=0.13.1, so the release stayed invisible to installed
clients.

Two causes:

  1. Dokploy's extractBranchName reads body.ref only when the request
    carries an X-GitHub-Event (or gitea/gitlab/bitbucket) header. Without it
    the branch resolves to null, the handler answers
    301 {"message":"Branch Not Match"} and no deploy is queued.
  2. 301 is not an error status, so curl --fail did not trip and the job
    exited 0 — the failed deploy read as a successful one.

Verified against the live webhook: the same POST plus
-H 'X-GitHub-Event: push' answers 200 {"message":"Application deployed successfully"}, and https://code.pythinker.com/pythinker-code/latest.json
now serves 0.13.1. The re-run of Verify release consistency on the release
run is green.

What changed

  • Send X-GitHub-Event: push with the Dokploy deploy webhook.
  • Capture the HTTP status and warn on anything that is not 2xx, instead of
    relying on --fail, which cannot see a 301. The job still never fails the
    workflow — verify-cdn-release remains the loud gate.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works. — not testable in the
    repo; verified against the live Dokploy webhook (200 + CDN now at 0.13.1).
  • Ran gen-changesets skill, or this PR needs no changeset. — CI-only
    change, no package bump.
  • Ran gen-docs skill, or this PR needs no doc update.

Summary by CodeRabbit

  • Bug Fixes
    • Improved CDN redeployment reliability by adding automatic retries.
    • Added clearer handling and warnings for unsuccessful webhook responses.
    • Ensured successful redeployments are recognized only for valid 2xx responses.

Dokploy reads the branch from the body only when the request carries an
X-GitHub-Event header; without it the webhook answered 301 "Branch Not
Match" and deployed nothing, so verify-cdn-release failed the 0.13.1
release with a stale CDN. 301 is not an error status, so --fail let the
job pass green: check the status code instead.
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The release workflow now sends the CDN webhook with the required event header and main-branch ref. It captures HTTP status, retries transient failures, accepts only 2xx responses as successful, and warns on other outcomes.

Changes

CDN redeploy workflow

Layer / File(s) Summary
Webhook request and response handling
.github/workflows/release.yml
The CDN webhook request includes explicit event and ref data. The workflow retries transient curl failures, evaluates the HTTP status, and warns when the response is not 2xx.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title uses the valid fix(ci) prefix, imperative mood, and clearly describes the webhook header change within 72 characters.
Description check ✅ Passed The description includes all required sections, explains the failed release and solution, and completes the checklist with relevant justifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

@pkg-pr-new

pkg-pr-new Bot commented Aug 8, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@pythoughts/pythinker-code@b82c079
npx https://pkg.pr.new/@pythoughts/pythinker-code@b82c079

commit: b82c079

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/release.yml:
- Around line 267-271: Update the deployment POST command in the release
workflow to remove curl retry behavior, including --retry, --retry-all-errors,
and --retry-delay, unless the configured WEBHOOK provides an idempotency
guarantee; retain the existing request, timeout, and status handling.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 59fe6226-1542-45d4-b934-23bfe92be085

📥 Commits

Reviewing files that changed from the base of the PR and between ec98e74 and b82c079.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

Comment thread .github/workflows/release.yml
@elkaix

elkaix commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

On the CodeRabbit retry finding: keeping the retries. A repeated POST re-deploys the same main commit, which rebuilds the same image and publishes the same manifest, so a duplicate costs a build slot and changes nothing. The failure this PR fixes is the opposite one — a deploy that never happens leaves the CDN stale and the release invisible, which is what broke 0.13.1. The retry flags also predate this change.

@elkaix
elkaix merged commit 82951c6 into main Aug 8, 2026
13 checks passed
@elkaix
elkaix deleted the fix/cdn-webhook-github-event branch August 8, 2026 18:18
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