-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
reload properties of remotely activated profile fixes gh-1834 #1835
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1835 +/- ##
============================================
- Coverage 78.42% 78.29% -0.13%
- Complexity 1304 1306 +2
============================================
Files 165 165
Lines 4778 4791 +13
Branches 641 645 +4
============================================
+ Hits 3747 3751 +4
- Misses 774 781 +7
- Partials 257 259 +2
Continue to review full report at Codecov.
|
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.
Maybe an test? or you could show me a failing sample?
public ConfigServicePropertySourceLocator(ConfigClientProperties defaultProperties) { | ||
this.defaultProperties = defaultProperties; | ||
} | ||
|
||
@Override | ||
@Retryable(interceptor = "configServerRetryInterceptor") |
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.
I think it needs to stay here for some rare backwards compatibility issues since the call to locate(properties)
wouldn't be retryable.
Should we wait until we fork the repo since this is only compatible with boot 2.5.x? How would we test it? |
yeah, this will have to wait a bit. Not sure we're going to fork for 2.5.x. There should be compatibility tests. Maybe there's a way to only run a test only for a specific version of boot. |
} | ||
|
||
@Retryable(interceptor = "configServerRetryInterceptor") | ||
public org.springframework.core.env.PropertySource<?> locate(ConfigClientProperties properties) { |
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.
Is the only usage of this the method above?
// to check if different profile is activated within the default profile | ||
private boolean checkIfProfileIsActivatedInDefault(String[] profiles, Map<String, Object> map) { | ||
List<String> profilesList = Arrays.asList(profiles); | ||
return (profilesList.size() == 1 && profilesList.get(0).equalsIgnoreCase("default") |
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.
@spencergibb do you recall why this would only need to be done for the default profile? What if the default profile contains spring.profiles.active
and then subsequent configuration properties which get activated based on that profile also contain spring.profiles.activate
? In that case we would not also activate those profiles.
Fixed by #2260 |
Note: This PR works only for remote client applications that use SB 2.5.x