fix: Normalize terminology in sample updates#1397
Conversation
There was a problem hiding this comment.
Pull request overview
This PR centralizes terminology normalization (e.g., replacing “.NET Aspire” and “app host”) into a shared helper and applies it during data generation to keep samples.json and integration metadata consistent going forward, addressing the regression noted in #1393.
Changes:
- Introduces
normalizeAspireTerminology()and reuses it across generators. - Normalizes sample titles/descriptions/README text/AppHost code during
update-samplesgeneration and makes the script safe to import in tests by guarding themain()entrypoint. - Updates integration description normalization to use the shared helper and adds unit coverage (including asserting existing
samples.jsonhas no deprecated terms).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/frontend/tests/unit/update-samples.vitest.test.ts | Adds unit tests for sample terminology normalization and validates generated samples.json is clean. |
| src/frontend/src/utils/samples.ts | Updates documentation comment to reflect that readmeRaw is terminology-normalized upstream content. |
| src/frontend/scripts/update-samples.ts | Centralizes sample field normalization and guards main() so the module can be imported safely. |
| src/frontend/scripts/update-integrations.ts | Replaces ad-hoc regex normalization with the shared terminology helper. |
| src/frontend/scripts/aspire-terminology.ts | Adds a shared terminology normalizer used by generator scripts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Frontend HTML artifact readyThe latest frontend build uploaded the This comment updates automatically when a new frontend build artifact is uploaded. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: febf329c-97d8-41aa-bd42-43273bc57fe7
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: febf329c-97d8-41aa-bd42-43273bc57fe7
9bbb307 to
ec1ec43
Compare
JamesNK
left a comment
There was a problem hiding this comment.
Review summary
Phase A source checkpoint: microsoft/aspire main at e6388016c6c4b90f47589c15e9714975dc4aebc4 (2026-07-24). Claims: 0 product API/config/CLI claims were introduced, so there are no source verdicts to report.
Phase B: No documentation route or rendered example changed; 0 critical issues and 0 warnings. The docs server was not started because there was no affected page to exercise and the requested review excluded a website build.
The generation-code review found two blocking normalization cases, documented inline.
Phase A - Claim verification
No changed file introduces a factual claim about Aspire APIs, runtime behavior, configuration, CLI surface, or package versions.
Verified and verified-with-nuance claims
None; the changed prose is implementation-local commentary rather than Aspire product documentation.
Phase B - Doc-tester results
Documentation Test Report
Focus Area: PR #1397 changed-file route mapping
Date: 2026-07-24
Tester: doc-tester agent
PR ref: ec1ec43481ddfce284d53cddf6c65859beb613c5
Local server: Not started - no documentation routes were affected.
Summary
| Category | Passed | Failed | Warnings |
|---|---|---|---|
| Content Accuracy | 0 | 0 | 0 |
| Code Examples | 0 | 0 | 0 |
| CLI Commands | 0 | 0 | 0 |
| Links | 0 | 0 | 0 |
Critical Issues
None.
Warnings
None.
Passed Checks
- Changed-file mapping confirmed that the PR only changes generator scripts, a sample utility comment, and unit tests; no rendered documentation page or route is modified.
Recommendations
None for rendered documentation.
Knowledge Gaps
None.
| @@ -0,0 +1,19 @@ | |||
| const horizontalWhitespace = String.raw`[ \t]+`; | |||
| const legacyAspirePattern = String.raw`\.NET${horizontalWhitespace}Aspire`; | |||
There was a problem hiding this comment.
This pattern also matches the .NET Aspire substring inside a longer term. For example, ASP.NET Aspire application becomes ASPAspire application, and Microsoft.NET Aspire becomes MicrosoftAspire. Because this helper runs over arbitrary README and AppHost source text, a future input can be corrupted rather than merely normalized. Please require .NET not to be preceded by a word character and add regression cases for these inputs.
| const legacyAspirePattern = String.raw`\.NET${horizontalWhitespace}Aspire`; | ||
| const legacyAppHostPattern = String.raw`\bapp${horizontalWhitespace}host\b`; | ||
|
|
||
| const aspireWithArticle = new RegExp( |
There was a problem hiding this comment.
The article correction only recognizes unformatted text, but readme and readmeRaw are raw Markdown. A **.NET Aspire** project currently becomes A **Aspire** project, and A [.NET Aspire](https://aspire.dev/) project becomes A [Aspire](https://aspire.dev/) project. That leaves the generated docs grammatically incorrect. Please handle Markdown wrappers/text nodes when correcting the article and cover bold/link cases in the tests.
Summary
samples.json.NET Aspireorapp hostThis fixes the sample-update regression visible in #1393.
Tests
pnpm --dir ./src/frontend exec vitest run --config vitest.config.ts tests/unit/update-samples.vitest.test.ts tests/unit/update-integrations.vitest.test.tssamples.jsoncontent from chore: Update integration data and GitHub stats (7/23/26) #1393 through the normalizer (8 deprecated occurrences reduced to 0)