Skip to content

Conversation

@mrm9084
Copy link
Member

@mrm9084 mrm9084 commented Jan 8, 2026

Description

Adds collection monitoring as a refresh option.

spring.cloud.azure.appconfiguration.stores[0].monitoring.refresh-all when set to true will use page based etags to monitor for changes. When this refresh all is set you can't also set watch keys.

Re-works the existing feature flag page monitoring to be more generic, so there is a bit of re-naming.

Fixes a found but where the wrong token was checked for non-null.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI review requested due to automatic review settings January 8, 2026 01:03
@github-actions github-actions bot added the azure-spring All azure-spring related issues label Jan 8, 2026
Copy link
Contributor

Copilot AI left a 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 pull request adds collection monitoring as a new refresh option for Azure App Configuration, introducing the spring.cloud.azure.appconfiguration.stores[0].monitoring.refresh-all configuration property. When enabled, this feature uses page-based ETags to monitor for changes across entire configuration collections rather than individual watch keys. The PR also includes important refactoring that renames the FeatureFlags class to CollectionMonitoring to better represent its generalized purpose, and fixes several bugs related to push notification token validation.

Key Changes:

  • Introduces collection-based monitoring as an alternative to individual watch key monitoring
  • Refactors FeatureFlags to CollectionMonitoring class with package relocation
  • Adds refreshAll property to enable collection monitoring without requiring explicit triggers
  • Fixes bug where secondary token name validation incorrectly checked primary token

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
CollectionMonitoring.java Renamed from FeatureFlags, moved to configuration package to support both feature flags and general configuration monitoring
AppConfigurationStoreMonitoring.java Added refreshAll property and updated validation to allow triggers to be optional when refreshAll is enabled; fixes spelling error
FeatureFlagState.java Updated to use CollectionMonitoring instead of FeatureFlags
State.java Added collectionWatchKeys field, improved immutability by making refreshAttempt final and adding withIncrementedRefreshAttempt method
StateHolder.java Added overloaded setState method to support collection monitoring, enhanced documentation throughout
FeatureFlagClient.java Updated to use CollectionMonitoring type
AzureAppConfigDataLoader.java Added createCollectionMonitoring method, implements refreshAll logic, fixes secondary token validation bug
AppConfigurationSnapshotPropertySource.java Updated to use CollectionMonitoring type
AppConfigurationReplicaClient.java Added new collectionMonitoring method for retrieving configuration with page ETags
AppConfigurationRefreshUtil.java Added refreshWithoutTimeCollectionMonitoring method, refactored duplicate retry logic into executeRefreshWithRetry, fixes secondary token bug and improves logging
AppConfigurationEventListener.java Reordered static imports (no functional change)
FeatureFlagClientTest.java Updated tests to use CollectionMonitoring
AppConfigurationReplicaClientTest.java Updated test to use CollectionMonitoring
AppConfigurationRefreshUtilTest.java Updated tests to use CollectionMonitoring
Comments suppressed due to low confidence (1)

sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/configuration/CollectionMonitoring.java:36

  • The JavaDoc comment still says "the featureFlags" but the method has been renamed to getConfigurations and the field renamed to configurations. Update the JavaDoc to reference "configurations" instead of "featureFlags".

if (Boolean.TRUE.equals(monitoring.getRefreshAll())) {
// Use collection monitoring for refresh
List<CollectionMonitoring> collectionMonitoringList = createCollectionMonitoring(currentClient);
storeState.setState(resource.getEndpoint(), null, collectionMonitoringList, monitoring.getRefreshInterval());
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

When refreshAll is enabled and no triggers are configured, setting the watchKeys parameter to null in setState could cause issues if the refresh logic attempts to iterate over watchKeys. Consider passing an empty list instead of null for better null-safety, or ensure all code paths that access watchKeys handle null appropriately.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

azure-spring All azure-spring related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant