Skip to content

Proxy legacy pages from Cloudflare Pages instead of Render - #4

Merged
dividedmind merged 2 commits into
mainfrom
legacy-origin-cloudflare-pages
Oct 15, 2026
Merged

dividedmind merged 2 commits into
mainfrom
legacy-origin-cloudflare-pages

Conversation

@dividedmind

Copy link
Copy Markdown
Contributor

The legacy Jekyll site (docs, blog, and not-yet-ported pages) is now deployed at applandinc-github-io.pages.dev as part of migrating off Render onto Cloudflare entirely. Point the worker's legacy fallback origin there.

Verified parity against the Render origin across the paths the worker proxies: identical 220-URL sitemap, byte-identical page bodies apart from build-time timestamps in the schema.org metadata, and a real 404 status on unknown paths, which fetchFromLegacySite relies on to fall through to the app's own 404.

Pages adds trailing-slash and .html normalization that Render did not (/blog -> /blog/, /docs/ -> /docs, /foo.html -> /foo). Every one of those maps to the same string under normalizeLegacyPath, so the existing ping-pong guard follows them internally and serves content rather than bouncing the browser; no redirect is visible on appmap.io. Cost is one extra origin subrequest on those forms.

The Pages project needed JEKYLL_ENV=production set before cutover: its first build omitted the Google Analytics and HubSpot embeds, which sit behind a jekyll.environment conditional.

The legacy Jekyll site (docs, blog, and not-yet-ported pages) is now
deployed at applandinc-github-io.pages.dev as part of migrating off
Render onto Cloudflare entirely. Point the worker's legacy fallback
origin there.

Verified parity against the Render origin across the paths the worker
proxies: identical 220-URL sitemap, byte-identical page bodies apart
from build-time timestamps in the schema.org metadata, and a real 404
status on unknown paths, which fetchFromLegacySite relies on to fall
through to the app's own 404.

Pages adds trailing-slash and .html normalization that Render did not
(/blog -> /blog/, /docs/ -> /docs, /foo.html -> /foo). Every one of
those maps to the same string under normalizeLegacyPath, so the
existing ping-pong guard follows them internally and serves content
rather than bouncing the browser; no redirect is visible on appmap.io.
Cost is one extra origin subrequest on those forms.

The Pages project needed JEKYLL_ENV=production set before cutover: its
first build omitted the Google Analytics and HubSpot embeds, which sit
behind a jekyll.environment conditional.
@dividedmind
dividedmind requested review from kgilpin and a balanced review from Copilot October 15, 2026 13:48
@dividedmind dividedmind self-assigned this Oct 15, 2026

Copilot AI 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.

🟢 Approval recommended

The narrow origin change preserves existing fallback handling, with no blocking issues identified.

0 open findings

What changed in this PR

Moves the worker’s legacy-site fallback from Render to Cloudflare Pages as part of the Cloudflare migration.

Changes:

  • Updates the default legacy origin while preserving existing fallback logic.
  • Revises comments to describe Cloudflare Pages hosting.
File Description
wrangler.jsonc Updates comments documenting the default legacy origin.
src/​server.ts Switches the default origin to Pages and updates related comments.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@dividedmind
dividedmind force-pushed the legacy-origin-cloudflare-pages branch from 65327e3 to e2c731f Compare October 15, 2026 14:10
…o URL

The preview job has never produced a preview URL. It was not failing
either: `wrangler versions upload` uploaded a version fine but printed
no Version URL, the grep for one came up empty, and the "Add preview
URL to summary" step was then skipped by its own `if:` guard. The job
went green with nothing to preview.

Version URLs were the wrong tool anyway. Worker Previews (GA
2026-09-22) give a branch a stable URL that every push updates, with
isolated config, state and observability, where Version URLs only ever
pointed at production resources. Switch the job to `wrangler preview`
and add the `previews` block it requires. The block is empty for now;
it is also where a per-Preview LEGACY_ORIGIN override would go if a
Preview ever needs to point at a branch build of the legacy site.

Unlike environments, "previews" is accepted in the redirected config
nitro writes to .output/server/wrangler.json. The CLI still labels the
command "private beta", but this account has access.

Make the step fail outright when no URL comes back, and drop the `if:`
guard that let an empty value silently skip the summary. A missing
preview URL should be a red job, not a green one, however it comes
about. The URL is read from --json, falling back to scraping the human
output, since the JSON shape is not pinned down yet.

Verified against the resulting Preview: the legacy docs and blog paths
proxy from the Pages origin (confirmed by build timestamp), the .html
and trailing-slash forms resolve to 200 without bouncing the browser,
sitemap-docs.xml matches the Pages sitemap byte for byte, unknown
paths still 404 to the app rather than the legacy site, and the
redirect table is intact.

Assisted-by: Claude:claude-opus-5
@dividedmind
dividedmind force-pushed the legacy-origin-cloudflare-pages branch from e2c731f to 8337124 Compare October 15, 2026 14:16
@dividedmind

Copy link
Copy Markdown
Contributor Author

Note I had to modify CI to make the preview deployment work.

@dividedmind
dividedmind merged commit 320516d into main Oct 15, 2026
1 check passed
@dividedmind
dividedmind deleted the legacy-origin-cloudflare-pages branch October 15, 2026 15:56
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.

3 participants