Skip to content

Fix profile inspection commands ignoring --profile - #200

Open
manyoneek wants to merge 1 commit into
RevenueCat:mainfrom
manyoneek:fix/profile-inspection-flag
Open

manyoneek wants to merge 1 commit into
RevenueCat:mainfrom
manyoneek:fix/profile-inspection-flag

Conversation

@manyoneek

@manyoneek manyoneek commented Oct 22, 2026 •

Copy link
Copy Markdown

Honor --profile in profiles show and profiles list. A positional name still takes precedence, and neither command changes the saved active profile.

Fixes #199.

Reproduce

  • Run python3 reproduce-all.py from the reproduction source; it creates two credential-free profiles, with qa-base active.
  • Run rc profiles show --profile qa-chosen --json and rc profiles list --profile qa-chosen --json.
  • Both select qa-base instead of qa-chosen.

Checked

  • Go regression: 2 failures before; all 6 cases pass after.
  • Source-built CLI: the same 2 failures disappear with the fix.
  • go test ./...: 13 packages pass; go vet ./internal/cli passes.

Linux and Windows were not tested.

Test commands:

go test ./...
go vet ./internal/cli

Tested October 22: 0381e9169458, Go 1.26.10, macOS arm64.

Started in #5, commit 9abca4255e10 (May 15; merged July 29, 2026), first stable tag 0.1.0. The historical binary reproduces it; its parent lacks these commands.

Before → after

Before the fix After the fix

October 20 explainer; verification above was rerun October 22.

cli-profile-explainer.mp4

Source, logs and recordings

Automated review

[!NOTE]
Low Risk
Localized CLI profile-display fix aligned with existing global profile resolution; covered by new regression tests and does not alter persisted active profile.

Overview
profiles show and profiles list now respect the global --profile flag by seeding profile resolution from rt.Globals.Profile instead of an empty default. For profiles show, a positional profile name still overrides the flag; neither command writes to the persisted .active pointer.

Adds TestProfilesRespectProfileFlag with table-driven cases for flag vs positional vs on-disk active profile, including JSON field checks and that transient --profile does not change .active.

Fixes #199.

Reviewed by Cursor Bugbot for commit 6bcc94e. Bugbot is set up for automated code reviews on this repo. Configure here.

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.

profiles show and list ignore --profile

1 participant