Skip to content

fix(cli): info/logs honor --profile and BOXLITE_PROFILE (POL-30/31)#632

Draft
G4614 wants to merge 1 commit into
boxlite-ai:mainfrom
G4614:fix/cli-info-logs-honor-profile
Draft

fix(cli): info/logs honor --profile and BOXLITE_PROFILE (POL-30/31)#632
G4614 wants to merge 1 commit into
boxlite-ai:mainfrom
G4614:fix/cli-info-logs-honor-profile

Conversation

@G4614
Copy link
Copy Markdown
Contributor

@G4614 G4614 commented Jun 1, 2026

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_url

scenario pre-fix post-fix
info --profile p1 (p1.url points at REST stub) homeDir: /home/ngolo/.boxlite + local imagesCount (local-only) stub receives GET /v1/boxes; stdout shows stub URL + virtualization: remote
BOXLITE_PROFILE=p1 info same — local same — REST stub
info (no profile, no URL) local, works local, works (no regression)
logs --profile p1 anybox silently looks up local → No such box: anybox (or worse, hits a local box if one exists) exit≠0 + stderr not yet supported over REST
resolved_url() precedence (--url > profile > none, empty string treated as none) n/a 4 units green

Two-side: git stash reverts 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 pop restores → 4/4 pass.

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>
@G4614 G4614 force-pushed the fix/cli-info-logs-honor-profile branch from 27e99a5 to 99e5762 Compare June 1, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant