Skip to content

feat: add cli signup browser flow#13

Merged
tkkhq merged 6 commits into
mainfrom
feat/signup
Jun 29, 2026
Merged

feat: add cli signup browser flow#13
tkkhq merged 6 commits into
mainfrom
feat/signup

Conversation

@tkkhq

@tkkhq tkkhq commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add volcano signup command with git email prefill/override
  • open Volcano Web signup flow instead of calling password-based signup API
  • add local build support for VOLCANO_WEB_URL via .env.local

Tests

  • go test ./...
  • make build

@tkkhq tkkhq marked this pull request as ready for review June 29, 2026 15:06
@tkkhq tkkhq requested a review from a team as a code owner June 29, 2026 15:06
Copilot AI review requested due to automatic review settings June 29, 2026 15:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@marckong marckong left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Adds a volcano signup command that prefills the email from git config --global user.email, opens Volcano Web's /signup page (with the device user_code threaded through a next param), then completes the existing device-authorization handshake and persists credentials. Introduces a configurable VOLCANO_WEB_URL (compiled default + env override) and a make local target for pointing builds at a dev backend via .env.local.

  • WebSignupURL validation runs before a device code is allocated, so a misconfigured web URL fails fast.
  • completeBrowserLogin is cleanly refactored to take an explicit browserURL, reused by both login and signup.
  • Good test coverage: URL builder, email prompt/validation, and the full signup browser flow.

Review

Clean, well-scoped change — build and the affected test packages (api, auth, cmd/auth, config, cmd/root) all pass, and the new code mirrors existing login conventions. No blocking issues found. Approving. 🚀

  • Minor (non-blocking): at runtime, when the CLI is pointed at a loopback VOLCANO_API_URL without VOLCANO_WEB_URL, WebURL() still returns the production default (https://volcano.dev) — the localhost:3000 fallback only exists in make local. Documented, so likely intentional, but worth confirming it matches the intended local-dev UX.

Overall correctness: correct. No bugs that break existing code or tests; the patch is free of blocking issues.

@swkeever swkeever left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed signup flow, URL/config wiring, and build/test paths. No blocking issues found.

Signup previously built its browser URL from cfg.WebURL(), which fell back
to the production default even when the CLI was pointed at a loopback or
non-prod VOLCANO_API_URL without VOLCANO_WEB_URL set. That made signup open
the wrong web origin while the device code lived on a different backend.

Derive the signup origin (and device-approval path) from the device
authorization response's verification URI instead — the same source login
uses — so signup always follows the targeted backend. Precedence is now:
explicit VOLCANO_WEB_URL override > backend-derived origin > compiled default.

- add api.VerificationWebTarget to extract origin + device path from the
  device-auth response (prefers verification_uri_complete)
- add config.WebURLOverride so an explicit env override wins without
  mistaking the compiled default for one
- signup tests now assert backend-following behavior + override precedence
- add VerificationWebTarget unit tests
- docs: VOLCANO_WEB_URL is now an optional override

Addresses review feedback on #13.
@tkkhq

tkkhq commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author
  • Minor (non-blocking): at runtime, when the CLI is pointed at a loopback VOLCANO_API_URL without VOLCANO_WEB_URL, WebURL() still returns the production default (https://volcano.dev) — the localhost:3000 fallback only exists in make local. Documented, so likely intentional, but worth confirming it matches the intended local-dev UX.

Fixed in 52a58cd by making signup follow the same source as login

@tkkhq tkkhq added this pull request to the merge queue Jun 29, 2026
Merged via the queue into main with commit 8c8bf6d Jun 29, 2026
8 checks passed
@tkkhq tkkhq deleted the feat/signup branch June 29, 2026 16:13
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.

4 participants