Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/7.0] Fix incorrect "illegal XML comment chars" check & add regression tests #74823

Merged
merged 2 commits into from
Aug 30, 2022

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Aug 30, 2022

Backport of #74787 to release/7.0. Resolves #74752.

Customer Impact

As of 7.0, XmlTextWriter can no longer write XML comments which begin with a hyphen ('-') character. This was due to an incorrect optimization in System.Xml introduced in the 7.0 timeframe. We should forbid hyphens at the end of the string, not at the beginning.

This is a regression from 6.0 and Full Framework. Partner teams like F# have had to work around this in their own code bases since it's affecting some of their build scenarios.

Workaround for customers is that if they call XmlWriter.WriteComment, they ensure that the argument does not begin with a hyphen. I don't imagine a hyphened prefix is all that common, but as above, the F# team did run into it. Fortunately they controlled the input and had the ability to strip the hyphen. Other customers might not be able to exercise such control.

Testing

Tested through ad hoc sample applications and increasing unit test coverage. I also compared the outputs against core3.1, 6.0, and netfx481 to validate that we're not morphing the data unexpectedly.

I also went through and double-checked the original PR which introduced the regression, looking for other places where we may have introduced a similar error. That investigation turned up only a single additional suspicious call site, but that call site was already addressed by a previous PR before RC1 snap. The call site addressed by this PR is the only remaining call site.

Risk

Low risk. This changes a single line of code, and I've improved unit test coverage both as a regression test and to ensure that we didn't inadvertently block other legitimate scenarios.

No packaging impact.

@ghost
Copy link

ghost commented Aug 30, 2022

Tagging subscribers to this area: @dotnet/area-system-xml
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #74787 to release/7.0

/cc @GrabYourPitchforks

Customer Impact

Testing

Risk

IMPORTANT: Is this backport for a servicing release? If so and this change touches code that ships in a NuGet package, please make certain that you have added any necessary package authoring and gotten it explicitly reviewed.

Author: github-actions[bot]
Assignees: -
Labels:

area-System.Xml

Milestone: -

@GrabYourPitchforks GrabYourPitchforks added the Servicing-consider Issue for next servicing release review label Aug 30, 2022
@GrabYourPitchforks GrabYourPitchforks added this to the 7.0.0 milestone Aug 30, 2022
@GrabYourPitchforks GrabYourPitchforks self-assigned this Aug 30, 2022
@danmoseley danmoseley removed the Servicing-consider Issue for next servicing release review label Aug 30, 2022
@danmoseley
Copy link
Member

(No servicing label required while in M2 mode as we are in 7.0 still) .. Approved, basic functionality regressed.

@carlossanlop
Copy link
Member

@eiriktsarpalis or @krwq can we get a code review sign off, please?

@GrabYourPitchforks
Copy link
Member

CI failure is tracked by #73688.

@GrabYourPitchforks
Copy link
Member

I'm not authorized to check in to this branch. The great privilege of hitting the merge button falls to somebody else. :)

@carlossanlop
Copy link
Member

The great privilege of hitting the merge button falls to somebody else. :)

I gladly volunteer as tribute. Just waiting for CI to finish.

@carlossanlop
Copy link
Member

Approved and signed-off.
CI failure unrelated and known. #73688
Ready to merge. :shipit:

@carlossanlop carlossanlop merged commit db22ec5 into release/7.0 Aug 30, 2022
@carlossanlop carlossanlop deleted the backport/pr-74787-to-release/7.0 branch August 30, 2022 20:16
@ghost ghost locked as resolved and limited conversation to collaborators Sep 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants