-
- Notifications
You must be signed in to change notification settings - Fork 967
fix - #15193 fix empty spring profile causing configuration to not load #15194
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
Conversation
| @matrei some of the earlier reports of application.groovy not loading configuration is likely due to this bug. |
| Fixes #15193 |
grails-bootstrap/src/main/groovy/org/grails/config/NavigableMap.groovy Outdated Show resolved Hide resolved
| I think it might make more sense to change the condition on line 228 instead as So instead of defaulting if (!sourceMapProfile1 && !sourceMapProfile2) {on line 228? |
Well, I thought that originally too but if we run boot run its development mode but no profile is set. Shouldn't dev only config apply in that case? Is it valid to not have a profile? |
| @jdaugherty Does this problem also exist in any of the functional test apps? |
It won't ever exist in a test because the tests explicitly run with a test profile. |
| Yes, but you can start the functional-test apps with bootRun. |
| How? The test annotations explicitly set the profile. My original question is still unanswered: is it valid to not have a profile? Also, shouldn't the profile always be equal to the grails environment? |
| @matrei I misread your original comment, in terms of reproducing with the functional test apps by using their bootRun, let me get back to you. |
| To reproduce with a functional test app in Which maps the profile to an empty string, instead of null. I've updated the PR to use groovy truth to address this scenario. |
Simplify and comment logic and add tests.
Simplify spring profile config exclusion
| @matrei I merged your proposed change. thank you for taking a look at this. I assume you're ok with me merging this then? |
This bug is preventing my application from loading any configuration in development mode because
spring.profiles.activeis not defined. I'm specifically failing on loading of anapplication.groovyfile without an environment specific configuration.