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

Cosmos DB initialization logic to a new assembly #3743

Merged

Conversation

mahajan-xor
Copy link
Contributor

Description

a) Changes done on existing Microsoft.Health.Fhir.CosmosDb Project]

1.Icollectionupdater copied to Istoreprocedure in cosmos db old project
2.older Istoreprocedure logic moved to new project with filename IStoredProcedureInstaller
3.StoredProcedureInstaller.cs removed from old db(Microsoft.Health.Fhir.CosmosDb) and moved this logic to new project with filename DataPlaneStoredProcedureInstaller.cs
4.Configs folder contains classes like CosmosDataStoreConfiguration,CosmosCollectionConfiguration moved to Microsoft.Health.Fhir.CosmosDb.Core project
5.Following classes moved to Microsoft.Health.Fhir.CosmosDb.Core project
-SystemData
-KnownDocumentProperties
-ICollectionUpdater
-CollectionVersion
-CollectionUpgradeManager
-IUpgradeManager
-CollectionInitializer : we have removed depenedancy for RetryExceptionPolicyFactory in constructor
-ICollectionInitializer
-CosmosClientExtensions
-ICosmosDbDistributedLock
-ICosmosDbDistributedLockFactory
-ICosmosClientTestProvider

  1. Following existing Classes/interfaces modified
    -ICosmosClientInitializer
    -FhirCosmosClientInitializer
    -CosmosDbFhirStorageTestsFixture
    // TODO: TODO: need modify this class to call new CosmosDB .Initialization functions
    // now some existing call are commented
    -CosmosContainerProvider
    // TODO: TODO: need modify this class to call new CosmosDB .Initialization functions
    // now some existing call are commented

b) New Microsoft.Health.Fhir.CosmosDb.Initialization project added
-Initialization of cosmos DB functionality moved here

  • Moved Storeprocedure installation logic here Added classes like
    DataPlaneStoredProcedureInstaller,StoredProcedureMetadataBase
  • Also we have DataPlaneCollectionSetup class which will implement following methods
    -CreateDatabaseAsync
    • CreateCollection
      -UpdateFhirCollectionSettings

c)Unit Test Project Added Microsoft.Health.Fhir.CosmosDb.Initialization.UnitTests project

d)Also Added Microsoft.Health.Fhir.CosmosDb.Core project

  • We have moved common functionalities from Microsoft.Health.Fhir.CosmosDb project

Related issues

User Story 112343: [Cosmos][OSS] Move Cosmos DB initialization logic to a new assembly

Testing

NA

FHIR Team Checklist

  • Update the title of the PR to be succinct and less than 65 characters
  • Add a milestone to the PR for the sprint that it is merged (i.e. add S47)
  • Tag the PR with the type of update: Bug, Build, Dependencies, Enhancement, New-Feature or Documentation
  • Tag the PR with Open source, Azure API for FHIR (CosmosDB or common code) or Azure Healthcare APIs (SQL or common code) to specify where this change is intended to be released.
  • Tag the PR with Schema Version backward compatible or Schema Version backward incompatible or Schema Version unchanged if this adds or updates Sql script which is/is not backward compatible with the code.
  • CI is green before merge Build Status
  • Review squash-merge requirements

Semver Change (docs)

Patch|Skip|Feature|Breaking (reason)

1.Icollectionupdater copied to Istoreprocedure in cosmos db old project
2.older Istoreprocedure logic moved to new project with filename IStoredProcedureInstaller
3.StoredProcedureInstaller.cs removed from old db(Microsoft.Health.Fhir.CosmosDb) and moved this logic to new project with filename DataPlaneStoredProcedureInstaller.cs
4.Configs folder contains classes like CosmosDataStoreConfiguration,CosmosCollectionConfiguration moved to Microsoft.Health.Fhir.CosmosDb.Core project
5.Following classes moved to Microsoft.Health.Fhir.CosmosDb.Core project
   -SystemData
   -KnownDocumentProperties
   -ICollectionUpdater
   -CollectionVersion
   -CollectionUpgradeManager
   -IUpgradeManager
   -CollectionInitializer : we have removed depenedancy for RetryExceptionPolicyFactory in constructor
   -ICollectionInitializer
   -CosmosClientExtensions
   -ICosmosDbDistributedLock
   -ICosmosDbDistributedLockFactory
   -ICosmosClientTestProvider

6. Following existing Classes/interfaces modified
   -ICosmosClientInitializer
   -FhirCosmosClientInitializer
   -CosmosDbFhirStorageTestsFixture
          // TODO: TODO: need modify this class to call new CosmosDB .Initialization functions
          // now some existing call are commented
   -CosmosContainerProvider
           // TODO: TODO: need modify this class to call new CosmosDB .Initialization functions
          // now some existing call are commented

b) New Microsoft.Health.Fhir.CosmosDb.Initialization project added
   -Initialization of cosmos DB functionality moved here
   - Moved Storeprocedure installation logic here Added classes like
     DataPlaneStoredProcedureInstaller,StoredProcedureMetadataBase
   - Also we have DataPlaneCollectionSetup class which will implement following methods
       -CreateDatabaseAsync
       - CreateCollection
       -UpdateFhirCollectionSettings

c)Unit Test Project Added Microsoft.Health.Fhir.CosmosDb.Initialization.UnitTests project

d)Also Added Microsoft.Health.Fhir.CosmosDb.Core project
  - We have moved common functionalities from Microsoft.Health.Fhir.CosmosDb project

#User Story 112343: [Cosmos][OSS] Move Cosmos DB initialization logic to a new assembly
@mahajan-xor mahajan-xor added Enhancement Enhancement on existing functionality. Azure API for FHIR Label denotes that the issue or PR is relevant to the Azure API for FHIR labels Mar 11, 2024
@mahajan-xor mahajan-xor added this to the S136 milestone Mar 11, 2024
@mahajan-xor mahajan-xor requested a review from fhibf March 11, 2024 11:00
@mahajan-xor mahajan-xor requested a review from a team as a code owner March 11, 2024 11:00
 -StoredProcedureBase
 -IStoredProcedure
 -IStoredProcedureMetadata
 -StoredProcedureMetadata

Moved to CosmosDB.Initialization:
 -UpdateUnsupportedSearchParameters
 -FhirCollectionSettingsUpdater
2.Replaced ICollectionUpdater with ICollectionDataUpdater in CosmosDbSearchParameterStatusInitializer
3.moved else part logic from FhirCollectionSettingsUpdater to CosmosDbSearchParameterStatusInitializer
4.FhirCollectionSettingsUpdater  is removed from solution
@brendankowitz
Copy link
Member

-Adding simple threadsafe logic for creating CosmosClient instance
@mahajan-xor mahajan-xor merged commit 6f07bfc into main Jul 4, 2024
47 checks passed
@mahajan-xor mahajan-xor deleted the personal/anilm/fhir-cosmosdbinitialization-newassembly branch July 4, 2024 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure API for FHIR Label denotes that the issue or PR is relevant to the Azure API for FHIR Enhancement Enhancement on existing functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants