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

CosmosDbPartitionedStorage using v3 SDK. #2613

Merged
merged 5 commits into from
Oct 1, 2019
Merged

Conversation

garypretty
Copy link
Contributor

@garypretty garypretty commented Sep 27, 2019

Addresses DCR #5467 microsoft/botframework-sdk#5467

@cleemullins @mdrichardson This is the initial version of the new CosmosDbPartitionedStorage class - I would appreciate your review before I move any further forward.

  • The new implementation no longer handles database creation. We only handle container creation.
  • Uses the new v3 SDK
  • Implements partitioning for the user, with the option to pass in a key now gone. We utilize the ID of the item as the partition key.

Tests still need adding following initial review.

@mdrichardson
Copy link
Contributor

mdrichardson commented Sep 27, 2019

CC: @cleemullins

@garypretty I should've mentioned this yesterday and haven't read through the code enough to see if this is being addressed, but one MAJOR issue with not handling database creation is that Azure Portal requires a user to enter a PartitionKeyPath. It would be very easy for them to set the wrong one. We'd either need really good error reporting or some way to proactively let the user know what PartitionKeyPath to set (docs maybe, but they're not read enough, usually)

Edit: I am the dumb.

@garypretty
Copy link
Contributor Author

@mdrichardson Database creation in the Azure portal doesn't require the partition key path - container creation does (at least from my testing so far). We handle the container, but the user handles the master database.

@mdrichardson
Copy link
Contributor

@garypretty Ah, shoot. You're right. Disregard.

@fuselabs
Copy link
Collaborator

✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.AI.Luis.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.AI.QnA.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.ApplicationInsights.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.Azure.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.Dialogs.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.TemplateManager.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Configuration.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Connector.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Schema.dll compared against version 4.3.1

@mdrichardson
Copy link
Contributor

LGTM. Read, Write, and Delete all worked. When writing tests for this, I wouldn't base them off of the existing PartitionKey tests...they don't accurately reflect how the SDK works.

@mdrichardson mdrichardson marked this pull request as ready for review September 27, 2019 16:14
@fuselabs
Copy link
Collaborator

✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.AI.Luis.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.AI.QnA.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.ApplicationInsights.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.Azure.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.Dialogs.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.TemplateManager.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Configuration.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Connector.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Schema.dll compared against version 4.3.1

Copy link
Contributor

@mdrichardson mdrichardson left a comment

Choose a reason for hiding this comment

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

Needs tests. Removing approval.

@garypretty
Copy link
Contributor Author

@mdrichardson I have now added tests. I am running all of the base storage tests and all tests are passing. Also made an amendment to the storage class itself to handle reading multiple keys (I realize this isn't something we do at the moment, but I wanted to ensure consistency between the different storage providers).

@coveralls
Copy link
Collaborator

coveralls commented Sep 30, 2019

Pull Request Test Coverage Report for Build 81133

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 162 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-2.4%) to 78.281%

Files with Coverage Reduction New Missed Lines %
/libraries/Microsoft.Bot.Builder/ConversationState.cs 1 80.0%
/libraries/Microsoft.Bot.Builder/UserState.cs 1 80.0%
/libraries/Microsoft.Bot.Builder/PrivateConversationState.cs 2 66.67%
/libraries/Microsoft.Bot.Builder/TelemetryLoggerMiddleware.cs 2 98.4%
/libraries/Microsoft.Bot.Builder/ActivityHandler.cs 4 85.71%
/libraries/Microsoft.Bot.Builder/Integration/BotFrameworkOptions.cs 4 58.33%
/libraries/Microsoft.Bot.Builder/TurnContext.cs 4 89.47%
/libraries/Microsoft.Bot.Builder/BotState.cs 10 85.87%
/libraries/Microsoft.Bot.Builder/BotFrameworkAdapter.cs 134 39.1%
Totals Coverage Status
Change from base Build 80657: -2.4%
Covered Lines: 4455
Relevant Lines: 5691

💛 - Coveralls

@fuselabs
Copy link
Collaborator

✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.AI.Luis.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.AI.QnA.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.ApplicationInsights.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.Azure.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.Dialogs.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.TemplateManager.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Configuration.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Connector.dll compared against version 4.3.1
✔️ No Binary Compatibility issues for Microsoft.Bot.Schema.dll compared against version 4.3.1

Copy link
Contributor

@mdrichardson mdrichardson left a comment

Choose a reason for hiding this comment

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

LGTM. Ran all of the tests and watched storage change appropriately as the tests hit a number of breakpoints. Good stuff!

@garypretty garypretty changed the title [WIP] CosmosDbPartitionedStorage using v3 SDK. CosmosDbPartitionedStorage using v3 SDK. Sep 30, 2019
@garypretty garypretty merged commit 2c06372 into master Oct 1, 2019
@garypretty
Copy link
Contributor Author

New partitioned storage provider now in C# with other language implementations following shortly.

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