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

Add new SQL hash calculation #4737

Merged
merged 4 commits into from
Dec 6, 2024
Merged

Conversation

LTA-Thinking
Copy link
Collaborator

@LTA-Thinking LTA-Thinking commented Nov 21, 2024

Description

The SQL query hash has been including parameter values when it shouldn't, which is causing custom queries to be parameter value specific. This is undesired as custom queries should apply regardless of parameter values. This PR changes the way query hashes are generated to remove parameter values.

This will change the hashes of all requests, which will render current custom queries invalid.

Related issues

Addresses Bug 131113: SQL query hashes have parameter value hashes included

Testing

Describe how this change was tested.

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)

@LTA-Thinking LTA-Thinking 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 Nov 21, 2024
@LTA-Thinking LTA-Thinking added this to the S154 milestone Nov 21, 2024
@LTA-Thinking LTA-Thinking requested a review from a team as a code owner November 21, 2024 16:36
{
public class ReadableLogger<T> : ILogger<T>
{
private List<string> _logs = new List<string>();

Check notice

Code scanning / CodeQL

Missed 'readonly' opportunity Note test

Field '_logs' can be 'readonly'.
feordin
feordin previously approved these changes Nov 26, 2024

public string GetHash()
{
// I don't think UnsupportedSearchParams is needed as it isn't used in the actual search
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this comment meant to be committed? 🍒

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I should reword it, but I think the point is helpful to understand why I didn't include that value in the hash.

@LTA-Thinking
Copy link
Collaborator Author

Waiting to merge until we can discuss the impact to existing custom queries.

@LTA-Thinking LTA-Thinking marked this pull request as draft November 27, 2024 22:31
@LTA-Thinking LTA-Thinking marked this pull request as ready for review December 6, 2024 22:37
@LTA-Thinking LTA-Thinking merged commit cb53a35 into main Dec 6, 2024
47 checks passed
@LTA-Thinking LTA-Thinking deleted the personal/rojo/fix-sql-parameter-hash branch December 6, 2024 22:38
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