{{ message }}
Repository navigation
fix(config): honor OVERRIDE_IF_ABSENT for nested properties - #16514
Open
bajiaoshan wants to merge 2 commits into
Open
bajiaoshan wants to merge 2 commits into
bajiaoshan wants to merge 2 commits into
Conversation
LI123456mo
approved these changes
Oct 20, 2026
LI123456mo
left a comment
Contributor
There was a problem hiding this comment.
Reusing the existing nested instance in assignProperties and passing obj into isPropertySet addresses both causes described in the issue, and the added tests fail before the change and pass after.
LGTM @EarthChen @RainYuY
This branch has not been deployed
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.

What is the purpose of the change?
Refreshing a configuration in
OVERRIDE_IF_ABSENTmode currently preserves top-level properties but overwrites already configured nested properties. For example, an explicitly disabled metrics aggregation becomes enabled when an external configuration setsdubbo.metrics.aggregation.enabled=true.Reuse an existing nested configuration instance during refresh and check each property's current value against its actual owning object. Instantiate a nested configuration only when it is missing. This preserves configured nested values while continuing to fill absent values and apply external overrides in the other tested modes.
Add nine parameterized regression cases using real metrics configuration classes, including two nesting levels, an explicitly configured
false, and previously absent nested objects. Also verify that a setter-only nested configuration remains supported when no getter exists. Before the fix, the twoOVERRIDE_IF_ABSENTcases fail; after the fix, all ten cases pass.Fixes #16513.
Validation
ae809de2fc81b408194240965eb20bf27e6971df, with production sources unchanged, produces two assertion failures, both inOVERRIDE_IF_ABSENTmode. All ten pass with the fix.dubbo-common, including the ten regression/compatibility cases. The 48 selecteddubbo-config-apitests and the 51-module dependency reactor previously passed; the follow-up commit changes tests only.git diff --checkpass. The Unix line-ending check is skipped on Windows.-DenableEmbeddedZookeeper=false; no external registry is required. Full-project and external-service integration tests have not been run locally.Coverage
The original Codecov partial line was the conditional lookup of the nested property's getter. The added setter-only compatibility test exercises the missing-getter path and verifies that the initialized nested object receives its external configuration value. Local JaCoCo confirms that all six executable lines changed in
AbstractConfig.javaare now fully covered, including both branches of that conditional (previously five of six, or 83.33%). The latest Codecov report confirms that all modified and coverable lines are covered by tests; the unit-test reports show 100% patch coverage.Checklist