-
Notifications
You must be signed in to change notification settings - Fork 108
Cache CloudInfo / CloudSettings by authority #583
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
Conversation
Co-authored-by: AsafMah <[email protected]>
Formatting - please run black |
Co-authored-by: AsafMah <[email protected]>
I've run Black on all the modified files. The formatting has been applied in commit 940b938. |
Note that there are existing tests in test_e2e_data.py Make sure they work and cover the new cases |
The changelog should be for a new version, under Unreleased |
Co-authored-by: AsafMah <[email protected]>
In your tests, you use unittests. We use the pytest library. Please fix |
Co-authored-by: AsafMah <[email protected]>
I've converted the tests in test_cloud_settings.py from unittest to pytest style in commit a3a8587. The changes include:
The tests are now consistent with the pytest testing approach used in other parts of the repository. |
Co-authored-by: AsafMah <[email protected]>
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.
Undo all the changes in e2e
Co-authored-by: AsafMah <[email protected]>
I've undone all the changes to the e2e tests by reverting test_e2e_data.py to its original state in commit ecaeff5. |
This PR modifies
CloudSettings
to cache cloud information by authority (schema, host, and port) rather than by the full URL. This ensures that multiple URLs pointing to the same cluster with different paths will share the same cachedCloudInfo
object.Changes Made
Modified
_normalize_uri
method inCloudSettings
class:Updated
get_cloud_info_for_cluster
method:Created comprehensive tests:
_normalize_uri
correctly extracts just the authority partCloudInfo
cache entryExample
Before this change:
https://cluster.kusto.windows.net/
https://cluster.kusto.windows.net/database1
https://cluster.kusto.windows.net/v1/rest
Would all be cached separately, requiring multiple network requests for the same cluster.
After this change:
All these URLs will use the same cached
CloudInfo
object forhttps://cluster.kusto.windows.net
, improving efficiency and consistency.Fixes #582.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.