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

Add ability to bind to SBReceivedMessage #1313

Merged

Conversation

JoshLove-msft
Copy link
Member

@JoshLove-msft JoshLove-msft commented Feb 6, 2023

Issue describing the changes in this PR

resolves #1535

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

@JoshLove-msft
Copy link
Member Author

Need to figure out why E2E tests are not working.

@JoshLove-msft
Copy link
Member Author

/cc @jsquire

Copy link
Member

@jsquire jsquire left a comment

Choose a reason for hiding this comment

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

The Service Bus client library integrations look good to me.

@SeanFeldman
Copy link
Contributor

Cross linking to the issues this PR fixes #384

@liliankasem liliankasem changed the base branch from main to feature/sdk-type-binding February 28, 2023 21:09
@liliankasem
Copy link
Member

Hey @JoshLove-msft, I've finally gotten round to writing a guide for deferred binding support in worker extensions - it's an initial draft so feedback is welcome: https://dev.azure.com/msazure/One/_git/AAPT-Antares-Docs?path=/TeamDocs/FunctionTeamDocs/EngineeringHowTos/DeferredBinding/DotnetIsolatedExtensionGuide.md&version=GBmaster&_a=preview

A couple things to call out which will help progress this PR:

  1. There's info on how to write unit tests for the converter
  2. There's info on how to write E2E tests for the extension
  3. There's guidance on managed identity support

@JoshLove-msft
Copy link
Member Author

Hey @JoshLove-msft, I've finally gotten round to writing a guide for deferred binding support in worker extensions - it's an initial draft so feedback is welcome: https://dev.azure.com/msazure/One/_git/AAPT-Antares-Docs?path=/TeamDocs/FunctionTeamDocs/EngineeringHowTos/DeferredBinding/DotnetIsolatedExtensionGuide.md&version=GBmaster&_a=preview

A couple things to call out which will help progress this PR:

  1. There's info on how to write unit tests for the converter
  2. There's info on how to write E2E tests for the extension
  3. There's guidance on managed identity support

Thanks! I will take a look. But just to clarify this PR is blocked on guidance around how to handle the named parameter bindings.

@JoshLove-msft
Copy link
Member Author

Hey @JoshLove-msft, I've finally gotten round to writing a guide for deferred binding support in worker extensions - it's an initial draft so feedback is welcome: https://dev.azure.com/msazure/One/_git/AAPT-Antares-Docs?path=/TeamDocs/FunctionTeamDocs/EngineeringHowTos/DeferredBinding/DotnetIsolatedExtensionGuide.md&version=GBmaster&_a=preview
A couple things to call out which will help progress this PR:

  1. There's info on how to write unit tests for the converter
  2. There's info on how to write E2E tests for the extension
  3. There's guidance on managed identity support

Thanks! I will take a look. But just to clarify this PR is blocked on guidance around how to handle the named parameter bindings.

Regarding the guide, one thing that I couldn't find is how to set up E2E testing when using something other than Azurite. The only enabled E2E tests that I found all depend on Azurite so there isn't any need to reference secrets or deploy resources. Do you have information on how to configure such tests?

@liliankasem
Copy link
Member

Hey @JoshLove-msft, I've finally gotten round to writing a guide for deferred binding support in worker extensions - it's an initial draft so feedback is welcome: https://dev.azure.com/msazure/One/_git/AAPT-Antares-Docs?path=/TeamDocs/FunctionTeamDocs/EngineeringHowTos/DeferredBinding/DotnetIsolatedExtensionGuide.md&version=GBmaster&_a=preview
A couple things to call out which will help progress this PR:

  1. There's info on how to write unit tests for the converter
  2. There's info on how to write E2E tests for the extension
  3. There's guidance on managed identity support

Thanks! I will take a look. But just to clarify this PR is blocked on guidance around how to handle the named parameter bindings.

Regarding the guide, one thing that I couldn't find is how to set up E2E testing when using something other than Azurite. The only enabled E2E tests that I found all depend on Azurite so there isn't any need to reference secrets or deploy resources. Do you have information on how to configure such tests?

I don't believe we have anything in place for you to use real resources (definitely an improvement we can make to the scripts), but for now you can manually edit the Constants file. That's were all the emulator connection strings live so I imagine you can swap those out locally for testing.

@liliankasem
Copy link
Member

Hey @JoshLove-msft, I've finally gotten round to writing a guide for deferred binding support in worker extensions - it's an initial draft so feedback is welcome: https://dev.azure.com/msazure/One/_git/AAPT-Antares-Docs?path=/TeamDocs/FunctionTeamDocs/EngineeringHowTos/DeferredBinding/DotnetIsolatedExtensionGuide.md&version=GBmaster&_a=preview
A couple things to call out which will help progress this PR:

  1. There's info on how to write unit tests for the converter
  2. There's info on how to write E2E tests for the extension
  3. There's guidance on managed identity support

Thanks! I will take a look. But just to clarify this PR is blocked on guidance around how to handle the named parameter bindings.

Ah yup, we're working on that! We have a design in place and are working on a prototype. I'll flag this PR as blocked until we have something in place to unblock you here

@liliankasem liliankasem added the blocked Items that cannot move forward at the moment. label Mar 16, 2023
@JoshLove-msft
Copy link
Member Author

Hi @liliankasem,
Just wanted to check in to see if there is any update on the work needed to unblock this PR? Thanks!

@liliankasem
Copy link
Member

Hi @liliankasem, Just wanted to check in to see if there is any update on the work needed to unblock this PR? Thanks!

Hello, we have a prototype in place for how we'd like to handle this. Once we have that fully implemented and merged, we'll do a new SDK release and you should be unblocked. @surgupta-msft any updates on how the skip deferred binding work is going/ETA?

We'll also make sure to update the author guide on how to use the new approach. The gist of it is that now the converter can use an attribute to define the type it supports e.g.

[SupportsDeferredBinding]
[SupportedConverterTypes(typeof(ServiceBusReceivedMessage))]
internal class ServiceBusReceivedMessageConverter : IInputConverter {}

@surgupta-msft
Copy link
Contributor

Yup, here is the PR - #1462 for bypass deferred binding work. Working on getting this in in this sprint. @JoshLove-msft feel free to test it, otherwise I will update you as soon as this is released.

NuGet.Config Outdated Show resolved Hide resolved
Copy link
Member

@liliankasem liliankasem left a comment

Choose a reason for hiding this comment

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

Almost there! just needs unit and e2e tests, feel free to use these as guidance:

@surgupta-msft
Copy link
Contributor

Almost there! just needs unit and e2e tests, feel free to use these as guidance:

I had a brief chat with Josh about E2E tests, but looks like ServiceBus does not have Emulator like Storage and Cosmos. Not sure if there is any other way we can do this?

@liliankasem
Copy link
Member

Almost there! just needs unit and e2e tests, feel free to use these as guidance:

I had a brief chat with Josh about E2E tests, but looks like ServiceBus does not have Emulator like Storage and Cosmos. Not sure if there is any other way we can do this?

Hmm in that case, we can leave E2E tests to be outside of this PR - it will require changes in our testing pipeline. One way around this would be to have our pipeline spin up a service bus resource, run the tests, then tear it all down.

Don't want to block this PR on that so we should a) still make sure to include unit tests, b) create an issue for updating our pipelines to deploy and destroy resources for E2E testing (could also be an investigation story if we want to explore other options), and c) create an issue to add service bus E2E tests (once infrastructure of it is ready)

@JoshLove-msft
Copy link
Member Author

Don't want to block this PR on that so we should a) still make sure to include unit tests, b) create an issue for updating our pipelines to deploy and destroy resources for E2E testing (could also be an investigation story if we want to explore other options), and c) create an issue to add service bus E2E tests (once infrastructure of it is ready)

BTW we have invested a lot of effort to having live test infrastructure in the azure-sdk-for-net repo. So that would be another option you can consider - migrate the extension to that repo.

@liliankasem
Copy link
Member

Don't want to block this PR on that so we should a) still make sure to include unit tests, b) create an issue for updating our pipelines to deploy and destroy resources for E2E testing (could also be an investigation story if we want to explore other options), and c) create an issue to add service bus E2E tests (once infrastructure of it is ready)

BTW we have invested a lot of effort to having live test infrastructure in the azure-sdk-for-net repo. So that would be another option you can consider - migrate the extension to that repo.

Yeah we have actually been thinking about moving all of the extensions out of this repo and into azure-sdk-for-net and azure-webjobs-sdk-extensions - definitely worth considering before we spend too much time setting up our infrastructure

@JoshLove-msft
Copy link
Member Author

Almost there! just needs unit and e2e tests, feel free to use these as guidance:

Unit tests added!

@liliankasem liliankasem removed the blocked Items that cannot move forward at the moment. label May 18, 2023
@JoshLove-msft
Copy link
Member Author

@liliankasem @surgupta-msft thank you for the review and your help implementing this! Feel free to merge it.

