Draft
Conversation
This file contains hidden or 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
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.
Summary
A recent
lsbehavior change maderc ls <alias>/ --recursivetraverse every bucket and list objects server-wide, but that alias-only recursive branch had no direct unit coverage. That left the command selection logic unguarded even though it changed user-visible behavior.User Impact
If that branch regresses,
ls alias/ -rcan silently fall back to bucket listing instead of object listing. Users would still get successful output, but it would be the wrong mode and the regression would be easy to miss.Root Cause
The branch that distinguishes alias-only bucket listing from alias-only recursive object listing lived inline inside
execute, so the changed path was only indirectly exercised. Existing tests covered path parsing, but not the mode decision introduced by the recent-rbehavior change.Fix
This PR extracts the alias-only listing decision into a small
alias_listing_modehelper and adds focused unit tests for the three relevant cases:--recursiveselects all-object listing--recursiveselects bucket listingThe implementation behavior is unchanged; the refactor is only there to make the recent branch testable and keep the scope tight to the changed area.
Validation
I ran the required checks locally:
cargo fmt --all --checkcargo clippy --workspace -- -D warningscargo test --workspace