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
Die cwd die #10923
Die cwd die #10923
Conversation
public Environment(Settings settings) { | ||
this.settings = settings; | ||
if (settings.get("path.home") != null) { | ||
homeFile = PathUtils.get(cleanPath(settings.get("path.home"))); | ||
} else { | ||
homeFile = PathUtils.get(System.getProperty("user.dir")); | ||
throw new IllegalStateException("path.home is not configured"); |
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.
👍
if no one has opinions then, I will push in 24 hours. |
this looks great - the only thing that I'd like to see is a note in the migration guide that this has been fixed and that for instance the dictionary files should be located in a different place. It's in |
Conflicts: src/test/java/org/elasticsearch/client/AbstractClientHeadersTests.java
LGTM |
Remove CWD access in tests and don't implicitly use CWD/user.dir for configuration.
See #10877 for reference.
Currently some code looks in CWD and places like $user.home for configuration files in a confusing way, in some cases even overriding other paths (so if you have a stray elasticsearch.yml there, good luck).
Tests hide the problem because they add too many permissions. We fixed that here and then all tests were failing, and made hacky changes to get tests passing again.
So some of the changes here can be cleaned up / solved differently. For example we could look for the custom hunspell data directory in Environment, grant access to it, and deprecate it instead of throwing an error. But, with what is here all tests pass so I think we know enough to discuss so we can move forward.