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

Analyzer for Multiple-Output Binding Scenarios with ASP.NET Core Integration #2706

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

satvu
Copy link
Member

@satvu satvu commented Sep 12, 2024

Issue describing the changes in this PR

resolves #2352

Pull request checklist

  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • I have added all required tests (Unit tests, E2E tests)

Additional Information

Screenshots of the alert and code-fix.

alert code-fix

@liliankasem
Copy link
Member

Can you include a screenshot/gif in the PR desc of this analyzer working?

docs/analyzer-rules/AZFW0015.md Show resolved Hide resolved
namespace Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore
{
internal static class ITypeSymbolExtensions
{
Copy link
Member

Choose a reason for hiding this comment

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

Does this method need to take into account interfaces at all?

Copy link
Member Author

Choose a reason for hiding this comment

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

Given that OutputBindingAttribute is not an interface, this will successfully find classes that implement the abstract class.

For classes that implement some interface, this should just exit (BaseType returns null).


namespace Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore
{
internal static class ITypeSymbolExtensions
Copy link
Member

Choose a reason for hiding this comment

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

please create a unit test for this this file and test the IsOrDerivedFrom method (should be done for all helper methods/extensions)

Copy link
Member Author

Choose a reason for hiding this comment

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

Leaving this for another iteration - need to investigate how to best test this as we may need access to a compilation and semantic model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Analyzer for multiple output bindings using IActionResult
3 participants