WatchedSetting based refresh#14
Merged
linglingye001 merged 12 commits intorelease/v1.0.0-beta.2from Apr 24, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements a refresh mechanism based on watched settings, adding validation, monitoring, and concurrent reloading of configuration when changes occur.
- Added validation and normalization for refresh options and watched settings.
- Introduced a dedicated refresh timer and corresponding client logic for Azure App Configuration.
- Expanded test coverage to validate various refresh scenarios.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| utils.go | Adds validations for refresh options including interval and watched settings. |
| settings_client.go | Introduces watchedSettingClient with error handling and ETag check logic. |
| refresh_test.go | Provides comprehensive tests for refresh functionality and configuration updates. |
| options.go | Defines new refresh options and watched settings structures. |
| internal/refreshtimer/refresh_timer.go | Implements a refresh timer to control refresh intervals. |
| constants.go | Adds minimal refresh interval constant. |
| azureappconfiguration.go | Implements refresh logic including mutual exclusion, reloading key-values and watched settings. |
3a69488 to
760d5ff
Compare
760d5ff to
831f1b1
Compare
831f1b1 to
a0a7fb2
Compare
b6bf5ec to
c733192
Compare
| EnvVarServiceFabric = "Fabric_NodeName" | ||
|
|
||
| RequestTracingKey = "Tracing" | ||
| TracingKey = "Tracing" |
Member
There was a problem hiding this comment.
I guess it can be removed now?
Member
Author
There was a problem hiding this comment.
Yes, it should be removed
|
|
||
| if err := azappcfg.load(ctx); err != nil { | ||
| return nil, err | ||
| } else { |
Member
There was a problem hiding this comment.
nit:
if err := azappcfg.load(ctx); err != nil {
return nil, err
}
azappcfg.tracingOptions.InitialLoadFinished = true
RichardChen820
approved these changes
Apr 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overall
The refresh mechanism is designed around these key components:
Refresh Control Flow
The refresh process follows this logical flow:
Initialization (during Load):
Checks if refresh is enabled
Creates/uses a monitor to check ETags
Reloads all key-values concurrently using errgroup
Error Handling: