Lets the deployment check cope with pages the CMS host has filled

The check after a deploy compared the server's answer with dist byte for byte,
which fails once the host writes current data into the markers. Both sides are
now normalised first (regions, data block, offers, inline prices, site
address); everything else still has to match. The stand-in host no longer
injects the 404 page, like the real one.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-15 17:02:17 +01:00
co-authored by Claude Sonnet 5.5
parent b2cb6351e1
commit d9ff875ade
5 changed files with 207 additions and 2 deletions
+4
View File
@@ -37,6 +37,10 @@ Committing, pushing and deploying a feature branch to test is allowed for the se
`feature/contact-form-cms` carries commit **`d449e76` "TEST ONLY: enable the contact form for the ASF test deploy"**, which sets `contactForm.enabled: true` in `web/src/content/siteContent.ts` so the ASF test host shows the real form. It must not reach `master` (the form stays off in production until Bryan gives an explicit go). Before merging, revert it (`git revert d449e76`, or drop it from the branch) and confirm `enabled` is `false` again. The packages branch is based on the contact-form branch, so the merge order is `contact-form-cms` first, then `asf-packages-cms`. Both merges need Bryan's go.
## The check after a deploy and the host injection
`deploy/verify-deployment.sh` compares what the server sends with the files in `dist`. Once the CMS host injects (packages, banners, prices, JSON-LD price, site address), the pages differ from `dist` by design, so both sides are first normalised with `config/normalizeInjected.ts` (the contents of the CMS regions, the data block, `offers` in structured data, inline prices and the site address are taken out). Everything else must still be equal byte for byte, so an old build or a wrong server config is still caught; the 404 page is not injected and is compared as it is. The preview server can stand in for the host (`node config/previewServer.ts --cms-data=<json>`), which is how the script is tried locally.
## Own address of the test site
The test site stands on its own: in the test build `VITE_SITE_URL` is `https://test.andreaslop.nl`, so canonical, `og:url`, `og:image`, the JSON-LD ids and urls and `sitemap.xml` all point to the test host. A link shared from the test site (WhatsApp, Discord) therefore shows its own picture, not one from production. The production artifact (job `check`) is built without the variable and keeps `https://andreaslop.nl`. `src/lib/siteUrl.ts` only accepts an origin (https, or http on localhost); anything else falls back to production, so a typo cannot move production to another domain. This is a build setting, not TEST ONLY code: nothing has to be reverted before a merge. `robots.txt` on the test host is the nginx one (`Disallow: /`, plus `X-Robots-Tag: noindex`), not `public/robots.txt`, so the test site stays out of search engines. To try it locally: `VITE_SITE_URL=http://localhost:4173 pnpm build`.