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

No error message when using spring.profiles.include in a profile-specific config file if it's written as a YAML list #25309

Closed
lbilger opened this issue Feb 16, 2021 · 0 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@lbilger
Copy link

lbilger commented Feb 16, 2021

I just spent a lot of time trying to find out why a set of profile-specific configuration properties were not loaded in my app after I upgraded to 2.4.2. Simplified example:

application-include.yaml

spring:
  profiles:
    include:
      - included

application-included.yaml:

foo: included

The application started (with -Dspring.profiles.active=include), but the foo property was not there.

After some searching I found that this is no longer supported in 2.4. If I had written:

spring:
  profiles:
    include: included

I would have gotten an error message on application startup. But the validation logic in InvalidConfigDataPropertyException looks explicitly for spring.profiles.included, while the YAML I used translates to spring.profiles.included[0].

I admit I should have started by reading the release notes, which would have pointed me to the migration guide.
Still, making the validation detect this case as well might save others some time. Maybe the error message could even contain a link to the migration guide.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 16, 2021
@mbhave mbhave added type: enhancement A general enhancement type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement labels Feb 16, 2021
@mbhave mbhave added this to the 2.4.x milestone Feb 16, 2021
@mbhave mbhave self-assigned this Feb 16, 2021
@mbhave mbhave closed this as completed in 00a358b Feb 17, 2021
@wilkinsona wilkinsona modified the milestones: 2.4.x, 2.4.3 Feb 17, 2021
This was referenced Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants