Repository navigation
fix: accept Key/Keys in chapter descriptions and verify real content in CI - #1561
Open
BenjaminMichaelis wants to merge 2 commits into
Open
BenjaminMichaelis wants to merge 2 commits into
BenjaminMichaelis wants to merge 2 commits into
Conversation
…in CI The 19570 content package writes sitemap.descriptions.json entries with a singular "Key" while the shared SiteMappingDescription type requires "Keys", so ChapterDescriptionService throws and every page 500s (dev outage). - ChapterDescriptionService reads both shapes and reports malformed entries with the file and entry index. - Resolve ChapterDescriptionService and IGuidelinesService at startup so bad content fails the new revision instead of the first page request. - Add a placeholder sitemap.descriptions.json in the package's shape so PR CI exercises the real code path; make chapter metadata tests content-agnostic. - Add ContentPackageContractTests (structural assertions only). - build-and-test restores/builds against the real content package; feed credentials exist only during restore. - Add scripts/smoke-test.sh (health + real pages) and run it after the dev deploy and in the prod deploy.
…hape
PlaceholderShapeTests compares property names and value kinds of
Placeholders/{sitemap,sitemap.descriptions,guidelines}.json against the
content files the build uses. It passes trivially on PR builds (content is
the placeholders) and runs for real in build-and-test on main, where the
content package is restored. Failures report only property names/kinds.
The check immediately found drift: the placeholder sitemap.json lacked
PrimaryKey and LastModified, which the package has. Add them.
3 of 4 tasks
BenjaminMichaelis
added a commit
that referenced
this pull request
Oct 24, 2026
## Summary - Bumps `ToolingPackagesVersion` 1.1.1.19570 -> 1.1.1.19573. - 19570's content package shipped `sitemap.descriptions.json` with the old single-string `"Key"` format, which `SiteMappingDescription` (used by `ChapterDescriptionService` since #1560) cannot deserialize, so dev returned 500. 19573 is built from IntelliTect-dev/EssentialCSharp.Tooling#2606, which converts the file to the `Keys` array format and adds a tooling test that reads the real file. ## Test plan - [x] `dotnet build EssentialCSharp.Web.slnx` - [x] `EssentialCSharp.Web.Tests`: 190 passed - [x] At the tooling commit 19573 was built from (1f77290e), `sitemap.descriptions.json` has 589 `"Keys"` entries and no `"Key"` entries - [ ] Not checked locally: the restored ContentFeedNuget package contents. Please confirm dev serves pages after deploy. Related: #1561 (Key/Keys compatibility and CI check against the real package content) is still open and no longer needed to fix dev once this is deployed.
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.
Why
dev.essentialcsharp.com returns 500 on pages.
ChapterDescriptionServicethrows while loadingChapters/sitemap.descriptions.json: the content package writes{"Key": "..."}per entry, but the sharedSiteMappingDescription(19570, used since #1560) requiresKeys. Deserializing the real 19570 file into that type throwsArgumentNullException ('keys'), so #1560 alone would not recover dev.CI never caught it: tests build with
AccessToNugetFeed=false(placeholders, which had no descriptions file), the only description test used a hand-writtenKeysfixture, the image built with real content is never run, and dev deploy had no smoke test./healthstays green because the service is built lazily on first page request.What changed
ChapterDescriptionServiceaccepts bothKeyandKeys; malformed entries throw anInvalidDataExceptionnaming the file and entry index.Program.csresolvesChapterDescriptionServiceandIGuidelinesServiceat startup so bad content fails the new revision rather than the first page request.sitemap.descriptions.jsonin the package's shape, copied by the csproj, so PR CI exercises the real code path.ContentPackageContractTests(structural assertions only, no content in logs); chapter metadata tests no longer hard-code placeholder wording.build-and-testnow restores/builds withAccessToNugetFeed=true. Feed credentials are written only for the restore and removed before any repo code builds or runs. The job still runs only on push/workflow_dispatch, never for fork PRs.scripts/smoke-test.shrequests/health,/,/hello-world,/guidelines; it now runs after the dev deploy and replaces the/health-only check in the prod deploy (prod already needs dev to succeed).Test plan
dotnet teston placeholders: 199 passeddotnet test --no-buildwith the real 19570 content package files inChapters/andGuidelines/: 199 passedFollow-up (tooling repo)
Tooling should emit
Keys(or change its type) so the sharedSiteMappingDescriptionis actually used; until then theKeyfallback keeps the site up.