Skip to content

BREV-13200: fail closed on account creation errors in CLI login - #519

Merged
patelspratik merged 2 commits into
mainfrom
fix/brev-13200-cli-duplicate-login
Oct 21, 2026
Merged

patelspratik merged 2 commits into
mainfrom
fix/brev-13200-cli-duplicate-login

Conversation

@jarrad

@jarrad jarrad commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Remove the CLI login fallback that treated duplicate-looking error text as a successful existing-account login.
  • Call LoginStore.CreateUser directly and continue to /api/me only after a successful account API response.
  • Remove the unused CreateNewUser (bool, error) helper. Its sole caller discarded the boolean, and a successful HTTP 201 cannot distinguish a new account from one brev-deploy recovered for the same token.

Account contract and rollout

The live CLI calls brev-deploy POST /api/users, not dev-plane directly. BREV-13201 makes brev-deploy consume dev-plane AlreadyExists, resolve only the account owned by the supplied token, and return HTTP 201. A username collision with no account for that token remains an error. There is no public duplicate-account code for the CLI to consume, so the old false, nil text-match path is obsolete.

Deploy BREV-13201's dev-plane producer first, then its brev-deploy bridge, before releasing this CLI change. This PR targets brev-cli main and does not depend on generic CLI parser PR #515.

Proof

  • Red on baseline: uncoded_collision_text incorrectly continued to /api/me.
  • Green: go test ./pkg/cmd/login -count=1 after both commits.
  • On current head 8f07a09a, build, format, lint, vet, CodeQL, CLI output compatibility, and full repository tests passed. GitHub's release-test steps and workflow report success, though the job/check record remains in_progress at the time of this update.
  • git diff --check passed and the worktree is clean.

Issue: https://linear.app/nvidia/issue/BREV-13200/replace-duplicate-user-text-matching-in-brev-cli-login

@jarrad
jarrad marked this pull request as ready for review October 21, 2026 15:59
@jarrad
jarrad requested a review from a team as a code owner October 21, 2026 15:59
@patelspratik
patelspratik merged commit 9133287 into main Oct 21, 2026
10 checks passed
@patelspratik
patelspratik deleted the fix/brev-13200-cli-duplicate-login branch October 21, 2026 20:52
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