fix(AGE-64): make codecolony.online apex serve the landing - #86
Conversation
|
Mention Blocks like a regular teammate with your question or request: @blocks review this pull request Run |
1cce82f to
ffed0b7
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ffed0b7990
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ffed0b7 to
cc93bbb
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cc93bbb973
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
cc93bbb to
17208a2
Compare
|
Code Colony preview deployed for preview-86.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 17208a2f02
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Code Colony preview deployed for preview-86.
|
… .name + status) - attach-pages-domain.sh: parse .name (canonical Pages API field) AND inspect .status before short-circuiting; only treat active/pending/etc. as healthy. Re-attaches if status is unknown/broken. - cd-prod.yml verify step: use curl --fail-with-body, retry 6x with 15s sleep, exit non-zero on persistent 4xx/5xx so a real outage fails the workflow. - Skipped: 'duplicate Slack notification step' \u2014 only one Slack step exists; codex false positive.
ecbbbf9 to
48701af
Compare
|
Code Colony preview deployed for preview-86.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 48701afeaf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if echo "${ERRORS}" | grep -qi "already exists\|already added\|duplicate"; then | ||
| echo "==> Domain '${DOMAIN}' already exists (race or previous run). Treating as success." | ||
| exit 0 |
There was a problem hiding this comment.
Repair unhealthy Pages domains with PATCH before succeeding
When an existing domain is found in an unhealthy state (deactivated/blocked/error), this script falls through to a POST create call and then treats duplicate-name errors as success. That means the unhealthy domain record is never actually retried/revalidated, so the outage mode can persist across deploys even though this step exits 0. Cloudflare Pages exposes a domain PATCH endpoint specifically to retry validation of an existing domain; without using that path, the intended “repair” behavior is skipped.
Useful? React with 👍 / 👎.
| if curl --fail-with-body -sS -o /dev/null \ | ||
| -w 'HTTP %{http_code} (attempt '$attempt')\n' \ | ||
| https://codecolony.online/; then |
There was a problem hiding this comment.
Enforce 2xx in apex check instead of relying on --fail-with-body
This check currently passes on HTTP 3xx responses because curl --fail-with-body only fails for response codes 400 or greater (per curl --manual), so a redirect from codecolony.online will exit 0 on the first attempt. Since the step message and error text describe a 2xx readiness gate, not explicitly validating %{http_code} allows misrouted/incorrect redirects to be reported as healthy deploys.
Useful? React with 👍 / 👎.
Problem
https://codecolony.online/currently returns HTTP 522 because Cloudflare auto-provisioned@andwwwrecords when the zone was added, andalchemy/dns.tsdeliberately skips managing them to avoid 81053 conflicts.Solution (Approach A — Pages custom domain)
Since Alchemy's Cloudflare provider does not expose a Pages resource, we attach
codecolony.onlineas a custom domain to the existing Cloudflare Pages projectcode-colony-landingvia the Cloudflare API.Once attached, Cloudflare automatically:
Changes
scripts/attach-pages-domain.sh: Idempotent bash script that uses the Cloudflare API to attach (or verify) the apex domain to the Pages project..github/workflows/cd-prod.yml: Added a step that runs the script after IAC deploy, plus a verification curl.alchemy/landing.ts: Updated header comment to document the custom-domain approach.alchemy/dns.ts: Updated comment explaining why the apex is not managed by Alchemy DnsRecords, and removed unusedDnsRecordsimport to satisfy lint.Post-merge verification
After this PR merges and
cd-prodruns, verify with:curl -sS -o /dev/null -w 'HTTP %{http_code}\n' https://codecolony.online/Expected:
HTTP 200Note
The fix only takes effect after the next prod deploy (cd-prod workflow run post-merge). The script is idempotent and will skip if the domain is already attached.