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

Use Roslyn interceptors feature in binder gen #90340

Merged
merged 5 commits into from
Aug 19, 2023

Conversation

layomia
Copy link
Contributor

@layomia layomia commented Aug 10, 2023

Fixes #89322.

@layomia layomia added this to the 8.0.0 milestone Aug 10, 2023
@layomia layomia self-assigned this Aug 10, 2023
@ghost
Copy link

ghost commented Aug 10, 2023

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

Issue Details

Fixes #89322.

Work left

Author: layomia
Assignees: layomia
Labels:

area-Extensions-Configuration

Milestone: 8.0.0

@layomia layomia force-pushed the binder-gen-interceptors branch from d205853 to f5d0e0e Compare August 17, 2023 16:29
@layomia layomia marked this pull request as ready for review August 17, 2023 16:30
@layomia layomia requested a review from jeffhandley as a code owner August 17, 2023 16:30
@layomia layomia requested review from eerhardt, eiriktsarpalis, captainsafia and tarekgh and removed request for jeffhandley August 17, 2023 16:30
@ericstj
Copy link
Member

ericstj commented Aug 17, 2023

image

🎉 🎉 🎉 Reviewers - let's have a look at this and try to get feedback in and addressed ASAP to make it for RC1.

[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
file sealed class InterceptsLocationAttribute : Attribute
{
public InterceptsLocationAttribute(string filePath, int line, int column)
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@tarekgh tarekgh Aug 17, 2023

Choose a reason for hiding this comment

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

I think we decided to mimic whatever the aspnet is doing in the web project.

Copy link
Member

Choose a reason for hiding this comment

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

ASP.NET doesn't ship a nuget package so we're special here. There's an ongoing discussion around this to decide what we want to do.

@layomia layomia force-pushed the binder-gen-interceptors branch 4 times, most recently from 80df566 to 743f89a Compare August 18, 2023 19:34
@layomia layomia closed this Aug 18, 2023
@layomia layomia force-pushed the binder-gen-interceptors branch from 743f89a to f3fe768 Compare August 18, 2023 20:02
@layomia
Copy link
Contributor Author

layomia commented Aug 18, 2023

Closing notes

Name clashes

Not needed for this feature to work & there's no new risk added here. I'll address in #86363. I've reverted the changes to the options generator and left out unique name generation in this generator.

Testing

There's always room to improve coverage, but I believe these suffice for merging this PR.

  • Interceptors handling multiple calls, including across different files.
    • Emitted source for the binder test project shows this is well covered.
  • Diagnostic suppressions where applicable
    • numerous binding calls in extensions assemblies which are linker trimmed show that this handled correctly
  • Not suppressing diagnostics for calls we didn't intercept:
    • tested with simple console application
  • Polymorphic type handling: Microsoft.Extensions.Logging.Console assembly exercises/validates the updated logic.

@layomia
Copy link
Contributor Author

layomia commented Aug 18, 2023

/backport to release/8.0-rc1

@github-actions
Copy link
Contributor

Started backporting to release/8.0-rc1: https://github.com/dotnet/runtime/actions/runs/5907490321

@layomia
Copy link
Contributor Author

layomia commented Aug 18, 2023

Test failures seem to be caused by applying the code analysis version update across all projects. Will fix.

@layomia layomia force-pushed the binder-gen-interceptors branch from b267af5 to 5210070 Compare August 18, 2023 23:42
@layomia layomia force-pushed the binder-gen-interceptors branch from 5210070 to d9504fd Compare August 18, 2023 23:58
@layomia layomia force-pushed the binder-gen-interceptors branch from d9504fd to 6fff866 Compare August 19, 2023 00:28
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.

Use Roslyn interceptors feature in config binder generator
9 participants