Skip to content

test: keep placeholder content in the content package's shape - #1737

Merged
BenjaminMichaelis merged 2 commits into
mainfrom
fix/chapter-descriptions-schema-and-content-checks
Nov 28, 2026
Merged

BenjaminMichaelis merged 2 commits into
mainfrom
fix/chapter-descriptions-schema-and-content-checks

Conversation

@BenjaminMichaelis

Copy link
Copy Markdown
Member

Why

The dev outage came from sitemap.descriptions.json changing shape (Key vs Keys), and the placeholders that PR builds use did not model that file at all, so CI could not notice.

What changed

  • Add Placeholders/sitemap.descriptions.json in the shape the content package now ships (Keys + Value, matching SiteMappingDescription) and copy it into Chapters/ for placeholder builds.
  • Bring Placeholders/sitemap.json in line with SiteMapping (PrimaryKey, LastModified).
  • Add PlaceholderShapeTests, which compares each placeholder's JSON property names and value kinds with the content files the app loads. Built against the real content package (-p:AccessToNugetFeed=true) it fails when the package changes shape; failures print property names only, so no book content reaches a public log.

Relation to earlier work

This is the remaining part of #1561, which was closed in favour of #1734 (startup check). Not included: the Key/Keys reader fallback (tooling ships Keys), the smoke-test script (main runs the Playwright Deployed smoke tests), and a real-package restore in CI, which should be reviewed on its own. Until that exists, PlaceholderShapeTests compares the placeholders with themselves in CI.

Test plan

  • EssentialCSharp.Web.Tests: 351 passed; 2 failures (CaptchaService_Verify_Success, KnownBreachedPassword_IsDetected) call external services and are unrelated.
  • Parser.Shared.dll from package 19663 declares SiteMappingDescription { Keys, Value } and SiteMapping with PrimaryKey and LastModified, matching the placeholders.
  • Not run against the real content files (no feed credentials available).

Add the sitemap.descriptions.json placeholder (Keys/Value, matching SiteMappingDescription), bring the sitemap.json placeholder in line with SiteMapping (PrimaryKey, LastModified), and add a test that compares each placeholder's JSON shape with the content files the app loads. Built against the real content package the test fails when the package changes shape; without it the placeholders are compared with themselves.
@BenjaminMichaelis
BenjaminMichaelis merged commit c634b77 into main Nov 28, 2026
35 checks passed
@BenjaminMichaelis
BenjaminMichaelis deleted the fix/chapter-descriptions-schema-and-content-checks branch November 28, 2026 21:41
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.

2 participants