-
Notifications
You must be signed in to change notification settings - Fork 4
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
Handle partial name matches in ls
method
#298
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit fixes the ls command to exclude partial (prefix-only) matches when listing objects in a repository. The previous behavior would incorrectly include files with names that are a prefix of the path passed to `ls`, e.g., a file named `foo/bar_1` would be included when listing `foo/bar` (a directory). A regression test has been added based on the issue description. Issue: #297
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #298 +/- ##
==========================================
- Coverage 95.26% 94.78% -0.48%
==========================================
Files 5 5
Lines 401 403 +2
Branches 90 91 +1
==========================================
Hits 382 382
- Misses 14 15 +1
- Partials 5 6 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
AdrianoKF
changed the title
Fix partial name matches in
Handle partial name matches in Dec 16, 2024
ls
methodls
method
nicholasjng
approved these changes
Dec 16, 2024
nicholasjng
reviewed
Dec 16, 2024
nicholasjng
approved these changes
Dec 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes the
ls
implementation to exclude partial (prefix-only) matches when listing objects in a repository.The previous behavior would incorrectly include files with names that are a prefix of the path passed to
ls
, e.g., a file namedfoo/bar_1
would be included when listingfoo/bar
(a directory).The root cause is that the
GET /repositories/{repository}/refs/{ref}/objects/ls
lakeFS API call returns objects based on their prefix, not full name matches, so we have to perform additional filtering in ourls
method.A regression test has been added based on the issue description.
Issue: #297