@liliankasem liliankasem merged commit 14f203e into Azure:feature/sdk-type-binding May 22, 2023
18 checks passed
aishwaryabh added a commit that referenced this pull request May 25, 2023
* Add E2E tests for blob SDK type bindings (#1360)

* Add analyzer for SupportsDeferredBindingAttribute (#1367)

* Update SupportsDeferredBinding diagnostic code & update docs (#1377)

* Revert "Remove types, tests & logic related to the SDK-binding feature (#1374)"

This reverts commit eac5b19.

* Added unit tests for BlobStorageConverter (#1370)

* Adding test project
* Added tests

* Initial changes

* Updating metadata

* Adding a test

* Code refactoring

* Cosmos DB converter for SDK-type support and samples (#1406)

* Execution flow added

* Update pipeline variables to include tags (#1427)

* Update extension variables to not use build number with tags (#1429)

* Execution flow

* cleanup

* Cleanup

* Cleanup

* Cleanup execution flow

* Added test

* Adding tests

* code cleanup

* Code cleanup

* code refactor

* Added logic to check type before sending to converter

* Updated tests

* Removing advertised converters from options

* Adding options back

* Changes to check type

* updating type check logic

* correction in metadata generation

* code cleanup

* Test cleanup

* Added changes to support poco

* Metadata generation changes

* Changes on Invocation side

* correcting type check and tests

* Test for poco invocation support

* Added tests for poco invocation flows

* Metadata generator minor update

* Grpc definition update

* Added poco and poco collection check

* cleanup metadata generation

* Adding support for type collection

* code cleanup

* Fixing metadata gen

* Test fix

* Grpc definition fix

* Removing BlobContainerClient advertisement

* Readding containerclient

* Updated metadata generator

* Changes as per latest design

* code cleanup

* updatin tests input

* code cleanup

* Cleanup Metadata generation

* correcting converters fallback logic

* Removing converter advertisement on cosmos trigger

* Fixing failing test

* test check in

* Undo testing changes in sample app

* spacing fix

* updated tests

* non secret changes

* Addressing PR feedback

* e2e test work

* adding comments

* Removed json deserialization attribute

* Rename to AllowConverterFallback

* Addressing feedback

* Metada generation cleanup

* Test cleanup

* Addressing feedback

* Updated grpcFunctionDefinition for multiple inputConverterAttribute

* Removing cosmos converter registration

* Address PR feedback

* Address PR feedback

* Test fix

* Minor

* addressing comments

* getting e2e working

* Implement bypass deferred binding (#1462)

Implement bypass deferred binding

* Build issue fix

* comments

* Update test/E2ETests/E2EApps/E2EApp/Table/TableInputBindingFunctions.cs

Co-authored-by: Lilian Kasem <likasem@microsoft.com>

* Adding check for PR in yml file (#1546)

* addressing some more comments

* dependency

* one more dependency

* trying to compile lol

* seeing if tables project compiles with dependency

* removing local instance

* see if this compiles

* trying to remove test

* nvm adding it back

* adding keys to nuget.config

* trying to get feed

* trying again

* more yml

* fixing spacing

* ci.yml

* Add ability to bind to SBReceivedMessage (#1313)

* another change

* trying again

* formatting changes

* changes

* updating worker.sdk package

* fixing unit test

* getting unit tests to pass

* fixing test

---------

Co-authored-by: Lilian Kasem <likasem@microsoft.com>
Co-authored-by: Surgupta <surgupta@microsoft.com>
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
@JoshLove-msft JoshLove-msft mentioned this pull request Jun 9, 2023
7 tasks
liliankasem added a commit that referenced this pull request Jun 21, 2023
* Add E2E tests for blob SDK type bindings (#1360)

* Add analyzer for SupportsDeferredBindingAttribute (#1367)

* Update SupportsDeferredBinding diagnostic code & update docs (#1377)

* Revert "Remove types, tests & logic related to the SDK-binding feature (#1374)"

This reverts commit eac5b19.

* Added unit tests for BlobStorageConverter (#1370)

* Adding test project
* Added tests

* Initial changes

* Updating metadata

* Adding a test

* Code refactoring

* Cosmos DB converter for SDK-type support and samples (#1406)

* Execution flow added

* Update pipeline variables to include tags (#1427)

* Update extension variables to not use build number with tags (#1429)

* Execution flow

* cleanup

* Cleanup

* Cleanup

* Cleanup execution flow

* Added test

* Adding tests

* code cleanup

* Code cleanup

* code refactor

* Added logic to check type before sending to converter

* Updated tests

* Removing advertised converters from options

* Adding options back

* Changes to check type

* updating type check logic

* correction in metadata generation

* code cleanup

* Test cleanup

* Added changes to support poco

* Metadata generation changes

* Changes on Invocation side

* correcting type check and tests

* Test for poco invocation support

* Added tests for poco invocation flows

* Metadata generator minor update

* Grpc definition update

* Added poco and poco collection check

* cleanup metadata generation

* Adding support for type collection

* code cleanup

* Fixing metadata gen

* Test fix

* Grpc definition fix

* Removing BlobContainerClient advertisement

* Readding containerclient

* Updated metadata generator

* Changes as per latest design

* code cleanup

* updatin tests input

* code cleanup

* Cleanup Metadata generation

* correcting converters fallback logic

* Removing converter advertisement on cosmos trigger

* Fixing failing test

* test check in

* Undo testing changes in sample app

* spacing fix

* updated tests

* non secret changes

* Addressing PR feedback

* e2e test work

* adding comments

* Removed json deserialization attribute

* Rename to AllowConverterFallback

* Addressing feedback

* Metada generation cleanup

* Test cleanup

* Addressing feedback

* Updated grpcFunctionDefinition for multiple inputConverterAttribute

* Removing cosmos converter registration

* Address PR feedback

* Address PR feedback

* Test fix

* Minor

* addressing comments

* getting e2e working

* Implement bypass deferred binding (#1462)

Implement bypass deferred binding

* Build issue fix

* comments

* Update test/E2ETests/E2EApps/E2EApp/Table/TableInputBindingFunctions.cs

Co-authored-by: Lilian Kasem <likasem@microsoft.com>

* Adding check for PR in yml file (#1546)

* addressing some more comments

* dependency

* one more dependency

* trying to compile lol

* seeing if tables project compiles with dependency

* removing local instance

* see if this compiles

* trying to remove test

* nvm adding it back

* adding keys to nuget.config

* trying to get feed

* trying again

* more yml

* fixing spacing

* ci.yml

* Add ability to bind to SBReceivedMessage (#1313)

* another change

* trying again

* formatting changes

* changes

* updating worker.sdk package

* fixing unit test

* getting unit tests to pass

* fixing test

---------

Co-authored-by: Lilian Kasem <likasem@microsoft.com>
Co-authored-by: Surgupta <surgupta@microsoft.com>
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
liliankasem added a commit that referenced this pull request Jun 22, 2023
* Add E2E tests for blob SDK type bindings (#1360)

* Add analyzer for SupportsDeferredBindingAttribute (#1367)

* Update SupportsDeferredBinding diagnostic code & update docs (#1377)

* Revert "Remove types, tests & logic related to the SDK-binding feature (#1374)"

This reverts commit eac5b19.

* Added unit tests for BlobStorageConverter (#1370)

* Adding test project
* Added tests

* Initial changes

* Updating metadata

* Adding a test

* Code refactoring

* Cosmos DB converter for SDK-type support and samples (#1406)

* Execution flow added

* Update pipeline variables to include tags (#1427)

* Update extension variables to not use build number with tags (#1429)

* Execution flow

* cleanup

* Cleanup

* Cleanup

* Cleanup execution flow

* Added test

* Adding tests

* code cleanup

* Code cleanup

* code refactor

* Added logic to check type before sending to converter

* Updated tests

* Removing advertised converters from options

* Adding options back

* Changes to check type

* updating type check logic

* correction in metadata generation

* code cleanup

* Test cleanup

* Added changes to support poco

* Metadata generation changes

* Changes on Invocation side

* correcting type check and tests

* Test for poco invocation support

* Added tests for poco invocation flows

* Metadata generator minor update

* Grpc definition update

* Added poco and poco collection check

* cleanup metadata generation

* Adding support for type collection

* code cleanup

* Fixing metadata gen

* Test fix

* Grpc definition fix

* Removing BlobContainerClient advertisement

* Readding containerclient

* Updated metadata generator

* Changes as per latest design

* code cleanup

* updatin tests input

* code cleanup

* Cleanup Metadata generation

* correcting converters fallback logic

* Removing converter advertisement on cosmos trigger

* Fixing failing test

* test check in

* Undo testing changes in sample app

* spacing fix

* updated tests

* non secret changes

* Addressing PR feedback

* e2e test work

* adding comments

* Removed json deserialization attribute

* Rename to AllowConverterFallback

* Addressing feedback

* Metada generation cleanup

* Test cleanup

* Addressing feedback

* Updated grpcFunctionDefinition for multiple inputConverterAttribute

* Removing cosmos converter registration

* Address PR feedback

* Address PR feedback

* Test fix

* Minor

* addressing comments

* getting e2e working

* Implement bypass deferred binding (#1462)

Implement bypass deferred binding

* Build issue fix

* comments

* Update test/E2ETests/E2EApps/E2EApp/Table/TableInputBindingFunctions.cs

Co-authored-by: Lilian Kasem <likasem@microsoft.com>

* Adding check for PR in yml file (#1546)

* addressing some more comments

* dependency

* one more dependency

* trying to compile lol

* seeing if tables project compiles with dependency

* removing local instance

* see if this compiles

* trying to remove test

* nvm adding it back

* adding keys to nuget.config

* trying to get feed

* trying again

* more yml

* fixing spacing

* ci.yml

* Add ability to bind to SBReceivedMessage (#1313)

* another change

* trying again

* formatting changes

* changes

* updating worker.sdk package

* fixing unit test

* getting unit tests to pass

* fixing test

---------

Co-authored-by: Lilian Kasem <likasem@microsoft.com>
Co-authored-by: Surgupta <surgupta@microsoft.com>
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
JoshLove-msft added a commit to JoshLove-msft/azure-functions-dotnet-worker that referenced this pull request Oct 4, 2023
JoshLove-msft added a commit to JoshLove-msft/azure-functions-dotnet-worker that referenced this pull request Oct 4, 2023
* Add E2E tests for blob SDK type bindings (Azure#1360)

* Add analyzer for SupportsDeferredBindingAttribute (Azure#1367)

* Update SupportsDeferredBinding diagnostic code & update docs (Azure#1377)

* Revert "Remove types, tests & logic related to the SDK-binding feature (Azure#1374)"

This reverts commit eac5b19.

* Added unit tests for BlobStorageConverter (Azure#1370)

* Adding test project
* Added tests

* Initial changes

* Updating metadata

* Adding a test

* Code refactoring

* Cosmos DB converter for SDK-type support and samples (Azure#1406)

* Execution flow added

* Update pipeline variables to include tags (Azure#1427)

* Update extension variables to not use build number with tags (Azure#1429)

* Execution flow

* cleanup

* Cleanup

* Cleanup

* Cleanup execution flow

* Added test

* Adding tests

* code cleanup

* Code cleanup

* code refactor

* Added logic to check type before sending to converter

* Updated tests

* Removing advertised converters from options

* Adding options back

* Changes to check type

* updating type check logic

* correction in metadata generation

* code cleanup

* Test cleanup

* Added changes to support poco

* Metadata generation changes

* Changes on Invocation side

* correcting type check and tests

* Test for poco invocation support

* Added tests for poco invocation flows

* Metadata generator minor update

* Grpc definition update

* Added poco and poco collection check

* cleanup metadata generation

* Adding support for type collection

* code cleanup

* Fixing metadata gen

* Test fix

* Grpc definition fix

* Removing BlobContainerClient advertisement

* Readding containerclient

* Updated metadata generator

* Changes as per latest design

* code cleanup

* updatin tests input

* code cleanup

* Cleanup Metadata generation

* correcting converters fallback logic

* Removing converter advertisement on cosmos trigger

* Fixing failing test

* test check in

* Undo testing changes in sample app

* spacing fix

* updated tests

* non secret changes

* Addressing PR feedback

* e2e test work

* adding comments

* Removed json deserialization attribute

* Rename to AllowConverterFallback

* Addressing feedback

* Metada generation cleanup

* Test cleanup

* Addressing feedback

* Updated grpcFunctionDefinition for multiple inputConverterAttribute

* Removing cosmos converter registration

* Address PR feedback

* Address PR feedback

* Test fix

* Minor

* addressing comments

* getting e2e working

* Implement bypass deferred binding (Azure#1462)

Implement bypass deferred binding

* Build issue fix

* comments

* Update test/E2ETests/E2EApps/E2EApp/Table/TableInputBindingFunctions.cs

Co-authored-by: Lilian Kasem <likasem@microsoft.com>

* Adding check for PR in yml file (Azure#1546)

* addressing some more comments

* dependency

* one more dependency

* trying to compile lol

* seeing if tables project compiles with dependency

* removing local instance

* see if this compiles

* trying to remove test

* nvm adding it back

* adding keys to nuget.config

* trying to get feed

* trying again

* more yml

* fixing spacing

* ci.yml

* Add ability to bind to SBReceivedMessage (Azure#1313)

* another change

* trying again

* formatting changes

* changes

* updating worker.sdk package

* fixing unit test

* getting unit tests to pass

* fixing test

---------

Co-authored-by: Lilian Kasem <likasem@microsoft.com>
Co-authored-by: Surgupta <surgupta@microsoft.com>
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
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.

None yet

7 participants