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

[Enhanced HTTP] Add handling for IActionResult #1475

Merged
merged 9 commits into from
May 3, 2023

Conversation

satvu
Copy link
Member

@satvu satvu commented Apr 17, 2023

Issue describing the changes in this PR

resolves #issue_for_this_pr

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

Additional PR information

@@ -31,7 +31,7 @@ public static IFunctionsWorkerApplicationBuilder UseAspNetCoreIntegration(this I

builder.Services.AddSingleton<IHttpCoordinator, DefaultHttpCoordinator>();

var port = Utilities.GetUnusedTcpPort().ToString();
Copy link
Member Author

Choose a reason for hiding this comment

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

wasn't being used

@@ -27,6 +30,13 @@ public async Task Invoke(FunctionContext context, FunctionExecutionDelegate next

await next(context);

if (context.GetInvocationResult()?.Value is IActionResult actionResult)
{
ActionContext actionContext = new ActionContext(httpContext, httpContext.GetRouteData(), new ActionDescriptor());
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have plans to fill out ActionDescriptor?

Copy link
Member Author

Choose a reason for hiding this comment

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

Discussed at sync yesterday and no, we do not. Looking at similar code in the host side and we do not fill it out either.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we don't do it in host code I am fine leaving this empty then.

I do wonder what functionality we are excluding here? ActionDescriptor essentially holds a breakdown the MVC endpoint that is being ran. We should consider populating it in the future.

Copy link
Member

Choose a reason for hiding this comment

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

There's no action associated with the context and we have a terminating middleware, no action selection will be performed. As @satvu pointed out, that's the same pattern used by the host.

@satvu satvu marked this pull request as ready for review April 19, 2023 14:56
@satvu satvu merged this pull request into feature/enhanced-http May 3, 2023
@satvu satvu deleted the satvu/add-iactionresult branch May 3, 2023 15:58
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.

4 participants