-
Notifications
You must be signed in to change notification settings - Fork 204
Table converter #1506
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
Merged
aishwaryabh
merged 123 commits into
feature/sdk-type-binding
from
aibhandari/table-converter-legit
May 25, 2023
Merged
Table converter #1506
Changes from all commits
Commits
Show all changes
123 commits
Select commit
Hold shift + click to select a range
257add7
Add E2E tests for blob SDK type bindings (#1360)
liliankasem 3f84651
Add analyzer for SupportsDeferredBindingAttribute (#1367)
liliankasem 6b1189a
Update SupportsDeferredBinding diagnostic code & update docs (#1377)
liliankasem d16ab2d
Revert "Remove types, tests & logic related to the SDK-binding featur…
liliankasem cdcbc9d
Added unit tests for BlobStorageConverter (#1370)
surgupta-msft f7853d7
Initial changes
surgupta-msft 9d105a6
Updating metadata
surgupta-msft 0a4342b
Adding a test
surgupta-msft d5206aa
Code refactoring
surgupta-msft fae3f6b
Cosmos DB converter for SDK-type support and samples (#1406)
liliankasem a4da7dc
Execution flow added
surgupta-msft 1b3395e
Update pipeline variables to include tags (#1427)
liliankasem cb93c71
Update extension variables to not use build number with tags (#1429)
liliankasem 61479cb
Execution flow
surgupta-msft 356b372
cleanup
surgupta-msft 199e6cb
Cleanup
surgupta-msft 379da90
Cleanup
surgupta-msft 71e0be8
Cleanup execution flow
surgupta-msft ad21fb9
Added test
surgupta-msft 6e14edf
Adding tests
surgupta-msft a398322
code cleanup
surgupta-msft df76646
Code cleanup
surgupta-msft bc9749f
code refactor
surgupta-msft 0eb9b5f
Added logic to check type before sending to converter
surgupta-msft 6630355
Updated tests
surgupta-msft 15752e9
Removing advertised converters from options
surgupta-msft 1ef5181
Adding options back
surgupta-msft 63af451
Changes to check type
surgupta-msft 29bcb97
updating type check logic
surgupta-msft dfac68e
correction in metadata generation
surgupta-msft 359b38c
code cleanup
surgupta-msft 7211f01
Test cleanup
surgupta-msft b565b45
Added changes to support poco
surgupta-msft 478f7b9
Metadata generation changes
surgupta-msft 0074cbd
Changes on Invocation side
surgupta-msft f06b7dd
correcting type check and tests
surgupta-msft e6b059f
Test for poco invocation support
surgupta-msft 4f8431b
Added tests for poco invocation flows
surgupta-msft 8f88495
Metadata generator minor update
surgupta-msft 5af5a3d
Grpc definition update
surgupta-msft 3aee9e6
Added poco and poco collection check
surgupta-msft 321050d
cleanup metadata generation
surgupta-msft 68b232a
Adding support for type collection
surgupta-msft ac548ee
Merge branch 'feature/sdk-type-binding' into surgupta/bypass-deferred…
surgupta-msft e8ebef0
code cleanup
surgupta-msft c6c922c
Fixing metadata gen
surgupta-msft b34e939
Test fix
surgupta-msft b4c9e17
Grpc definition fix
surgupta-msft 54c1cee
Removing BlobContainerClient advertisement
surgupta-msft 3323177
Readding containerclient
surgupta-msft 12fd136
Updated metadata generator
surgupta-msft deed9ed
Changes as per latest design
surgupta-msft 81f7712
code cleanup
surgupta-msft 5ddcc76
updatin tests input
surgupta-msft 78e4271
code cleanup
surgupta-msft 02ec62f
Cleanup Metadata generation
surgupta-msft 0a6468e
correcting converters fallback logic
surgupta-msft 5073024
Removing converter advertisement on cosmos trigger
surgupta-msft 0136fc7
Fixing failing test
surgupta-msft 053b347
test check in
aishwaryabh f1dece6
Undo testing changes in sample app
surgupta-msft daa23fc
spacing fix
surgupta-msft e918fcd
updated tests
surgupta-msft 4330c7d
non secret changes
aishwaryabh b8b89e0
Addressing PR feedback
surgupta-msft ef812c6
e2e test work
aishwaryabh eda9939
adding comments
aishwaryabh 7ef0a40
Removed json deserialization attribute
surgupta-msft 8391cf2
Rename to AllowConverterFallback
surgupta-msft bac43ab
Addressing feedback
surgupta-msft 3971796
Metada generation cleanup
surgupta-msft b8507af
Test cleanup
surgupta-msft be00b04
Addressing feedback
surgupta-msft 1780981
Updated grpcFunctionDefinition for multiple inputConverterAttribute
surgupta-msft f1bcde0
Removing cosmos converter registration
surgupta-msft 6197db7
Address PR feedback
surgupta-msft 9d803b7
Address PR feedback
surgupta-msft 49e5d04
Test fix
surgupta-msft 6d4978d
Minor
surgupta-msft ef81ba5
addressing comments
aishwaryabh 863a085
adding deferred binding changes
aishwaryabh a610fc7
getting e2e working
aishwaryabh ad3a33c
Implement bypass deferred binding (#1462)
surgupta-msft e44e958
Rebase with base feautre branch
surgupta-msft aea37bc
Build issue fix
surgupta-msft b84b502
comments
aishwaryabh 9528313
Update test/E2ETests/E2EApps/E2EApp/Table/TableInputBindingFunctions.cs
aishwaryabh a03cf63
Adding check for PR in yml file (#1546)
surgupta-msft 4f03d50
addressing some more comments
aishwaryabh 7e407df
Merge branch 'aibhandari/table-converter-legit' of https://github.com…
aishwaryabh 8a84657
dependency
aishwaryabh 2d1cbbd
one more dependency
aishwaryabh 86d0a6c
trying to compile lol
aishwaryabh ee8cca4
seeing if tables project compiles with dependency
aishwaryabh 5b8fe06
removing local instance
aishwaryabh 702b4c6
see if this compiles
aishwaryabh df5430e
trying to remove test
aishwaryabh 5ba7205
nvm adding it back
aishwaryabh 625b2ba
adding keys to nuget.config
aishwaryabh 07804eb
trying to get feed
aishwaryabh e07c983
trying again
aishwaryabh e753271
more yml
aishwaryabh 561349e
fixing spacing
aishwaryabh 1628a95
ci.yml
aishwaryabh 14f203e
Add ability to bind to SBReceivedMessage (#1313)
JoshLove-msft a8e8897
another change
aishwaryabh eb6ac69
Merge branch 'feature/sdk-type-binding' into aibhandari/table-convert…
aishwaryabh 43e5394
trying again
aishwaryabh ef088f7
Merge branch 'aibhandari/table-converter-legit' of https://github.com…
aishwaryabh eb2ae14
formatting changes
aishwaryabh 6e52dc7
merging
aishwaryabh bbff7a9
changes
aishwaryabh 7683684
updating worker.sdk package
aishwaryabh bcd3107
fixing unit test
aishwaryabh 904d3e7
getting unit tests to pass
aishwaryabh 276f803
fixing test
aishwaryabh b05e4af
release notes
aishwaryabh f4540ab
addressing comments
aishwaryabh 7cccefa
changing cs proj version
aishwaryabh b08f877
changes
aishwaryabh 270d7fd
fixing build error
aishwaryabh 5656c0b
addressing comments
aishwaryabh 0e6dc40
fix e2e test
aishwaryabh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
extensions/Worker.Extensions.Tables/src/Config/TablesBindingOptions.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // Copyright (c) .NET Foundation. All rights reserved. | ||
| // Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
|
||
| using System; | ||
| using Azure.Core; | ||
| using Azure.Data.Tables; | ||
|
|
||
| namespace Microsoft.Azure.Functions.Worker.Extensions.Tables.Config | ||
| { | ||
| internal class TablesBindingOptions | ||
| { | ||
| public string? ConnectionString { get; set; } | ||
|
|
||
| public Uri? ServiceUri { get; set; } | ||
|
|
||
| public TokenCredential? Credential { get; set; } | ||
|
|
||
| public TableClientOptions? TableClientOptions { get; set; } | ||
|
|
||
| private TableServiceClient? TableServiceClient; | ||
|
|
||
| internal virtual TableServiceClient CreateClient() | ||
| { | ||
| if (ConnectionString is null && ServiceUri is null) | ||
| { | ||
| throw new ArgumentNullException(nameof(ConnectionString) + " " + nameof(ServiceUri)); | ||
| } | ||
|
|
||
| if (TableServiceClient is not null) | ||
| { | ||
| return TableServiceClient; | ||
| } | ||
|
|
||
| TableServiceClient = !string.IsNullOrEmpty(ConnectionString) | ||
| ? new TableServiceClient(ConnectionString, TableClientOptions) // Connection string based auth; | ||
| : new TableServiceClient(ServiceUri, Credential, TableClientOptions); // AAD auth | ||
|
|
||
| return TableServiceClient; | ||
| } | ||
| } | ||
| } |
59 changes: 59 additions & 0 deletions
59
extensions/Worker.Extensions.Tables/src/Config/TablesBindingOptionsSetup.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| using System; | ||
| using Azure.Data.Tables; | ||
| using Microsoft.Extensions.Azure; | ||
| using Microsoft.Extensions.Configuration; | ||
| using Microsoft.Extensions.Options; | ||
|
|
||
| namespace Microsoft.Azure.Functions.Worker.Extensions.Tables.Config | ||
| { | ||
| internal class TablesBindingOptionsSetup : IConfigureNamedOptions<TablesBindingOptions> | ||
| { | ||
| private readonly IConfiguration _configuration; | ||
| private readonly AzureComponentFactory _componentFactory; | ||
|
|
||
| private const string TablesServiceUriSubDomain = "table"; | ||
|
|
||
| public TablesBindingOptionsSetup(IConfiguration configuration, AzureComponentFactory componentFactory) | ||
| { | ||
| _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); | ||
| _componentFactory = componentFactory ?? throw new ArgumentNullException(nameof(componentFactory)); | ||
| } | ||
|
|
||
| public void Configure(TablesBindingOptions options) | ||
| { | ||
| Configure(Options.DefaultName, options); | ||
| } | ||
|
|
||
| public void Configure(string name, TablesBindingOptions options) | ||
| { | ||
| if (string.IsNullOrWhiteSpace(name)) | ||
| { | ||
| name = Constants.Storage; // default | ||
| } | ||
|
|
||
| IConfigurationSection connectionSection = _configuration.GetWebJobsConnectionStringSection(name); | ||
|
|
||
| if (!connectionSection.Exists()) | ||
| { | ||
| // Not found | ||
| throw new InvalidOperationException($"Tables connection configuration '{name}' does not exist. " + | ||
| "Make sure that it is a defined App Setting."); | ||
| } | ||
|
|
||
| if (!string.IsNullOrWhiteSpace(connectionSection.Value)) | ||
| { | ||
| options.ConnectionString = connectionSection.Value; | ||
| } | ||
| else | ||
| { | ||
| if (connectionSection.TryGetServiceUriForStorageAccounts(TablesServiceUriSubDomain, out Uri serviceUri)) | ||
| { | ||
| options.ServiceUri = serviceUri; | ||
| } | ||
| } | ||
|
|
||
| options.TableClientOptions = (TableClientOptions)_componentFactory.CreateClientOptions(typeof(TableClientOptions), null, connectionSection); | ||
|
aishwaryabh marked this conversation as resolved.
|
||
| options.Credential = _componentFactory.CreateTokenCredential(connectionSection); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
|
|
||
| namespace Microsoft.Azure.Functions.Worker.Extensions.Tables | ||
| { | ||
| internal class Constants | ||
| { | ||
| internal const string Storage = "Storage"; | ||
| internal const string TablesExtensionName = "AzureStorageTables"; | ||
| internal const string TableName = "TableName"; | ||
| internal const string PartitionKey = "PartitionKey"; | ||
| internal const string RowKey = "RowKey"; | ||
| internal const string Connection = "Connection"; | ||
| internal const string Take = "Take"; | ||
| internal const string Filter = "Filter"; | ||
| // Media content types | ||
| internal const string JsonContentType = "application/json"; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <configuration> | ||
| <packageSources> | ||
| <clear /> | ||
| <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> | ||
| </packageSources> | ||
| </configuration> |
7 changes: 5 additions & 2 deletions
7
extensions/Worker.Extensions.Tables/src/Properties/AssemblyInfo.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,9 @@ | ||
| // Copyright (c) .NET Foundation. All rights reserved. | ||
| // Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
|
||
| using Microsoft.Azure.Functions.Worker.Extensions.Abstractions; | ||
| using System.Runtime.CompilerServices; | ||
| using Microsoft.Azure.Functions.Worker.Extensions.Abstractions; | ||
|
|
||
| [assembly: ExtensionInformation("Microsoft.Azure.WebJobs.Extensions.Tables", "1.0.0")] | ||
| [assembly: ExtensionInformation("Microsoft.Azure.WebJobs.Extensions.Tables", "1.2.0-beta.1")] | ||
| [assembly: InternalsVisibleTo("Microsoft.Azure.Functions.WorkerExtension.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001005148be37ac1d9f58bd40a2e472c9d380d635b6048278f7d47480b08c928858f0f7fe17a6e4ce98da0e7a7f0b8c308aecd9e9b02d7e9680a5b5b75ac7773cec096fbbc64aebd429e77cb5f89a569a79b28e9c76426783f624b6b70327eb37341eb498a2c3918af97c4860db6cdca4732787150841e395a29cfacb959c1fd971c1")] | ||
| [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] | ||
|
aishwaryabh marked this conversation as resolved.
|
||
36 changes: 36 additions & 0 deletions
36
extensions/Worker.Extensions.Tables/src/TableExtensionStartup.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // Copyright (c) .NET Foundation. All rights reserved. | ||
| // Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
|
||
| using System; | ||
| using Microsoft.Azure.Functions.Worker; | ||
| using Microsoft.Azure.Functions.Worker.Core; | ||
| using Microsoft.Azure.Functions.Worker.Extensions.Tables.Config; | ||
| using Microsoft.Extensions.Azure; | ||
| using Microsoft.Extensions.DependencyInjection; | ||
| using Microsoft.Extensions.Options; | ||
|
|
||
| [assembly: WorkerExtensionStartup(typeof(TableExtensionStartup))] | ||
|
|
||
| namespace Microsoft.Azure.Functions.Worker | ||
| { | ||
| /// <summary> | ||
| /// Table extension startup. | ||
| /// </summary> | ||
| public class TableExtensionStartup : WorkerExtensionStartup | ||
| { | ||
| /// <summary> | ||
| /// Configure table extension startup. | ||
| /// </summary> | ||
| public override void Configure(IFunctionsWorkerApplicationBuilder applicationBuilder) | ||
| { | ||
| if (applicationBuilder == null) | ||
| { | ||
| throw new ArgumentNullException(nameof(applicationBuilder)); | ||
| } | ||
|
|
||
| applicationBuilder.Services.AddAzureClientsCore(); // Adds AzureComponentFactory | ||
| applicationBuilder.Services.AddOptions<TablesBindingOptions>(); | ||
| applicationBuilder.Services.AddSingleton<IConfigureOptions<TablesBindingOptions>, TablesBindingOptionsSetup>(); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.