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.
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
Fix list_ for presense detection #10
base: main
Are you sure you want to change the base?
Fix list_ for presense detection #10
Changes from 3 commits
e589861
d1a8090
7b5ceba
8ad5fa2
ea4a069
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
note: This should work with and without trailing
/
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 did not know, that in the code they are using a trailing /
But its easy to handle like this indeed.
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.
issue(blocking): This does not deduplicate, is missing files and does not list subdirectories correctly. Take the following structure (key == etc_key for brevity):
Listing
root
should yield:But this returns:
Please see the last paragraph of my previous review comment for suggestions.
Edit: Noticed another issue caused by returning the last path segment. You need to strip the
bank
that is being listed from the entry, then return the first path segment only. If you fix this, the function would still incorrectly return:Thus, I'd use a set for
data
and only cast it to a list when returning from the function, which would yield:The last thing that's missing is
etcd_key
entries where thebank
entry matches thebank
parameter exactly.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.
Thank you for the review. I'm thinking of using the last part returned by mysql of the bank this should contain
sub, another_sub, file
. Using sets sounds like a great idea to fix the duplicate entries. Does it happen the etcd_key that matches the full bank parameter, perhaps it could be fixed by one SQL query without LIKE. I really don't like the idea of having another SQL query.I'm grateful for all that you have done, I will do some thinking of my own.
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.
It should work with a single query similar to this mockup (definitely needs adjustments, e.g. client initialization, possibly the
for
loop):