-
Notifications
You must be signed in to change notification settings - Fork 209
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
Fix DataSourceName update for HotReload #2401
Conversation
the correct way of updating the dataSourceName was already there in the initial PR here: https://github.com/Azure/data-api-builder/blob/741865371911ef0b8dc6a27d9bc9ef82470cfc16/src/Config/ObjectModel/RuntimeConfig.cs#L303 then in another refactor PR, it was incorrectly updated, ref: https://github.com/Azure/data-api-builder/pull/2356/files#r1781334859 This PR fixes this. Tests will be a part of another Hot Reload PR.
/azp run |
1 similar comment
/azp run |
/azp run |
In the tests section you wrote that "more tests should be part of other HotReload PRs". Do you mean tests related to the function |
correct integrations tests would be verifying this update logic as well. |
/azp run |
It would be helpful to have in PR description "Why" this change is correct and why the previous one is wrong |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This enables my local environment to work with hot reload. However please add more to pr description for WHY this change works.
/azp run |
/azp run |
/azp run |
1 similar comment
/azp run |
Why make this change?
the correct way of updating the dataSourceName was already there in the initial PR here:
data-api-builder/src/Config/ObjectModel/RuntimeConfig.cs
Line 303 in 7418653
then in another refactor PR, it was incorrectly updated, ref: https://github.com/Azure/data-api-builder/pull/2356/files#r1781334859
The current code directly assigns a new value to
DefaultDataSourceName
. However, this approach does not account for updating the different mappings related to DataSourceName when the application undergoes a hot reload. During a hot reload, it is crucial to maintain the same default data source name as before the hot reload to all the mappings for being consistent. This is because references to the data source depend on this name for lookups.The new method
UpdateDefaultDataSourceName
ensures that the default data source name is updated correctly, maintaining consistency across hot reloads.What is this change?
How was this tested?