Граф коммитов

819 Коммитов

Автор SHA1 Сообщение Дата
nathan 1d80f9a0e5
bug(logging): add full exception to logging (#4645)
* bug(logging): add full exception to logging

* - remove stack trace from operation exceptions thrown

---------

Co-authored-by: Nathan Lemma (Waferwire LLC) <v-nlemma@microsoft.com>
2024-09-27 11:25:16 -07:00
v-iyamauchi 979b81ebca
Making export type filter validation optional. (#4639)
* Making export type filter validation optional.

* Removing unnecessary namespaces.

* Updating ValidateExportRequestFilterAttribute to handle strict/lenient mode.

* Fixing some bugs and adding more test
2024-09-24 13:54:24 -07:00
Brendan Kowitz b0462352c0
Integration tests use DevOps MI for Cosmos (#4369)
* Base changes for Cosmos MI in Integration Tests
* Get the ADServicePrincipal id
* Pass through test-mi variables
2024-09-24 09:22:26 -07:00
Mikael Weaver 5f6c02c053
Continue reindex when encountering empty page (#4627)
* Added logic for empty reindex pages

* update tests

* fix null hash test issue

* Fixed version for reindex test

* sql reindex search improvement

* logging syntax

* fix issue where loop goes past ranges length

* code simplification
2024-09-20 16:11:00 -07:00
v-iyamauchi 1c09493ba4
Adding validation on $export type filters. (#4617)
* Adding validation on $export type filters.

* Addressing reviewer's comment.
2024-09-19 10:43:13 -07:00
Robert Johnson d6793b97cd
Pagination Fix (#4613) 2024-09-16 13:12:23 -07:00
dependabot[bot] 873d1d4c3b
Bump xunit from 2.8.1 to 2.9.0 (#3954)
* Bump xunit from 2.8.1 to 2.9.0

Bumps xunit from 2.8.1 to 2.9.0.

---
updated-dependencies:
- dependency-name: xunit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix test build issues

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mikael Weaver <mikael.weaver@microsoft.com>
Co-authored-by: Mikael Weaver <mikaelw@microsoft.com>
Co-authored-by: Jared Erwin <jaerwin@microsoft.com>
2024-09-16 11:08:29 -07:00
Brendan Kowitz 66ba9a5ef0
[Feature] Changes Cosmos to use MI connection (#4026)
* Cosmos OSS MI
* Update to install procs with ARM
* Refactored cosmos initialization
2024-09-05 21:10:52 -07:00
v-iyamauchi 5552a7bcc3
Fixing an IsDeleted issue on import/history. (#4473)
* Fixing an IsDeleted issue on import/history.

* Changing the verb to PUT.

* Getting the isDeleted status from ResourceWrapper instead of caching the wrapper object.
2024-08-29 13:30:22 -07:00
Fernando Henrique Inocêncio Borba Ferreira 8cef9b64b5
[SQL] Adding logs to SqlRetryService (#4233)
* Better logs in SqlRetryServicer

* Fix error in tests.
2024-08-20 17:18:17 -04:00
SergeyGaluzo c7af53017b
Better test (#4019)
* Better test

* 3 retries

* rearrange

* rearrange
2024-08-20 11:54:34 -07:00
Robert Johnson ac8b3abb49
Export memory improvements (#4001) 2024-08-07 13:44:06 -07:00
SergeyGaluzo 0706bc94c7
Fixing flaky query plan test (#3994)
* reset in the end

* 1 sec

* 5

* tweak

* delay before query

* more waits
2024-08-02 11:11:24 -07:00
SergeyGaluzo f3c5b16d35
Add database setting to reuse query plans (#3991)
* Disabling EXISTS

* Comment

* spelling

* Removed not used parameter currentSearchParametersHash

* Database setting to reuse query plans

* fix tests

* fix tests

* Fixed typo

* reverting exists

* Tests
2024-07-30 14:38:32 +00:00
SergeyGaluzo 6543dd4c02
Log Connection.Open() duration (#3977)
* Log Connection.Open() duration

* Added read-only

* space

* Fix tests

* comment
2024-07-25 12:15:20 -07:00
Mikael Weaver 6e566e13d2
Remove Storage Account Keys and SQL Passwords from Tests (#3959)
* Update sql server password to MI

* remove admin password from provision-sqlServer build

* remove sqlAdminPassword from pipeline parameters

* revert pipeline changes, add user managed identity

* remove sql admin password from provision-deploy

* remove sql admin password from pr-pipeline

* remove sql admin password from pipeline

* create identity with sql server

* change uami name

* update api version

* updated uami

* change app plan name to managed identity name

* remove storage account properties

* add storage account properties

* remove conditional uami

* key vault depends on sql server

* existing sql server

* revert

* remove update random number

* add back update random

* remove all update random in pr-pipeline

* update from main

* testing v1 no access keys

* disable storage keys in deployment template

* testing AzurePipelinesCredential

* Removing role assignment for now to test tests

* add role assignment for agent to access tests

* Testing login via workload identity

* testing workload identity access on storage

* fixed issue with persisting workload itentity vars

* moved storage assignment temp

* fix token file writing issue

* fix temp change for test

* add back pipeline steps for test

* fix token file gen

* add logging to generate-federated-token-file

* fix ai coding mistake :P

* testing separate SQL server for integration tests

* removed try catch for storage role

* fixed client id for sql server int tests

* fixing variable to get client id

* fix var name

* fix role assignment rensource group

* fixed federated sql server admin

* changed where identity is created

* fix pipeline issues

* fixed template error

* add agent ip for int test server

* fix int sql test connect

* Added custom SQL auth for azure pipelines workload identity

* simplified the custom sql auth provider

* fix case sensitivity issue projitems

* fixed storage credential

* fixing tests

* cleanup pipelines

* merge issues / delete tests not working

* CI and PR pipeline fixes

* add sqlServerNewExisting to pipeline

* fix pipeline issues

* pr pipeline errors

* fix testR4 stage

* uami parameter issue

* fix tests after merge

* simplify SQL deploy

* fixing variable issue

* fix sql deploy

* fix ci deploy typo

* cleanup

* pipeline typo

---------

Co-authored-by: aponakampalli <ponakampalli.a@northeastern.edu>
Co-authored-by: Adithi Ponakampalli <120080886+aponakampalli@users.noreply.github.com>
2024-07-15 08:38:12 -07:00
mahajan-xor 6f07bfc1af
Cosmos DB initialization logic to a new assembly (#3743)
* 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

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

* versions updated for some packages

* Moved to CosmosDB.Core
 -StoredProcedureBase
 -IStoredProcedure
 -IStoredProcedureMetadata
 -StoredProcedureMetadata

Moved to CosmosDB.Initialization:
 -UpdateUnsupportedSearchParameters
 -FhirCollectionSettingsUpdater

* 1. Added ICollectionDataUpdater interface in cosmosdb project
2.Replaced ICollectionUpdater with ICollectionDataUpdater in CosmosDbSearchParameterStatusInitializer
3.moved else part logic from FhirCollectionSettingsUpdater to CosmosDbSearchParameterStatusInitializer
4.FhirCollectionSettingsUpdater  is removed from solution

* worked on code review comments

* worked on review comments and cleaned up code

* done with end to end flow testing with CosmosDbFhirStorageTestsFixture class

* resolved installed storeprocedure issue

* Unit test cases updated . DataPlaneCosmosDbRegistarionExtensions issue is resolved

* resolved build issue for hardDelete

* identity package updated to latest version to solve vulnerability issue

* Solve the test failures in PR
Disconnect ICollectionSetup from CosmosClient and Container.

* fixed review comments

* solved issues with unit test

* Added new project refrences to docker file

* updated docker file

* removed extra call to fhircollectionsetting updater

* Refactoring to avoid circle dependency (#3877)

* merging refatoring changes with local branch

* solved merge issues

* fixes namespace issue for Core.Resources

* resolves unit test issue for FHIRCosmosClientInitializer

* Resolves unite test issues

* added missing decorators on DataPlaneCollectionSetupTests

* work on review comments

* Adds classification attibutes

* -Adding newly added project references to R4.slnf and R5.slnf
-Adding simple threadsafe logic for creating CosmosClient instance

* refactoring CreateCosmosClient logic to have validation logic

---------

Co-authored-by: Fernando Henrique Inocêncio Borba Ferreira <fernfe@microsoft.com>
2024-07-04 10:55:39 +05:30
Mikael Weaver a8bd487f1d
Changed search parameter init to run every schema upgrade (#3926)
* Updated search parameters init to run for every schema upgrade on uninitialized search params

* Added tests for invalid search parameters

* fix logging statement

* code scanning fixes

* fix shproj

* removed unneeded init param

* fix method signature

* remove unneeded using
2024-06-18 22:18:35 +00:00
Jared Erwin 84afe6e984
Combine pairs of DateTime predicates on the same search parameter (#3903)
Combine pairs of DateTime predicates on the same search parameter for better performance of datetime between queries

Refs AB#121039
2024-06-18 11:14:15 -07:00
Jared Erwin 3324d7299e
Add IsDeleted check in search queries (#3925)
Add IsDeleted check in search queries to avoid returned deleted resources in :not queries

Refs #3920 AB#121553
2024-06-17 10:57:22 -07:00
SergeyGaluzo e5c679d7a6
Fix for timing out SQL integration tests (#3917)
* Add version

* reduced timeout on delete and reduced retries on create

* new name

* force unique database name

* one more unique name

* disable drop

* Semaphore removed

* skip drop if azure

* 100 on custom query

* SQL Azure in correct order

* oops

* simpler is azure

* revert semaphore

* semaphore 32

* 14

* Removed unneccessary interpolation

* Update test/Microsoft.Health.Fhir.Shared.Tests.Integration/Features/ChangeFeed/SqlServerFhirResourceChangeCaptureDisabledTests.cs

Co-authored-by: Brendan Kowitz <bkowitz@microsoft.com>

* Drop dbs yml

* simple loop

* adjusted min version

* drop in separate job

* 120->240

* True fix

* Removed delete job

---------

Co-authored-by: Brendan Kowitz <bkowitz@microsoft.com>
2024-06-17 08:53:50 -07:00
dependabot[bot] 8732d0f3ca
Bump xunit from 2.5.0 to 2.8.1 (#3599)
* Bump xunit from 2.5.0 to 2.6.2

Bumps [xunit](https://github.com/xunit/xunit) from 2.5.0 to 2.6.2.
- [Commits](https://github.com/xunit/xunit/compare/2.5.0...2.6.2)

---
updated-dependencies:
- dependency-name: xunit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update to newest ersion

* Updated all xunit packages

* fixed code analysis issues with xunit upgrade

* fixed whenall exception

* use paraent cancellation exception

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Abigail Nicolas Sayago <abigailn@microsoft.com>
Co-authored-by: Mikael Weaver <mikael.weaver@microsoft.com>
Co-authored-by: Mikael Weaver <mikaelw@microsoft.com>
2024-06-12 08:41:52 -07:00
SergeyGaluzo f93d919379
Refactor last updated deduping after UTC change (#3890)
* Deduping last updated against the database

* Fast tests

* removed not used var

* Ignore input version

* corr

* sharing enabled logic

* private

* readonly

* Reset version in resource

* corect consolidation

* Removed date

* readonly

* readonly

* back
2024-06-03 09:43:30 -07:00
SergeyGaluzo 0d443c0bf2
Surrogate id from UTC (#3879)
* Surrogate id from utc

* Test
2024-05-30 16:33:55 -07:00
Mikael Weaver bec76c4585
Fix Flaky History Test (#3887)
* Trying to fix flaky history test

* Changed loop to when all

* Changed to compare lastUpdated for each request.

* small formatting fix

* fix test
2024-05-30 14:44:59 -07:00
SergeyGaluzo 8968ae145c
Negative versions (#3840)
* conflict retries test

* extra dedup plus tests

* bad request

* better date

* more import deduping

* 80

* 80

* dedup against db

* better stored proc

* comment

* 81

* merge

* item group back

* -CR

* 81

* 81

* set version on create is back

* naming and nicer

* Create meta for last updated testing

* add last updated to batching

* events test

* identifier

* Fixed old test bug

* Conflicts on out of order versions

* sync

* More tests and Exception

* Pass explicit keppLastUpdated

* -Version in doc

* Description change

* Added test 1-8-9-10

* move to loaded

* correct date comparison

* Add milliseconds truncation logic to import parser

* Add truncate to millisecond to the tests

* Removed filter on negative version in parser

* _

* negatives are history and no conflict.

* preserve offset

* corrections for negative versions

* Special logic to load negatives

* Latest negative test

* Ignore input negatives if not allowed
2024-05-28 14:14:13 -07:00
Brendan Kowitz 441fd71106
Fixes for Bundle Routing (#3822)
* Evaluate Routing constraints when processing bundles
* Adding tests to validate bundle internal calls to _history and _history/version.

---------

Co-authored-by: Fernando Henrique Inocêncio Borba Ferreira <fernfe@microsoft.com>
2024-05-13 09:24:51 -07:00
Brendan Kowitz 4a1b5eea60
Improve flaky integration tests (#3836) 2024-05-07 14:54:57 -07:00
SergeyGaluzo 7aebd75851
Return bad request on too many surrogate ids (#3838)
* conflict retries test

* extra dedup plus tests

* bad request

* better date
2024-05-06 09:18:03 -07:00
Robert Johnson 6e4612e242
Add new health check for improper behavior (#3818) 2024-04-25 11:45:57 -07:00
Fernando Henrique Inocêncio Borba Ferreira 769ce40d76
[Metrics] FHIR metric emitter (#3753)
* Adding default metric emitter

* Fix using statements

* Improve metric emission

* Refactoring metric emitters

* Using statements updated

* New tests to test if methods have the metric emitter filters and remove reference to log in FhirController

* Removed not used code

* Renamining classes with better names

* New metric handler implementation.

* Refactoring interfaces and adding more tests.

* Following coding suggestions.
2024-04-25 10:20:03 -07:00
SergeyGaluzo f9e520c293
Remove garbage stored procedure plus test (#3820)
* Remove garbage stored procedure

* data type conversion test

* using
2024-04-20 00:47:18 +00:00
SergeyGaluzo 622932a475
cleanup signatures (remove heavy heartbeats) (#3817)
* extra cleanup

* started

* 78
2024-04-18 08:40:03 -07:00
Mikael Weaver acdf8a4650
Update import to return bad requset for duplicate input (#3763)
* Changnd import dupliate file to bad request

* Added check on input controller for duplicate files.

* Update tests for handling at controller

* Updated error message

* Changed unit test to check for input url

* removed duplicate check
2024-04-12 13:19:47 -07:00
SergeyGaluzo ff6b6e381c
Import self orchestration (#3799)
* start

* Fix bytes

* dump resource ids before

* do not go to the database

* SuccessOnRetry

* fixed tests

* Moved wait logic request handler

* Removed cancel request from job exec exception

* plus

* test correction

* Adding ability to raise SQL exceptions in E2E tests

* Temp

* Users/sergal/importtests (#3797)

* Adding ability to raise SQL exceptions in E2E tests

* error handling

* removed console

* job hosting tests

* limit to in proc

* no retriable in export

* correct wait

* retriable back in export

* rest

* minus using

* remove pragma

* Remove retriable from export

* tests

* retriable obsolete

* polly retries and simpler tests

* Addressed comments

* After merge fixes plus get import request handler tests

* removed not applicable orch tests

* second place to hide message

* time wait limit

* new retriable error

* Fixes after merge

* using

* using

* test adjusted for grouped

* []

* Removed task cancelled exception logic
2024-04-09 23:41:45 +00:00
SergeyGaluzo 47697f1ccf
Import error handling (#3796)
* Adding ability to raise SQL exceptions in E2E tests

* error handling

* removed console

* job hosting tests

* limit to in proc

* no retriable in export

* correct wait

* retriable back in export

* rest

* minus using

* remove pragma

* Remove retriable from export

* tests

* retriable obsolete

* polly retries and simpler tests

* Addressed comments

* job conflict exception back

* do not show error message for InternalServerError

* job conflict exception test

* removed generic exception from tests

* removed not used vars

* better tests

* test for exution timeout
2024-04-08 16:36:37 +00:00
rajithaalurims 24e5dc1640
App names changed to avoid collission on HP side (#3795) 2024-04-03 10:50:11 -05:00
Robert Johnson 72cc6b5057
Add support for partial delete success (#3781) 2024-04-02 09:16:07 -07:00
apurvabhaleMS ae6128c746
Handle 405 errors (#3777)
* Handle 405 error

* Updated the diagnosticInfo

* Added unit test

* Updated tests
2024-03-29 15:44:33 +00:00
Brendan Kowitz 64d456bb88
Updates Sourcelink, fix xml docs (#3785)
* Updates Sourcelink
* Adds ReproducibleBuilds
* Fixes xml docs
2024-03-29 08:40:29 -07:00
SergeyGaluzo 49a037931e
Prevent reporting dups on worker restart (#3771)
* Prevent reporting dups on worker restart

* internal

* skip
2024-03-25 17:49:26 +00:00
Fernando Henrique Inocêncio Borba Ferreira 6afd2737c6
[Bugfix] HeaderDictionary - Support concurrent operations (#3729)
* Bundle - Concurrent access

* Introducing new ThreadSafeHeaderDictionary

* Adding tests

* Fix conccurent access to http headers.

* Fix concurrent access to http headers.

* New test to validate IHeaderDictionary clones.

* Using statements. Small refactorings

* remove clone

* Expose FHIR operation outcome in case of errors

* Adding more details to the exception
2024-03-20 17:09:22 +00:00
Fernando Henrique Inocêncio Borba Ferreira fbfc674aa9
[Bugfix] Resolving references in UpserResourceHandler (#3758)
* Handling references in UpserResourceHandler

* New tests to validate references resolved in upserts
2024-03-20 17:07:22 +00:00
Fernando Henrique Inocêncio Borba Ferreira e815c369af
[Tests] ChainingSearchTest - Improve stability (#3762)
* Improvement in test to make it more stable

* Decrease batch size
2024-03-20 06:52:48 -07:00
SergeyGaluzo 6884afbfff
Move import writes to store class (#3749)
* Move import methods to store

* async

* wait finish

* Fixed typo
2024-03-14 03:58:15 +00:00
Fernando Henrique Inocêncio Borba Ferreira fc632d7d71
[Tests] Refactoring test accounts (#3747)
* Create all accounts as service principals.
* Handling empty collections of user accounts.
* Set up new app environment variables.
* Expand the use of service principals.
2024-03-13 21:15:06 +00:00
Mikael Weaver 771949463b
Fixed flaky history count test (#3737)
* Fixed flaky history test

* fixed code scanning issues

* Fixed XML issue in test text

* small guard in div logic

* Fix straggler counts

* Fix R4 solution filter so it works w/ C# dev kit
2024-03-13 13:49:45 -07:00
Fernando Henrique Inocêncio Borba Ferreira 13127b3c02
[Pipeline] Change pipeline auth method (#3745)
* Change auth to use a service principal instead of an user.
* Expand client_credentials auth.
* Mark tests as flaky.
2024-03-12 11:05:29 -07:00
Mikael Weaver 40cceb30cf
Added fix for historical summary count tests (#3722)
* Added fix for historical summary count tests
2024-02-21 14:53:20 -08:00
Mikael Weaver 12c8365db8
Convert DeletionService to use IScopeProvider (#3721)
Since the DeletionService is used by the `$bulk-delete` operation, the scope of `IFhirDataStore` and `ISearchService` need to be managed manually - not by the root container. Using `IScopeProvider` enables us to manage and dispose correctly - fixing the bug of leaking memory due to growth of services tracked by the root container.
2024-02-21 19:45:06 +00:00