Skip to content

fix: harden profile reuse and uniformize profile display and reuse#45

Merged
leonkenneth merged 3 commits into
mainfrom
refacto-uniformize-profile-display-primitives
Jul 10, 2026
Merged

fix: harden profile reuse and uniformize profile display and reuse#45
leonkenneth merged 3 commits into
mainfrom
refacto-uniformize-profile-display-primitives

Conversation

@leonkenneth

Copy link
Copy Markdown
Contributor

There was still remnance of profile inspect and profile show

I kept the inspect one as it looked simpler

I also added a heuristic to explicitly reuse a profile if it's not configured yet and special-case ENV-supplied credentials into a pseudo-profile

@albert20260301

Copy link
Copy Markdown
Contributor

The semantic title check is failing because improve: is not an allowed Conventional Commit type.

Suggested title:

fix: harden profile reuse and uniformize profile display

feat: would also work if this is intended as a user-visible capability rather than a hardening/fix PR.

@leonkenneth leonkenneth changed the title improve: harden profile reuse and uniformize profile display and reuse fix: harden profile reuse and uniformize profile display and reuse Jul 10, 2026
@albert20260301

Copy link
Copy Markdown
Contributor

The title is fixed now. The remaining Test CLI failure is a stale assertion from the profile output refactor:

TypeError: undefined is not an object (evaluating 'JSON.parse(result.stdout).profile.user.email')

profile show now returns identity under profile.principal, so this line in tests/integration.e2e.ts should change:

-    expect(JSON.parse(result.stdout).profile.user.email).toBe("agent@x.io");
+    expect(JSON.parse(result.stdout).profile.principal.email).toBe("agent@x.io");

I verified the related non-service checks locally:

bun test "$PWD"/tests/context.test.ts "$PWD"/tests/scripting.test.ts
./cli/node_modules/.bin/tsc -p tsconfig.tests.json
git diff --check

The full tests/integration.e2e.ts cannot be fully reproduced in this workspace without the CI altertable-mock service on port 15000; locally it fails earlier with network exit code 9. I also tried pushing this one-line fix directly, but this account does not have write permission to the org-owned PR branch.

The profile-display refactor left ConfigureOptions.org half-removed:
resolveConfigureProfile and the interactive wizard still read options.org,
breaking typecheck. Finish the removal — org is not a configuration option —
by threading it as an explicit argument to configureRunSet, which still
derives the auto profile name and persists organization_slug.

Drop managementWhoamiOperation, orphaned when the refactor removed
`profile show`'s live-whoami call (profile show is now stored-only) — which
knip flagged as an unused export.

Align the lakehouse integration e2e with that same change: `profile show`
no longer enriches identity via /whoami, so assert the stored profile shape
(profile.name) instead of the removed profile.user.email. This suite isn't
run by the local --quick gate (needs the mock server), so the refactor
missed it.

tests/helpers: force NO_COLOR in the black-box CLI subprocess so citty's
colorized arg-validation errors don't break plain-text assertions locally
(CI already sets CI=1).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@leonkenneth leonkenneth force-pushed the refacto-uniformize-profile-display-primitives branch from 88c3424 to 3fa5d84 Compare July 10, 2026 08:54
@leonkenneth leonkenneth merged commit 23ca8f1 into main Jul 10, 2026
9 checks passed
@leonkenneth leonkenneth deleted the refacto-uniformize-profile-display-primitives branch July 10, 2026 09:40
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.

3 participants