Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

[SDK][Bot-Azure] Add CosmosDbPartitionedStorage component #1024

Conversation

VictorGrycuk
Copy link
Contributor

Fixes #739

Description

Implements support for CosmosDbPartitionedStorage class and its tests.

Specific Changes

Adds the following classes:

  • CosmosDbPartitionedStorage
  • CosmosDbPartitionedStorageOptions
  • CosmosDbKeyEscape
  • Updates the pom.xml file with the necessary dependencies
  • Adds the necessary tests for the CosmosDbPartitionedStorage and CosmosDbKeyEscape classes

Testing

Unit tests of bot-azure passing correctly
image

mvn clean install passing correctly
image

@VictorGrycuk VictorGrycuk marked this pull request as ready for review February 26, 2021 18:16
@VictorGrycuk
Copy link
Contributor Author

@tracyboehrer we noticed that the build is failing, most likely due to the bot-azure tests.

Those unit tests contain the following requirements to be executed:

  1. CosmosDbEmulator application:
    1. On BotBuilder-DotNet we found a commented configuration for starting CosmosDBEmulator that was added in Add 2 YAML builds for DotNet CI botbuilder-dotnet#3115. Then disabled in PR make running storage emulators disabled on build server botbuilder-dotnet#3815 because of unreliability due to time-outs. Finally re-enabled in Re-Enable CosmosDB tests that have been disabled botbuilder-dotnet#3816 to find a solution.
    2. On BotBuilder-JS we found a cmd file that initializes the CosmosDbEmulator as a preparation of the tests, as indicates this document.
  2. CosmosDbEmulator certificates: after starting the emulator and running the unit tests for CosmosDbPartitionedStorage we go the following message:

javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

This is because Java needs the CosmosDbEmulator certificate in its cacert. We solved this by following this guide, which basically involves exporting the CosmosDbEmulator certificate, and importing it to the Java cacert repository.

We don't have permissions to analyze the build pipeline, however, let us know if you need help from our side for this 😊.

@VictorGrycuk
Copy link
Contributor Author

@tracyboehrer we removed the following files as they are generated during the build:

  • DocumentDB.Spatial.Sql.dll
  • Microsoft.Azure.Documents.ServiceInterop.dll

We noticed that the .gitignore is missing a configuration for these files. Do you want us to add an entry in the configuration to ignore these binaries?

@tracyboehrer
Copy link
Member

tracyboehrer commented Feb 26, 2021

@VictorGrycuk So these unit tests require the cosmosdb emulator and that appears to be why the PR build is failing. I need to look into how DotNet is dealing with this.

@tracyboehrer tracyboehrer reopened this Feb 26, 2021
@tracyboehrer tracyboehrer reopened this Feb 26, 2021
@tracyboehrer tracyboehrer merged commit 5066b57 into microsoft:main Feb 26, 2021
@tracyboehrer
Copy link
Member

@VictorGrycuk For the time being, I disabled running one of the unit tests for this in DevOps. This isn't a permanent solution, but we'll have to do some more research on our side. If you have the emulator installed, it will still run the unit tests as before. For DevOps, or if you try to run mvn and you DON'T have the emulator installed, you must include the following mvn options:

-Dtest=!CosmosDbPartitionStorageTests* -DfailIfNoTests=false

Not sure I really like this solution, but it does have the advantage of annoying me enough to provide motivation to solve the problem for real.

@Batta32 Batta32 deleted the internal/southworks/CosmosDBPartitionedStorage/base branch March 1, 2021 12:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bot-azure, CosmosDBPartitionedStorage
3 participants