Repository navigation
feat(api_v2): import landing's feature-route pages into the estate (#3256) - #3716
Open
IsaiahSama wants to merge 6 commits into
Open
IsaiahSama wants to merge 6 commits into
IsaiahSama wants to merge 6 commits into
Conversation
…3256) The estate snapshot held only landing's .md pages, so the bank holiday calendar, Find an emergency shelter and water outages (-meta.ts routes) had no api_v2 record and dropped out of api_v2-driven category listings, search, the sitemap and GET /catalog. build-seed-data.ts now writes a page for every -meta.ts under apps/landing/src/routes from its META: url, title, description, category, keywords and visibility, with content_slug set to the META url so the import's service_status overlay still applies. Landing renders these pages from their own routes, so the body is a fixed note telling editors only the listing fields are used. META is loaded with require() because tsx runs the script as CommonJS, where top-level await import() fails. The StormReady checklist (.tsx) is left out until #3239 decides what it becomes: an api_v2 row at its url would take precedence over the self-rendered page in landing's catch-all. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Amplify PR previews
Commit:
|
#3256) The render parity test (#3135) renders every seeded page through fromApiV2 and requires the same HTML as its static twin. The three feature-route pages now in the estate carry a note for editors as their body, while their static twins have none, so the HTML differs on purpose: landing serves these pages from their own routes and never renders that body. RENDERED_BY_ROUTE lists them. They skip the HTML comparison but keep the field comparison, and the test fails if a listed page's static twin gains markdown, so the list can't hide a page the catch-all renders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The public chat assistant's api_v2 ingest chunks the body_markdown of every /catalog page, so the editor note in these three bodies would have become a source chat cites to the public, and its claim that only the listing fields are used would have been untrue. With an empty body chat ingests only the title and description, which is what it should get for pages landing renders from code. An empty body also renders the same as each page's static twin, so landing's render parity test passes unchanged and its RENDERED_BY_ROUTE exemption is reverted: the test now checks these pages' HTML too. The seed test also asserts the pages are public; forcing them to draft fails all three cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 of 2 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #3256 (step 1 of the steps comment).
What
api_v2's estate snapshot held only landing's
.mdpages. Landing builds three more pages from code, and none of them had an api_v2 record:/bank-holiday-calendar(work-employment);/health-and-emergency-services/find-an-emergency-shelter;/health-and-emergency-services/water-outages.So they're missing from api_v2-driven category listings today (sandbox), and from search, the sitemap and
GET /catalogonce those stop adding the static registry pages. #3604 lists this as something theAPI_V2_URLswitch-on (alpha-infra#801) waits for.build-seed-data.tsnow writes a page from theMETAin every-meta.tsunderapps/landing/src/routes, andestate.jsongains the three pages (125 → 128).How
Fields. Each page takes from its
META:url,titleanddescription;subcategory ?? category);frontmatter.keywords, which api_v2 search reads from there;public).It has no parent, form or publish date.
content_slugis theMETAurl. That is landing's registry slug for a feature page and theservice_statuskey, so the import's visibility overlay still applies.The body is empty. Landing renders these pages from their own routes, which take precedence over the
$catch-all, so it never shows the body. The public chat assistant's api_v2 ingest (apps/chat/src/ingest/api-v2-source.ts) chunks every/catalogpage's body, though, so any text there becomes a source chat cites. An earlier version of this PR carried an editor note there; review caught it reaching chat, and the decision on the issue changed to an empty body. Chat now ingests only the title and description.require()with one lint-disable comment. tsx runs this script as CommonJS, and top-levelawait import()fails with "Top-level await is currently not supported with the cjs output format". The-meta.tsfiles have only type-only imports.A local
FeatureMetatype. The script copies from landing rather than importing from it, as withNESTED_WITHOUT_URL.Left out: the StormReady checklist (
.tsx).routes/$.tsxdoesv2Page ?? findPage(splat), so an api_v2 row at its url would take precedence over the self-rendered page. It waits on #3239.Landing's render parity test is unchanged.
apps/landing/src/lib/api-v2-render-parity.test.tsx(#3135) requires every seeded page to render the same HTML as its static twin. With an empty body, these three do, so the test now checks them too. (The note version needed an exemption list there; this version reverts it.)Not in this PR
content-source.live.pw.tsexpectsx-content-source: api_v2on every/catalogpage, but onlyroutes/$.tsxsets it.visibility.live.pw.tsexpects a Preview catalog page to 404, but these routes don't read api_v2's visibility. Recorded on api_v2/landing: list tool and feature pages in api_v2 listings, search and sitemap #3256.Checks
On the final version:
seed.test.ts: a new case checks each page's category, parent, form id, visibility,content_slug, keywords and empty body. It failed before the script change, fails when the feature pages are left out of the snapshot, and fails when they're forced todraft. The existing per-page test also seeds a database and serves the three pages under their categories.nx run api_v2:test: 44 files, 1068 tests pass.nx run landing:test: 93 files, 1557 tests pass, with the parity test at its base version.pnpm seed-dataagain changes nothing.On the first version (the note body), not re-run since; CI covers them:
nx run editor_v2:test, which also readsestate.json: 224 files, 2040 tests pass.api_v2:lint,tsc -p apps/api_v2/tsconfig.check.json,api_v2:buildandpnpm exec tsc -bare clean.SEED=trueon a throwaway database.GET /cataloglists all three as public./categories/work-employmentlists the calendar, and/categories/health-and-emergency-serviceslists the other two./search/documentscarries their keywords.GET /pages?url=/bank-holiday-calendarreturns 200.Closesdoesn't take effect on av2-rewritePR, and #3256 stays open for step 2 and the checklist anyway.🤖 Generated with Claude Code