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

Multi-Output Binding Analyzer #2440

Closed
wants to merge 74 commits into from
Closed

Conversation

satvu
Copy link
Member

@satvu satvu commented May 3, 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

Tests need to be updated to use released packages following the release of the http extension (depends on host 4.34).

/// <summary>
/// CodeAction implementation which adds the HttpResultAttribute on the return type of a function using the multi-output bindings pattern.
/// </summary>
private sealed class AddHttpResultAttribute : CodeAction
Copy link
Member Author

Choose a reason for hiding this comment

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

Debating on the necessity of a code-fix as we want the user to add the attribute where they want it, but we can assume that this case (use of IActionResult in multi-output binding scenario) will be pretty common.

var newPropertyNode = propertyNode
.AddAttributeLists(SyntaxFactory.AttributeList(SyntaxFactory.SingletonSeparatedList(attribute)));

var newRoot = root.ReplaceNode(propertyNode, newPropertyNode);
Copy link
Member Author

@satvu satvu May 3, 2024

Choose a reason for hiding this comment

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

Still working on getting the formatting correct for the fix (ideally using Roslyn Formatter). The PR is failing the test I have for this due to the indentation issue.

}
}

private static bool IsCustomType(ISymbol symbol)
Copy link
Member Author

Choose a reason for hiding this comment

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

Would like reviews/ideas on how to approach determining whether or not a return type is a POCO.

new PackageIdentity("Microsoft.Azure.Functions.Worker.Extensions.Abstractions", "5.0.0"),
new PackageIdentity("Microsoft.AspNetCore.Mvc.Core", "2.2.5"),
new PackageIdentity("Microsoft.Extensions.Hosting.Abstractions", "6.0.0"),
new PackageIdentity("Microsoft.Azure.Functions.Worker.Extensions.Http", "3.2.0-local")));
Copy link
Member Author

Choose a reason for hiding this comment

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

Needs to be updated once the actual package is released.

surgupta-msft and others added 16 commits July 10, 2024 10:58
* Adding context propagation for ActivityTraceFlags and TraceState.
* Fix incorrect build message

* update release_notes.md

* Refactor AzureFunctionVersion default and error checks

* Add warning for v3 out of support

* Address PR comments
…tedLinuxPlaceholder profile. FNH 1.0.10 (#2629)

Removing WEBSITE_CONTAINER_READY=0 env variable check for DotnetIsolatedLinuxPlaceholder profile.
Bumped version to 1.0.10
…ctionsNetHost Linux artifact (#2653)

- Bumping patch version. New version is 1.0.11
@satvu satvu marked this pull request as ready for review August 23, 2024 22:06
@fabiocav fabiocav removed their assignment Sep 11, 2024
@satvu satvu closed this Sep 12, 2024
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