Repository navigation
Count inline <CodeSnippet> code in the Snipsync coverage report - #5808
Merged
Merged
Conversation
Quickstart pages show code with the <CodeSnippet> component. Code written into the element as a template literal or plain text wasn't counted, so a quickstart that moved off Snipsync back to inline code left the numbers unchanged. Count it as hand-written code in the element's language. A <CodeSnippet> whose children are a Snipsync block is still read by the fence parser and counts as synced.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📖 Docs PR preview linksThis PR does not change any pages in /docs. If you make updates, links to the modified pages will appear here. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the inline CodeSnippet coverage changes.
No open issues 🎉
What changed in this PR
Extends Snipsync coverage reporting to count inline Quickstart <CodeSnippet> code, making migrations to and from synced samples visible in coverage totals. Supports #5105 and makes the impact of #5803 measurable.
Changes:
- Counts inline
<CodeSnippet>children as hand-written code while preserving synced fence handling. - Adds six tests for extraction, exclusions, and coverage totals.
- Updates utility documentation and the report’s PR-comment footnote.
| File | Description |
|---|---|
readme/UTILITIES.md |
Explains how inline and synced <CodeSnippet> content affects coverage. |
bin/report-snipsync-coverage.test.js |
Adds extraction and coverage tests for <CodeSnippet> elements. |
bin/report-snipsync-coverage.js |
Updates report comments and the generated coverage footnote. |
bin/code-blocks.js |
Extracts inline <CodeSnippet> code and records component metadata. |
Review effort: Balanced
lennessyy
approved these changes
Nov 24, 2026
Duncanma
enabled auto-merge (squash)
November 24, 2026 18:44
This branch was successfully 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 #5105.
What this changes
Quickstart pages show code with the
<CodeSnippet>component (src/components/Quickstart/SetupSteps).yarn report:snipsync-coverageonly read fenced blocks. Code written into the element as a template literal ({`...`}) or plain text was never counted. So if a quickstart moved off Snipsync and back to inline code, the numbers didn't change.bin/code-blocks.jsnow also reads<CodeSnippet>elements:language. The block hascomponent: 'CodeSnippet'.<CodeSnippet>whose children are a Snipsync block is left to the fence parser, so it still counts as synced.<CodeSnippet>inside a fenced block or a comment is ignored, as fenced code there already is.readme/UTILITIES.mdand the report's PR-comment footnote describe the change.Effect on the numbers (
mainat 90db179)The 84 new SDK lines are the three Go files written inline on the Go Standalone Activities quickstart. They're the only SDK-language
<CodeSnippet>elements onmain. #5803 moves them to Snipsync. Measured with this change, that PR takes develop/go from 96.3% to 98.3%, where before it showed only +0.1 points.The all-languages total gains 438 lines from 168 elements: 157
bash, 4xml, 2toml, 1json, 1groovy, and the 3go.Testing
node --test bin/*.test.js: 435 pass, including 6 new cases covering multi-line and one-line children, indentation and escapes, Snipsync children, and elements inside a fence or a comment.<CodeSnippet>indocs/. The parser found all 168 elements with alanguage, none came out empty, and each reported line number matches the first line of code. The extracted XML ondocs/develop/php/set-up.mdxkeeps its indentation.