fix(runtime): preserve complete XML content - #10125
OskarEichler wants to merge 3 commits into
Conversation
🦋 Changeset detectedLatest commit: 125bd73 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused implementation correctly addresses the parsing defects with appropriate regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Updates XML parsing to preserve segmented content and reject incomplete documents.
Changes:
- Accumulates text and CDATA values.
- Finalizes SAX parsing and validates root presence.
- Adds regression tests and a patch changeset.
| File | Description |
|---|---|
packages/builder-util-runtime/src/xml.ts |
Fixes content accumulation and document validation. |
test/src/xmlTest.ts |
Tests mixed content and malformed XML. |
.changeset/complete-xml-parsing.md |
Records the runtime patch. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@OskarEichler can you please investigate/resolve the |
|
@mmaietta Updated I verified the XML assertion without snapshot-update mode by temporarily making the preceding payload assertion soft and running only |
Summary
Why
SAX may split one element value across text/CDATA events. Keeping only the last event silently truncated content such as release notes. Calling only
write()also skipped end-of-document validation, allowing unclosed XML through.Verification
TEST_FILES=xmlTest corepack pnpm ci:testTEST_FILES=updateUtilTest corepack pnpm ci:test(23 GitHub provider tests)corepack pnpm compilecorepack pnpm ci:validategit diff --checkBreaking changes
Malformed or rootless XML that was previously returned as incomplete data now throws a parsing error.