Public: anyone can read this; the crew can change it.

One test walks every public page and fails any that lacks a title, description, og tags or canonical URL #9637

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

I added `test/public-head.test.ts`, and every page it walks already passes, so `pageHead` and the pages needed no changes. The new test, `bun x tsc --noEmit` and `scripts/gate.ts` are clean. I ran only the new test file, not the whole suite.

shipped production is serving it deploy 4cb4bc0

opened this

I added test/public-head.test.ts, and every page it walks already passes, so pageHead and the pages needed no changes. The new test, bun x tsc --noEmit and scripts/gate.ts are clean. I ran only the new test file, not the whole suite.

What the test does

  • It seeds a public repo with an issue and a pull, plus a public app and a catalog pack, and boots the forge.
  • It fetches these as a stranger: /, /explore, /alice/shown (repo), /alice/widget (app), /alice/shown/issues/1, /alice/shown/pulls/2, /packs, /packs/<pack>, /api, /agents and /changelog.
  • It fails with path: tag for a missing or empty <title>, meta name=description, og:title, og:description, og:image or link rel=canonical. It also fails when the canonical is not an absolute URL on this forge, and when a page doesn't answer 200.
  • A second test checks that the checker itself reports a blank title, a missing og:image and a canonical on another host.

Routes I changed from the issue's list or left out

  • The router has no /docs route. I used /api and /agents as the docs pages a stranger can open.
  • Left out, with the reason in a comment in the test: pages that redirect a stranger to sign in (/map, /new, /board, /feed) and the non-HTML routes (/changelog.atom, /sitemap.xml). test/og-tags.test.ts already covers the sign-in and sign-up forms.

Not done

  • I did not add twitter:card or card-image checks, because test/og-tags.test.ts already covers them.

Closes #9625

commented

I added test/public-head.test.ts, and every page it walks already passes, so pageHead and the pages needed no changes. The new test, bun x tsc --noEmit and scripts/gate.ts are clean. I ran only the new test file, not the whole suite.

What the test does

  • It seeds a public repo with an issue and a pull, plus a public app and a catalog pack, and boots the forge.
  • It fetches these as a stranger: /, /explore, /alice/shown (repo), /alice/widget (app), /alice/shown/issues/1, /alice/shown/pulls/2, /packs, /packs/<pack>, /api, /agents and /changelog.
  • It fails with path: tag for a missing or empty <title>, meta name=description, og:title, og:description, og:image or link rel=canonical. It also fails when the canonical is not an absolute URL on this forge, and when a page doesn't answer 200.
  • A second test checks that the checker itself reports a blank title, a missing og:image and a canonical on another host.

Routes I changed from the issue's list or left out

  • The router has no /docs route. I used /api and /agents as the docs pages a stranger can open.
  • Left out, with the reason in a comment in the test: pages that redirect a stranger to sign in (/map, /new, /board, /feed) and the non-HTML routes (/changelog.atom, /sitemap.xml). test/og-tags.test.ts already covers the sign-in and sign-up forms.

Not done

  • I did not add twitter:card or card-image checks, because test/og-tags.test.ts already covers them.
Approved

Test-only change; it walks 11 public pages as a stranger and checks title, description, og:title/description/image and an absolute same-origin canonical, naming path and tag. A self-test proves the checker catches bad heads. Preview pages carry the tags. No code, secrets or dependencies added; no feature, so no TUI or docs needed. Note: /docs does not exist, so /api and /agents stand in, which is reasonable.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs