Fix delete search param by url - #5775
Closed
SergeyGaluzo wants to merge 6 commits into
Closed
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5775 +/- ##
==========================================
+ Coverage 78.89% 78.92% +0.02%
==========================================
Files 1016 1016
Lines 36856 36875 +19
Branches 5612 5604 -8
==========================================
+ Hits 29076 29102 +26
+ Misses 6404 6399 -5
+ Partials 1376 1374 -2 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Moves SearchParameter deletion status handling into DeletionService, enabling conditional deletion by URL while preserving deletion until reindex.
Changes:
- Centralizes pending-delete status updates in the deletion service.
- Enables storage backends to persist final reindex deletions.
- Updates interfaces and tests for the revised workflow.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
test/Microsoft.Health.Fhir.Shared.Tests.Integration/Persistence/FhirStorageTestsFixture.cs |
Updates behavior construction. |
test/Microsoft.Health.Fhir.Shared.Tests.E2E/Rest/Search/FailingSearchParameterStatusManager.cs |
Updates status-manager signature. |
test/Microsoft.Health.Fhir.Shared.Tests.E2E/Rest/Reindex/ReindexTests.cs |
Tests conditional deletion by URL. |
src/Microsoft.Health.Fhir.SqlServer/Features/Storage/SqlServerFhirDataStore.cs |
Persists final SearchParameter deletion. |
src/Microsoft.Health.Fhir.Shared.Core/Features/Resources/Delete/DeletionService.cs |
Centralizes pending deletion handling. |
src/Microsoft.Health.Fhir.Shared.Core.UnitTests/Features/Search/SearchParameters/SearchParameterBehaviorTests.cs |
Updates behavior expectations. |
src/Microsoft.Health.Fhir.Shared.Core.UnitTests/Features/Resources/Delete/DeletionServiceTests.cs |
Updates deletion mocks. |
src/Microsoft.Health.Fhir.Shared.Core.UnitTests/Features/Operations/SearchParameterState/SearchParameterStateUpdateHandlerTests.cs |
Updates method assertions. |
src/Microsoft.Health.Fhir.Shared.Core.UnitTests/Features/Operations/Reindex/ReindexOrchestratorJobTests.cs |
Updates status-manager assertions. |
src/Microsoft.Health.Fhir.CosmosDb/Features/Storage/CosmosFhirDataStore.cs |
Persists final SearchParameter deletion. |
src/Microsoft.Health.Fhir.Core/Features/Search/Registry/SearchParameterStatusManager.cs |
Simplifies status-update API. |
src/Microsoft.Health.Fhir.Core/Features/Search/Registry/ISearchParameterStatusManager.cs |
Updates status-manager contract. |
src/Microsoft.Health.Fhir.Core/Features/Search/Parameters/SearchParameterOperations.cs |
Simplifies deletion operations. |
src/Microsoft.Health.Fhir.Core/Features/Search/Parameters/ISearchParameterOperations.cs |
Updates operation contracts. |
src/Microsoft.Health.Fhir.Core/Features/Search/Parameters/DeleteSearchParameterBehavior.cs |
Removes status queuing responsibility. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+721
to
+722
| // Only mark with pending status. The actual deletion is performed by the reindex job. | ||
| await _searchParameterOperations.DeleteSearchParameterAsync(rawResource, cancellationToken, isHardDelete); |
Comment on lines
+112
to
+115
| if (key.ResourceType == KnownResourceTypes.SearchParameter) | ||
| { | ||
| await DeleteSearchParameter(key, fhirDataStore, isHardDelete: false, cancellationToken); | ||
| break; |
Comment on lines
698
to
+700
| foreach (var entry in entries.Where(_ => _.Resource.ResourceTypeName == KnownResourceTypes.SearchParameter)) | ||
| { | ||
| await DeleteSearchParameterWithLockAsync(entry, false, cancellationToken); | ||
| await DeleteSearchParameterAsync(entry.Resource.RawResource, false, cancellationToken); |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes https://microsofthealth.visualstudio.com/Health/_workitems/edit/204583
This PR: