Skip to content

Fail if import locations are not found #23032

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

Closed
philwebb opened this issue Aug 21, 2020 · 2 comments
Closed

Fail if import locations are not found #23032

philwebb opened this issue Aug 21, 2020 · 2 comments
Labels
status: noteworthy A noteworthy issue to call out in the release notes theme: config-data Issues related to the configuration theme type: enhancement A general enhancement
Milestone

Comments

@philwebb
Copy link
Member

It's very easy to mistype a spring.config.import and have it silently fail. It would probably be better to throw an exception by default and have another signal for optional locations.

@philwebb philwebb added this to the 2.4.x milestone Aug 21, 2020
@philwebb philwebb added the type: enhancement A general enhancement label Aug 21, 2020
@jeffbswope
Copy link

Just a thumbs-up for some mechanism/signal to provide support for optional includes...

We have launchers where we include some optional file locations now in via command-line --spring.config.additional-location and I could see how we could end up replacing/augmenting that using optional config locations in spring.config.import...

This might raise the question if the "file-not-folder" usages of spring.config.location/spring.config.additional-location would benefit from harmony with whatever default-optional behavior ends up in spring.config.import? Or does it help to keep them more clearly distinct and different in another way?

@philwebb philwebb added theme: config-data Issues related to the configuration theme status: noteworthy A noteworthy issue to call out in the release notes labels Aug 24, 2020
@philwebb
Copy link
Member Author

I've gone for a prefix of optional: to indicate an optional location. You can use it with spring.config.location, spring.config.additional-location and spring.config.import directives.

This might raise the question if the "file-not-folder" usages of spring.config.location/spring.config.additional-location would benefit from harmony with whatever default-optional

I think it does, although it might cause a few people some issues with upgrades since they'll need to add an optional: prefix to their commands. On the whole, I think it's better to be explicit about optional locations. I think previously it was too easy to make a typo and not understand why properties weren't loaded.

@philwebb philwebb modified the milestones: 2.4.x, 2.4.0-M3 Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: noteworthy A noteworthy issue to call out in the release notes theme: config-data Issues related to the configuration theme type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants