Allow slash in snapshot file name validation - #20620
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe PR introduces a new filename validation method that allows slashes while rejecting other invalid characters, and updates snapshot file name validation to use this method. This enables plugins to use path-like filenames in snapshots. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Comment |
|
❗ AI-powered Code-Diff-Analyzer found issues on commit be8bb29.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #20620 +/- ##
============================================
+ Coverage 73.26% 73.30% +0.04%
- Complexity 72003 72039 +36
============================================
Files 5783 5783
Lines 329438 329448 +10
Branches 47532 47536 +4
============================================
+ Hits 241347 241511 +164
+ Misses 68741 68572 -169
- Partials 19350 19365 +15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
❗ AI-powered Code-Diff-Analyzer found issues on commit 26c22a9.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
|
Ahh... @xuxiong1, with the new flood of AI-generated comments, I hadn't realized that this one is relevant to your change. Specifically, it says:
Is there anything you can do to guarantee that there is no way of reading/writing outside of the repository, especially when using the |
The file name paths are all relative paths to the node shard path, so it won't be reading/writing outside of the repository. |
|
❌ Gradle check result for 268a6af: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
❌ Gradle check result for 268a6af: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
PR Reviewer Guide 🔍(Review updated until commit 8289c7c)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 8289c7c
Previous suggestionsSuggestions up to commit 268a6af
|
|
❌ Gradle check result for 268a6af: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: xuxiong1 <xiongxug@outlook.com>
Signed-off-by: xuxiong1 <xiongxug@outlook.com>
Signed-off-by: xuxiong1 <xiongxug@outlook.com>
268a6af to
8289c7c
Compare
|
Persistent review updated to latest commit 8289c7c |
| } | ||
|
|
||
| public static boolean validFileNameExcludingAstrix(String fileName) { | ||
| public static boolean validFileNameExcludingAsterisk(String fileName) { |
There was a problem hiding this comment.
This is breaking the cross cluster replication plugin build
There was a problem hiding this comment.
@srikanthpadakanti raised opensearch-project/cross-cluster-replication#1639 to address this.
--------- Signed-off-by: xuxiong1 <xiongxug@outlook.com> Signed-off-by: Aparajita Pandey <aparajita31pandey@gmail.com>
--------- Signed-off-by: xuxiong1 <xiongxug@outlook.com>
Description
validFileNameExcludingSlash()method to Strings.java that allows forward slashes (/) and backslashes () in file names.BlobStoreIndexShardSnapshot.FileInfo.fromXContent()to use this new validation for physical file namesThis enables plugins (like time-series-db) to use path-like physical file names (e.g., metrics/head/live_series_index/segments_1) in blob store snapshots, which was previously blocked by the strict validFileName() check that rejected any slashes.
Related Issues
Resolves #20593
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.