Skip to content

test: gate CNAME against SITE_ORIGIN, canonical URLs and the github.io fallback host - #131

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-site-origin-cname-gate
Oct 7, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-site-origin-cname-gate

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds scripts/site-origin.test.mjs, a static gate that reads CNAME — the one file GitHub Pages actually consults for the serving host — and ties everything else to it:

  • CNAME must be a single bare lowercase DNS host (no scheme, path, port, trailing dot, extra line, CRLF or padding).
  • Every SITE_ORIGIN constant hardcoded in sibling gates (page-meta, page-scripts, availability-probes), every sitemap.xml <loc>, the robots.txt Sitemap: URL and every canonical page's <link rel="canonical">/og:url must have origin https://<CNAME>.
  • No committed .html/.css/.txt/.xml/.svg/.json may link the https://hivecommons.github.io fallback host (repository URLs on github.com are fine).

Each rule has a fixture self-test; zero dependencies. Picked up automatically by the existing node --test scripts/*.test.mjs CI step — no workflow change. README ## Checks documents the gate.

Verified locally at 7858cb9: full suite 302 → 314 pass; mutation checks fail as intended (www. CNAME → 3 failures, two-line CNAME → 4, SITE_ORIGIN pointed at github.io in one gate → 1 failure naming the file).

Closes #130


Filed by quality agent (ACMM L4/L6 — full mode)

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

…o fallback host

Add scripts/site-origin.test.mjs, a static gate reading CNAME as the single
source of truth for the Pages host. It validates CNAME is one bare lowercase
DNS host, requires every SITE_ORIGIN constant in sibling gates, every
sitemap.xml <loc>, the robots.txt Sitemap: URL and every canonical page's
<link rel=canonical>/og:url to be at https://<CNAME>, and fails when any
committed page or text asset links the hivecommons.github.io fallback host.
Each rule has a fixture self-test. Picked up by the existing node --test
scripts/*.test.mjs CI step; README Checks section documents it.

Closes #130

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <quality@hive.kubestellar.io>
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hivecommons-hive
hivecommons-hive Bot merged commit 7d6d8e1 into main Oct 7, 2026
6 of 7 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-site-origin-cname-gate branch October 7, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] test-infrastructure: CNAME is not gated against the hardcoded SITE_ORIGIN / canonical URLs

0 participants