-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Added logic to allow {dot} files on startup #1437
Conversation
Can one of the admins verify this patch? |
✅ DCO Check Passed 9165c4cbde3910754983d277541484b5cb90fa32 |
✅ Gradle Wrapper Validation success 9165c4cbde3910754983d277541484b5cb90fa32 |
✅ Gradle Precommit success 9165c4cbde3910754983d277541484b5cb90fa32 |
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.
So, we have findPluginDirs
that returns the list of plugin directories. Today it also returns a bunch of files that start with .
and this PR attempts to filter it. This is difficult to grok and even more difficult to test.
Instead, consider modifying findPluginDirs
to only return the plugin directories we care about, and write a test for it.
We also likely want to warn when we encounter something that's not a plugin in the plugins directory.
✅ Gradle Wrapper Validation success 9165c4cbde3910754983d277541484b5cb90fa32 |
❌ DCO Check Failed 9165c4cbde3910754983d277541484b5cb90fa32 |
✅ Gradle Precommit success 9165c4cbde3910754983d277541484b5cb90fa32 |
I'll modify |
hi @ryanbogan can you rebase your PR w/ latest main branch? The DCO check wasn't your fault. A dirty commit made it into main and this has since been corrected. |
❌ DCO Check Failed 2b1822c4e1859fb2d507e866d97858239cf79a3a |
✅ Gradle Wrapper Validation success 2b1822c4e1859fb2d507e866d97858239cf79a3a |
I rebased but it still failed the DCO check |
✅ Gradle Precommit success 2b1822c4e1859fb2d507e866d97858239cf79a3a |
✅ DCO Check Passed 885936329d5f438985de395882de1d6df4752114 |
✅ Gradle Wrapper Validation success 885936329d5f438985de395882de1d6df4752114 |
✅ Gradle Precommit success 885936329d5f438985de395882de1d6df4752114 |
start gradle check |
❌ Gradle Check failure 885936329d5f438985de395882de1d6df4752114 |
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.
This needs tests for all those added scenarios, like the specific file name(s), and logger.warn
.
|| plugin.getFileName().toString().startsWith(".removing-") | ||
|| plugin.getFileName().toString().startsWith(".") | ||
&& !Files.isDirectory(plugin) | ||
&& !plugin.getFileName().toString().equals(".DS_Store")) { |
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.
Why do we care about .DS_Store
? It starts with .
...
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.
Without that it would fail the unit tests for DesktopServicesStore files
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.
The code is wrong then. Isn't the intent to skip all .
files?
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.
I don't think we should skip .DS_Store
files in this method because an error needs to be thrown in readPluginBundle()
if a .DS_Store
is encountered. I'm trying to skip all .
files except for those with this code.
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.
Maybe I don't understand what we're trying to accomplish. Why would we ignore .DS_Store
? Because it's a well known special file? It's not expected in that folder AFAIK.
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.
I think that was the reason, but if you think it's better to allow all .
files, including .DS_Store
, on startup I can implement that.
Signed-off-by: Ryan Bogan <[email protected]>
Signed-off-by: Ryan Bogan <[email protected]>
Signed-off-by: Ryan Bogan <[email protected]>
✅ Gradle Wrapper Validation success 974e0b5 |
✅ Gradle Precommit success 974e0b5 |
Let's backport this into 1.x, and please check whether we say anything about this in docs - may need to be updated. |
* Added logic to allow {dot} files on startup Signed-off-by: Ryan Bogan <[email protected]> * Ensures that only plugin directories are returned by findPluginDirs() Signed-off-by: Ryan Bogan <[email protected]> * Prevents . files from being returned as plugins Signed-off-by: Ryan Bogan <[email protected]>
* Added logic to allow {dot} files on startup Signed-off-by: Ryan Bogan <[email protected]> * Ensures that only plugin directories are returned by findPluginDirs() Signed-off-by: Ryan Bogan <[email protected]> * Prevents . files from being returned as plugins Signed-off-by: Ryan Bogan <[email protected]>
* Added logic to allow {dot} files on startup Signed-off-by: Ryan Bogan <[email protected]> * Ensures that only plugin directories are returned by findPluginDirs() Signed-off-by: Ryan Bogan <[email protected]> * Prevents . files from being returned as plugins Signed-off-by: Ryan Bogan <[email protected]>
Signed-off-by: Ryan Bogan [email protected]
Description
Fixes a bug that would not allow OpenSearch to run when a {dot} file (i.e. ".test") was present in the plugins folder.
Issues Resolved
#626
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.