-
Notifications
You must be signed in to change notification settings - Fork 3.2k
App Config - Check Paged Based Etags #44324
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Pull request overview
This PR enhances the list_configuration_settings() method in Azure App Configuration SDK to support efficient monitoring of configuration changes using etag-based pagination. Instead of fetching all pages, only pages that have changed since the provided etags are returned, reducing unnecessary data transfer.
Key changes:
- Added
match_conditionsparameter toby_page()method for providing etags to check against - Implemented custom page iterators that perform HTTP conditional requests using If-None-Match headers
- Updated tests to use the new etag-based change detection instead of manual HTTP requests
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| CHANGELOG.md | Documents the new etags parameter (should be match_conditions) for the by_page() method |
| azure/appconfiguration/_models.py | Adds new classes ConfigurationSettingPaged, ConfigurationSettingPagedAsync, and etag-checking page iterators to support conditional page fetching |
| azure/appconfiguration/_azure_appconfiguration_client.py | Updates sync client to return ConfigurationSettingPaged instead of ItemPaged |
| azure/appconfiguration/aio/_azure_appconfiguration_client_async.py | Updates async client to return ConfigurationSettingPagedAsync instead of AsyncItemPaged |
| tests/test_azure_appconfiguration_client.py | Refactors test to use the new by_page(match_conditions=...) API instead of manual HTTP requests; changes from add_configuration_setting to set_configuration_setting |
| tests/test_azure_appconfiguration_client_async.py | Refactors async test to use the new by_page(match_conditions=...) API instead of manual HTTP requests |
sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_models.py
Outdated
Show resolved
Hide resolved
sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_models.py
Outdated
Show resolved
Hide resolved
| super(ConfigurationSettingPropertiesPaged, self).__init__( | ||
| self._get_next_cb, | ||
| self._extract_data_cb, | ||
| continuation_token=kwargs.get("continuation_token"), | ||
| ) |
Copilot
AI
Dec 8, 2025
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.
[nitpick] While moving the super().init() call after setting instance variables is a valid pattern that avoids potential issues with accessing uninitialized attributes, this change was not mentioned in the PR description. The change appears to be a preventative fix rather than addressing a specific bug. Consider documenting why this reordering was necessary in the commit message or PR description for future reference.
sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_models.py
Outdated
Show resolved
Hide resolved
sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_models.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
/azp run python - pullrequest |
|
Azure Pipelines successfully started running 1 pipeline(s). |
sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_models.py
Outdated
Show resolved
Hide resolved
sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_models.py
Show resolved
Hide resolved
| return iter(settings) | ||
|
|
||
|
|
||
| class ConfigurationSettingEtagPageIterator(_BaseConfigurationSettingEtagPageIterator): |
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.
It seems the changes here should be in ConfigurationSettingsPropertiesPaged which is passed as the page_iterator_class here
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.
@jimmyca15 We could remove some of this to simplify the change, but it would require use to catch exceptions when 304 status code when there is no change.
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.
Would that be by taking advantage of the generated function get_key_values_in_one_page ?
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.
Yes plus some
| client=self, | ||
| key_filter=key_filter, | ||
| label_filter=label_filter, | ||
| tags_filter=tags, |
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.
The passed options seem a bit repetitive here. I would expect us to only pass down the page etags list. Since ConfigurationSettingPropertiesPaged handles the request logic and parsing methods, I would guess most of the changes should be there.
Description
Similar to #44247, but
list_configuration_settingsonly returns the changed pages.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines