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

Azure Functions isolated process #4988

Merged

Conversation

cajuncoding
Copy link
Contributor

Summary of the changes (Less than 80 chars)

  • Implemented support for Azure Functions Isolated process model
  • Expanded and added Unit Test coverage for both In-process & Isolated process models

…ocess. Spent significant time on trying to get the Binding to work with Attribute to match existing in-process support. And DID get a branch working locally with full bindings running -- but it was UGLY, and runtime binding failed with error unable to bind to String.... finally realize that the MS Docs say (buried and hard to find) that only String data is supported for marshalling in/out of the isolated worker process -- soo, yep waste of time. The DI implementation has only a couple lines of extra code and works perfectly fine, so it's still really streamlined. And the code is massively simplified as Bindings in isolated process are not nearly as elegant as in-process (it's aggrivatingly narly to even get it compiling and initializing).
…process extensions so that code can be portable between in-process/isolated-process.
…able. Added/expanded unit tests covering Host Builder/Configuration and End-to-End execution of hello world query. Simplified naming of HttpContextShim as it's actually not really GraphQL specific, and factored out logic for building HttpContext into an HttpContextBuilder class becasue it can be leveraged for end-to-end unit tests of the In-Process AzureFunctions also!
… world query for IsolatedProcess using HttpRequestData & HttpResponseData; which is unique to the Isolated Process. Had to add a ton of manual mock classes to support testing, but it's now nice to have real mock classes (since all Default implementations from Microsoft are internal).
@github-actions github-actions bot added 🌶️ hot chocolate 📚 documentation This issue is about working on our documentation. 🧰 maintenance labels Apr 21, 2022
@michaelstaib michaelstaib changed the base branch from main-version-12 to main April 22, 2022 09:32
@michaelstaib
Copy link
Member

I moved it to the main branch ... we cherry-pick the change to version 12 once we have merged it.

@github-actions github-actions bot removed 📚 documentation This issue is about working on our documentation. 🧰 maintenance labels Apr 22, 2022
@sonarcloud
Copy link

sonarcloud bot commented May 4, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 16 Code Smells

75.7% 75.7% Coverage
0.0% 0.0% Duplication

…d_process

# Conflicts:
#	src/HotChocolate/AzureFunctions/src/HotChocolate.AzureFunctions/Extensions/HotChocolateAzureFunctionServiceCollectionExtensions.cs
#	src/HotChocolate/Language/src/Language.Visitors/Properties/Resources.Designer.cs
#	src/HotChocolate/MongoDb/test/Data.MongoDb.Projections.Tests/HotChocolate.Data.MongoDb.Projections.Tests.csproj
#	src/HotChocolate/Stitching/src/Stitching/Properties/StitchingResources.Designer.cs
…ucture needing a git clean.

- Updated Azure Function Isolated Process test namespaces to match physical location for consistency.
- Fix TargetFrameworks support for Azure Functions Isolated process which does not support netcoreapp3.1 so it must have it's own targets that are only .net5.0+
@michaelstaib michaelstaib changed the title bbernard/support for azure functions isolated process Azure Functions isolated process Aug 23, 2022
@ChilliCream ChilliCream deleted a comment from CLAassistant Aug 23, 2022
@ChilliCream ChilliCream deleted a comment from cla-bot bot Aug 23, 2022
@ChilliCream ChilliCream deleted a comment from cla-bot bot Aug 23, 2022
@cajuncoding
Copy link
Contributor Author

@michaelstaib someone on slack asked a good question this evening about HttpContext support via IHttpContextAccessor... I used one of my local demo projects to quickly test that it works as expected.

But I didn't add support for that in the new Isolated process model since we control the HttpContext creation, so I'm adding that and will push an update soon! It should work just like the existing Documentation shows 👍.

michaelstaib and others added 9 commits August 23, 2022 09:20
…rocess. Added marshaling of FunctionsContext.Items collection (object bag) into HttpContext.Items collection. Added Unit tests for IHttpContextAccesor to both Az Func In-process and Isolated-process test projects. Code cleanup and updates to use 'var', etc.
… the new v13 repo). Test cleanup to ensure we specify Reqeuest Http Headers (e.g Accept Json and Accept text/html, etc.).
@michaelstaib michaelstaib merged commit 0190045 into main Sep 12, 2022
@michaelstaib michaelstaib deleted the bbernard/support_for_azure_functions_isolated_process branch September 12, 2022 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants