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

Reindex Check for Selectable Search Parameters #4813

Merged
merged 2 commits into from
Feb 7, 2025

Conversation

PTaladay
Copy link
Collaborator

@PTaladay PTaladay commented Feb 5, 2025

Description

Added in check for reindex job in progress when trying to update search parameter state using $status endpoint. Added unit test to verify.

Related issues

Addresses [issue AB#103503].

Testing

Added new unit test to cover.

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)

@PTaladay PTaladay added Bug Bug bug bug. Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs labels Feb 5, 2025
@PTaladay PTaladay added this to the 2Wk09 milestone Feb 5, 2025
@PTaladay PTaladay requested a review from a team as a code owner February 5, 2025 18:56
// check if reindex job is running
using (IScoped<IFhirOperationDataStore> fhirOperationDataStore = _fhirOperationDataStoreFactory())
{
(var activeReindexJobs, var reindexJobId) = await fhirOperationDataStore.Value.CheckActiveReindexJobsAsync(cancellationToken);

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

This assignment to
reindexJobId
is useless, since its value is never read.

Copilot Autofix AI 9 days ago

To fix the problem, we need to remove the assignment to the reindexJobId variable since it is not used anywhere in the function. This can be done by modifying the tuple deconstruction to only include the activeReindexJobs variable.

  • Remove the assignment to reindexJobId in the tuple deconstruction.
  • Ensure that the functionality of the method remains unchanged.
Suggested changeset 1
src/Microsoft.Health.Fhir.Shared.Core/Features/Operations/SearchParameterState/SearchParameterStateUpdateHandler.cs

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/Microsoft.Health.Fhir.Shared.Core/Features/Operations/SearchParameterState/SearchParameterStateUpdateHandler.cs b/src/Microsoft.Health.Fhir.Shared.Core/Features/Operations/SearchParameterState/SearchParameterStateUpdateHandler.cs
--- a/src/Microsoft.Health.Fhir.Shared.Core/Features/Operations/SearchParameterState/SearchParameterStateUpdateHandler.cs
+++ b/src/Microsoft.Health.Fhir.Shared.Core/Features/Operations/SearchParameterState/SearchParameterStateUpdateHandler.cs
@@ -239,3 +239,3 @@
             {
-                (var activeReindexJobs, var reindexJobId) = await fhirOperationDataStore.Value.CheckActiveReindexJobsAsync(cancellationToken);
+                var (activeReindexJobs, _) = await fhirOperationDataStore.Value.CheckActiveReindexJobsAsync(cancellationToken);
                 if (activeReindexJobs)
EOF
@@ -239,3 +239,3 @@
{
(var activeReindexJobs, var reindexJobId) = await fhirOperationDataStore.Value.CheckActiveReindexJobsAsync(cancellationToken);
var (activeReindexJobs, _) = await fhirOperationDataStore.Value.CheckActiveReindexJobsAsync(cancellationToken);
if (activeReindexJobs)
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@PTaladay PTaladay merged commit f52ab01 into main Feb 7, 2025
55 checks passed
@PTaladay PTaladay deleted the personal/patalada/103503 branch February 7, 2025 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs Bug Bug bug bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants