Skip to content
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

Some cleanup for config server 3 #1617

Merged
merged 162 commits into from
Apr 2, 2024

Conversation

wind57
Copy link
Contributor

@wind57 wind57 commented Mar 30, 2024

No description provided.

wind57 and others added 30 commits December 4, 2021 07:59
@@ -205,19 +214,7 @@ public static MultipleSourcesContainer processNamedData(List<StrippedSourceConta
rawData = decodeData(rawData);
}

// In some cases we want to include properties from the default profile
Copy link
Contributor Author

Choose a reason for hiding this comment

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

tbh, I'm not changing this code that is shown here as removed, what I am doing is refactor it a bit. As a matter of fact, logically, it does not change one bit.

What I want to achieve is this: make it more readable, but more importantly test it, a lot. Besides the possibility to test it a lot, I am leaving myself a door to comment on each individual test and what it is supposed to achieve and why.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think keeping the comment though is important still

@@ -51,6 +54,12 @@ public final class ConfigUtils {

private static final Log LOG = LogFactory.getLog(ConfigUtils.class);

// sourceName (configmap or secret name) ends with : "-dev.yaml" or the like.
Copy link
Contributor Author

@wind57 wind57 Mar 30, 2024

Choose a reason for hiding this comment

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

what I do change very little is the introduction of this BiPredicate that instead that contains that we talked about on a previous PR, uses endsWith. imho, this is easier to read and understand

@wind57 wind57 marked this pull request as ready for review March 31, 2024 04:42
@wind57
Copy link
Contributor Author

wind57 commented Mar 31, 2024

@ryanjbaxter ready one more to look at. Thank you

@@ -227,13 +224,34 @@ public static MultipleSourcesContainer processNamedData(List<StrippedSourceConta
return new MultipleSourcesContainer(foundSourceNames, data);
}

static boolean processSource(boolean includeDefaultProfileData, Environment environment, String sourceName,
Map<String, String> sourceRawData) {
Set<String> activeProfiles = Arrays.stream(environment.getActiveProfiles()).collect(Collectors.toSet());
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use a List here? The order of profiles is generally important so I want to make sure we maintain that order

@@ -205,19 +214,7 @@ public static MultipleSourcesContainer processNamedData(List<StrippedSourceConta
rawData = decodeData(rawData);
}

// In some cases we want to include properties from the default profile
Copy link
Contributor

Choose a reason for hiding this comment

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

I think keeping the comment though is important still

@ryanjbaxter ryanjbaxter added this to the 3.1.2 milestone Apr 2, 2024
@ryanjbaxter ryanjbaxter merged commit b6300eb into spring-cloud:main Apr 2, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants