fix(cli): info/logs honor --profile and BOXLITE_PROFILE (POL-30/31)#632
Draft
G4614 wants to merge 1 commit into
Draft
fix(cli): info/logs honor --profile and BOXLITE_PROFILE (POL-30/31)#632G4614 wants to merge 1 commit into
G4614 wants to merge 1 commit into
Conversation
info.rs and logs.rs called create_runtime_with_options(), which always
builds a local runtime regardless of --profile / BOXLITE_PROFILE /
--url. Every other command uses create_runtime(), which applies the
URL precedence ladder and routes to REST when a profile carries one.
Switching info and logs to create_runtime() makes them route correctly:
info renders the REST URL in place of homeDir + a "remote" sentinel for
virtualization and skips the images count until REST image endpoints
land (POL-32); logs has no REST equivalent yet, so it errors cleanly
("not yet supported over REST") instead of silently looking up the box
in the wrong environment.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
27e99a5 to
99e5762
Compare
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.
boxlite info/logs support remote profile
Test plan
cargo nextest run -p boxlite-cli --test profile_routing+cargo test -p boxlite-cli --bin boxlite resolved_urlinfo --profile p1(p1.url points at REST stub)homeDir: /home/ngolo/.boxlite+ local imagesCount (local-only)GET /v1/boxes; stdout shows stub URL +virtualization: remoteBOXLITE_PROFILE=p1 infoinfo(no profile, no URL)logs --profile p1 anyboxNo such box: anybox(or worse, hits a local box if one exists)not yet supported over RESTresolved_url()precedence (--url> profile > none, empty string treated as none)Two-side:
git stashreverts the prod diff → 4 integration tests, 3 fail / 1 pass (the failing three are exactly the paths the fix covers; the passing one is the local-stays-local negative case) →git stash poprestores → 4/4 pass.