Skip to content

Fix delete search param by url - #5775

Closed
SergeyGaluzo wants to merge 6 commits into
mainfrom
users/sergal/delete-by-url
Closed

Fix delete search param by url#5775
SergeyGaluzo wants to merge 6 commits into
mainfrom
users/sergal/delete-by-url

Conversation

@SergeyGaluzo

@SergeyGaluzo SergeyGaluzo commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Fixes https://microsofthealth.visualstudio.com/Health/_workitems/edit/204583

This PR:

  1. Removed logic that was passing pending delete statuses in the request context,
  2. Added status updates in the deletion service.
  3. Removed special pending delete status handling from Cosmos and SQL stores.,
  4. Cleaned interfaces from not used "ignore not supported exception" logic.

@SergeyGaluzo
SergeyGaluzo requested a review from a team as a code owner August 30, 2026 06:13
@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.92%. Comparing base (3a71c9e) to head (bc57600).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            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     

see 37 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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);
@SergeyGaluzo
SergeyGaluzo deleted the users/sergal/delete-by-url branch August 31, 2026 22:01
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.

3 participants