Commit 82951c6
authored
fix(ci): send X-GitHub-Event on the CDN deploy webhook (#45)
## 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
- [x] I have read the CONTRIBUTING document.
- [x] I have linked a related issue, or explained the problem above.
- [x] 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).
- [x] Ran `gen-changesets` skill, or this PR needs no changeset. —
CI-only
change, no package bump.
- [x] Ran `gen-docs` skill, or this PR needs no doc update.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## 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.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent ec98e74 commit 82951c6
1 file changed
Lines changed: 16 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
254 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
255 | 261 | | |
256 | 262 | | |
257 | 263 | | |
258 | 264 | | |
259 | 265 | | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
| 266 | + | |
| 267 | + | |
264 | 268 | | |
| 269 | + | |
265 | 270 | | |
266 | | - | |
267 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
268 | 276 | | |
269 | 277 | | |
270 | 278 | | |
| |||
0 commit comments