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/8.0] Fix STJ SG regression in handling of property names that are reserved keywords. #98082

Conversation

eiriktsarpalis
Copy link
Member

Backport of #98058 to release/8.0-staging

Customer Impact

Fixes a customer reported issue that was a regression from .NET 7.

A change during .NET 8 development made it so that running the STJ source generator against properties that use reserved C# keywords as identifiers results in uncompilable code. The same inputs compile and run as expected using the .NET 7 source generator.

Testing

Added a regression test covering the scenario in question.

Risk

Low. Makes a small and targeted fix to product code.

@eiriktsarpalis eiriktsarpalis self-assigned this Feb 7, 2024
@eiriktsarpalis eiriktsarpalis added this to the 8.0.x milestone Feb 7, 2024
@ghost
Copy link

ghost commented Feb 7, 2024

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

Issue Details

Backport of #98058 to release/8.0-staging

Customer Impact

Fixes a customer reported issue that was a regression from .NET 7.

A change during .NET 8 development made it so that running the STJ source generator against properties that use reserved C# keywords as identifiers results in uncompilable code. The same inputs compile and run as expected using the .NET 7 source generator.

Testing

Added a regression test covering the scenario in question.

Risk

Low. Makes a small and targeted fix to product code.

Author: eiriktsarpalis
Assignees: eiriktsarpalis
Labels:

area-System.Text.Json

Milestone: 8.0.x

@eiriktsarpalis eiriktsarpalis added Servicing-consider Issue for next servicing release review and removed area-System.Text.Json labels Feb 7, 2024
@tarekgh
Copy link
Member

tarekgh commented Feb 7, 2024

Do you need package authoring?

@ghost
Copy link

ghost commented Feb 7, 2024

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

Issue Details

Backport of #98058 to release/8.0-staging

Customer Impact

Fixes a customer reported issue that was a regression from .NET 7.

A change during .NET 8 development made it so that running the STJ source generator against properties that use reserved C# keywords as identifiers results in uncompilable code. The same inputs compile and run as expected using the .NET 7 source generator.

Testing

Added a regression test covering the scenario in question.

Risk

Low. Makes a small and targeted fix to product code.

Author: eiriktsarpalis
Assignees: eiriktsarpalis
Labels:

Servicing-consider, area-System.Text.Json

Milestone: 8.0.x

@jeffhandley
Copy link
Member

Do you need package authoring?

I saw this question after approving, @eiriktsarpalis. I think @tarekgh is right that we need package authoring updates. Example from a previous backport: https://github.com/dotnet/runtime/pull/94882/files#diff-4ea579c158e463560c7b8e18d2c256f1274dc62db33a4564fc8906dcca7b90bb

@jeffhandley
Copy link
Member

Ah, never mind, @eiriktsarpalis. I see that the release/8.0-staging branch already has this package marked as needing a servicing bump.

<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ServicingVersion>2</ServicingVersion>

@carlossanlop
Copy link
Member

Last month, we shipped a fix for S.T.J.: #95325

So the fact that GeneratePackageOnBuild is currently true is expected. I manually turn off all the OOB packages property on Code Complete day to prevent widespread build failures in PRs, unless we are shipping new bug fixes this month, in which case the GeneratePackageOnBuild property stays as true.

If we are shipping more than one bug fix in the same OOB assembly in the same month, then we only bump the ServicingVersion once for both fixes. In other words, the first PR bumps the version and sets GeneratePackageOnBuild to true (if needed), and the second PR does nothing to these properties.

Hope that clarifies it.

@eiriktsarpalis
Copy link
Member Author

eiriktsarpalis commented Feb 7, 2024

The PR that last incremented the servicing version is this one #96669 which got merged on January 11. Am I right to understand that this PR will be batched with that earlier fix or does the servicing version need to be incremented again?

Copy link
Member

@carlossanlop carlossanlop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the ServicingVersion bump to 3, LGTM.

Thanks for sharing the source of confusion on a call, @eiriktsarpalis. I now see that the current process can beconfusing for folks modifying an OOB package, since the GeneratePackageOnBuild property does not get reset until the Code Complete date of the next month, which could make you think its ServicingVersion has already been bumped on that release month. We need better guidance for that.

@eiriktsarpalis eiriktsarpalis added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Feb 8, 2024
@eiriktsarpalis
Copy link
Member Author

Approved over email.

@eiriktsarpalis eiriktsarpalis merged commit c2415d7 into dotnet:release/8.0-staging Feb 8, 2024
89 of 110 checks passed
@eiriktsarpalis eiriktsarpalis deleted the backport-fix-stj-reservednamedhandling branch February 8, 2024 09:46
@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Text.Json Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants