-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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] Make config binding gen incremental (#89587) #92730
[release/8.0] Make config binding gen incremental (#89587) #92730
Conversation
* Make config binding gen incremental * Iterate on implementation * Add incremental tests & driver * Make incremental tests pass and revert functional regression * Address failing tests * Make tests pass * Suppress diagnostic * Address feedback on diag info creation * Refactor member access expr parsing to indicate assumptions * Address feedback & do misc clean up * Adjust model to minimize baseline diff / misc clean up
Tagging subscribers to this area: @dotnet/area-extensions-configuration Issue DetailsBackport of #89587 to release/8.0. Customer ImpactThis change ensures that during IDE development, after emitting source to honor an initial trigger, the generator won’t re-emit code given subsequent edits (i.e every keystroke) that do not change the effective input to the generator. This is important for large solutions (numerous projects and/or source files) that have code that would trigger the generator to participate in compilation. See sample code that showcase scenarios where customers would observe this impact. TestingNew tests theoretically prove that given the same effective input, the generator produces the same parsed model which prevents regeneration. A variety of sanity check and core scenario validation tests have been added to verify that we regenerate source only when needed. There are no regressions to existing unit and functional tests. Planned, but considered a “goodness” effortWe could do with real world simulation tests for the “large solution” scenario mentioned above. This is in progress and we’ll backport a test-only PR when complete. We shouldn’t block on this given other 8.0 work and the confidence we have given other tests. Any gaps we find would only require a minimal, incremental code fix. RiskOverall .NET 8 productLow. Mostly a contained fix for an off-by-default component. There are minimal changes to the System.Text.Json source generator; only to share generator helper components: diagnostic handling helpers and a utility collection type to facilitate creating incremental models. Source generatorMedium To facilitate incremental generation, parsing logic has been non-trivially modified to produce equatable models. No change to codified/already tested functionality but there might be subtle differences that might regress unknown scenarios. The changes introduce intentional but minimal diffs in a small number of emitted-source regression baselines. We’ve determined that the changes are valid, but any diff indicates that generated binding logic might change for untested scenarios, which might cause functionality regressions. Now that this final v1 feature-size change is complete, we’ll switch gears to extensively testing more scenarios and ensure upstream product integration (e.g. ASP.NET; regression projects for final products, working with .NET fundamentals team). As always, we’ll address any reported scenarios quickly.
|
Approved by Tactics via email. |
@eiriktsarpalis @tarekgh @ericstj we only need a code review sign-off from one of you and I can merge. |
Single failing test is #92944 |
Backport of #89587 to release/8.0.
Fixes #83534.
Customer Impact
This change ensures that during IDE development, after emitting source to honor an initial trigger, the generator won’t re-emit code given subsequent edits (i.e every keystroke) that do not change the effective input to the generator.
This is important for large solutions (numerous projects and/or source files) that have code that would trigger the generator to participate in compilation.
See sample code that showcase scenarios where customers would observe this impact.
Testing
New tests theoretically prove that given the same effective input, the generator produces the same parsed model which prevents regeneration.
A variety of sanity check and core scenario validation tests have been added to verify that we regenerate source only when needed.
There are no regressions to existing unit and functional tests.
Risk
Overall .NET 8 product
Low. Mostly a contained fix for an off-by-default component.
There are minimal changes to the System.Text.Json source generator; only to share generator helper components: diagnostic handling helpers and a utility collection type to facilitate creating incremental models.
Source generator
Medium
To facilitate incremental generation, parsing logic has been non-trivially modified to produce equatable models. No change to codified/already tested functionality but there might be subtle differences that might regress unknown scenarios.
The changes introduce intentional but minimal diffs in a small number of emitted-source regression baselines. We’ve determined that the changes are valid, but any diff indicates that generated binding logic might change for untested scenarios, which might cause functionality regressions.
Now that this final v1 feature-size change is complete, we’ll switch gears to extensively testing more scenarios and ensure upstream product integration (e.g. ASP.NET; regression projects for final products, working with .NET fundamentals team). As always, we’ll address any reported scenarios quickly.