Skip to content

feat(profile): log in to the highlighted profile with l, and mark an ended browser login with 💤 - #28

Merged
grubmeshi merged 1 commit into
mainfrom
feat/profile-tui-login
Oct 7, 2026
Merged

grubmeshi merged 1 commit into
mainfrom
feat/profile-tui-login

Conversation

@grubmeshi

Copy link
Copy Markdown
Collaborator

What

  • l in meshstack profile runs meshstack login for the highlighted profile, in process, through tea.Exec. The list gives up the terminal, so the browser text and the workspace prompt work as usual.
    • After a successful login, the list comes back with "Logged in to profile 'x'." in the status line.
    • After a failed or cancelled login, the list ends, and the login's error is printed once.
  • 💤 marker next to 🏠 for a profile whose browser login session ended, or whose session a logout removed. auth.BrowserLoginEnded reads only local files and calls no meshStack.
  • auth status / profile show prefix "Session ended" with 💤.

How the lock works

The list holds the exclusive profile lock, and the login takes the same lock. So the list releases its lock before the login, and locks and reloads the profiles after a successful one. run() now releases whatever lock the final model holds, because a login replaces it.

cmd/auth gets NewLoginTo(profile), which puts a profile source before the global flags. cmd/profile may now import cmd/auth (.golangci.yml).

Known limits (accepted)

  • l on an API key or API token profile starts a browser login, which switches the profile's credential, just as meshstack login -p x does.
  • The flags and environment of the meshstack profile call (--endpoint, MESHSTACK_ENDPOINT) also apply to the login. A profile for another endpoint then fails, as meshstack login -p x would.
  • Warnings that the login logs stay held until the list ends.

Tests

TestTheTableMarksTheCurrentProfileAndADialogAsksBeforeItDeletes now also checks 💤 for a logged-out browser login and the l help entry. No unit test presses l, because that needs a live login. I have not tried l by hand against a meshStack.

🤖 Generated with Claude Code

…ended browser login with 💤

The list of meshstack profile runs meshstack login for the highlighted profile on l, and goes
back to the list once the login succeeds. A failed login ends the list with its error. A profile
whose browser login session ended, or was logged out, shows 💤 next to 🏠, and auth status and
profile show prefix "Session ended" with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@meshcloud-gh-actions

Copy link
Copy Markdown

Coverage of the acceptance run against the meshStack backend, on bb001c8067cbc9df135ad196c39d850854038bb4.

Scope Coverage
Unit tests 78.9%
Acceptance tests 52.5%
Combined 83.1%
Uncovered functions
client/api_key.go:55: meshApiKeyClient.Create 0.0%
client/api_key.go:59: meshApiKeyClient.Read 0.0%
client/api_key.go:63: meshApiKeyClient.Update 0.0%
client/api_key.go:71: meshApiKeyClient.Delete 0.0%
client/api_key_permissions.go:20: ApiKeyPermissions.AllCodes 0.0%
client/api_key_permissions.go:33: ApiKeyPermissions.WorkspaceCodes 0.0%
client/api_key_permissions.go:295: AllApiKeyPermissions 0.0%
client/api_key_permissions.go:299: WorkspacePermissionCodes 0.0%
client/building_block_definition.go:71: MeshBuildingBlockDefinitionApprovalPolicies.NothingRequiresApproval 0.0%
client/building_block_definition.go:82: DisabledSchedule 0.0%
client/building_block_definition.go:89: MeshBuildingBlockDefinitionSchedule.IsDisabled 0.0%
client/building_block_definition.go:93: MeshBuildingBlockDefinitionSpec.HasNeutralPolicies 0.0%
client/building_block_definition.go:97: MeshBuildingBlockDefinitionSpec.WithNeutralPolicies 0.0%
client/building_block_definition.go:166: meshBuildingBlockDefinitionClient.List 0.0%
client/building_block_definition.go:173: meshBuildingBlockDefinitionClient.Read 0.0%
client/building_block_definition.go:177: meshBuildingBlockDefinitionClient.Create 0.0%
client/building_block_definition.go:181: meshBuildingBlockDefinitionClient.Update 0.0%
client/building_block_definition.go:185: meshBuildingBlockDefinitionClient.Delete 0.0%
client/building_block_definition_version.go:100: MeshBuildingBlockType.TagInputTargets 0.0%
client/building_block_definition_version.go:245: meshBuildingBlockDefinitionVersionClient.Create 0.0%
client/building_block_definition_version.go:254: meshBuildingBlockDefinitionVersionClient.Update 0.0%
client/building_block_definition_version_implementation.go:80: MeshBuildingBlockDefinitionImplementation.InferType 0.0%
client/building_block_definition_version_implementation.go:94: MeshBuildingBlockDefinitionImplementation.MarshalJSON 0.0%
client/building_block_definition_version_implementation.go:107: *MeshBuildingBlockDefinitionImplementation.UnmarshalJSON 0.0%
client/building_block_runner.go:82: meshBuildingBlockRunnerClient.Create 0.0%
... and 129 more

covdata func names a method without its receiver, so an entry can belong to an implementation nothing selects rather than to a function the tests never reached. Open the file and line before reading one as a coverage gap.

@grubmeshi
grubmeshi marked this pull request as ready for review October 7, 2026 07:41
@grubmeshi
grubmeshi merged commit 284900d into main Oct 7, 2026
11 checks passed
@grubmeshi
grubmeshi deleted the feat/profile-tui-login branch October 7, 2026 07:41
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