feat(auth): complete developer onboarding during auth login (DEVX-545)#129
feat(auth): complete developer onboarding during auth login (DEVX-545)#129smukherjee-godaddy wants to merge 1 commit into
Conversation
After OAuth succeeds, fetch org status from devx-core, prompt PENDING users to accept agreements, and enrich the native login envelope with org_id/onboarding without changing cli-engine formats. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a binary-boundary intercept for gddy auth login so OAuth still runs through cli-engine, then performs developer org onboarding via devx-core (status check + optional completion), including interactive agreement prompting and enriched login output (org_id + onboarding state).
Changes:
- Introduces a new
onboardingmodule (client/types/flow/prompt) to query/onboarding/statusand call/onboarding/cliwhen needed. - Adds a new
auth_logindispatch path inmain.rsto post-process successful OAuth login results, enforce agreement acceptance rules, and re-render in the caller’s requested format. - Extends environment resolution with a built-in
devx_core_url(plusDEVX_CORE_URLoverride) for prod/ote.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| rust/src/onboarding/types.rs | Defines onboarding API envelope/data types and internal domain structs. |
| rust/src/onboarding/prompt.rs | Implements the interactive agreements prompt (TTY + Enter). |
| rust/src/onboarding/mod.rs | Wires and re-exports onboarding module surface area. |
| rust/src/onboarding/flow.rs | Centralizes decision logic for when to prompt/require/complete onboarding. |
| rust/src/onboarding/client.rs | Adds a reqwest-based devx-core onboarding client with unit tests. |
| rust/src/main.rs | Intercepts auth login before cli.execute() and routes to auth_login::run. |
| rust/src/environments/mod.rs | Adds devx_core_url() resolution (built-ins + env var override) with tests. |
| rust/src/auth_login/output.rs | Adds helpers to apply onboarding results and construct structured AGREEMENTS_REQUIRED output. |
| rust/src/auth_login/mod.rs | Implements the login post-processing flow and output routing. |
| rust/src/auth_login/args.rs | Adds argument parsing/stripping to force internal JSON and preserve requested output format. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let prompt_accepted = if status.status == "PENDING" && is_tty { | ||
| Some(prompt_accept_agreements(reader, stderr).unwrap_or(false)) | ||
| } else { | ||
| None | ||
| }; |
| match status.status.as_str() { | ||
| "ACTIVE" => AgreementDecision::AlreadyComplete { | ||
| org_id: status.org_id.clone(), | ||
| }, | ||
| "PENDING" if is_tty && prompt_accepted == Some(true) => AgreementDecision::CompletePending, | ||
| "PENDING" if !is_tty && accept_flag => AgreementDecision::CompletePending, | ||
| "PENDING" => AgreementDecision::AgreementsRequired, | ||
| _ => AgreementDecision::UnsupportedStatus, | ||
| } |
| "--output" | "-o" => { | ||
| index += 1; | ||
| if index < args.len() { | ||
| index += 1; | ||
| } | ||
| } |
There was a problem hiding this comment.
I don't think we want this; unlike the original CLI which was tied very closely to the GPA developer platform, it's now more customer-oriented instead of developer-registration oriented. I'm not sure that developer onboarding is something we need globally for all CLI users. Opened a discussion thread here for determining how we want to address the original feedback around this ticket.
https://godaddy.slack.com/archives/C0B2PFYEW8J/p1784564948280179
|
Closing in favor of a revised approach agreed with JPage. Why: New direction (DEVX-545):
|
|
Closed — superseded by application-init onboarding approach on DEVX-545. |
Summary
gddy auth loginat the binary boundary so OAuth still runs throughcli-engine, then complete org onboarding via devx-core (/onboarding/status+/onboarding/cli).--accept-agreementsin non-TTY flows; emit structuredAGREEMENTS_REQUIREDotherwise.org_id/onboarding, keep onboarding API failures non-fatal after OAuth success, and re-render with the caller’s originaljson/human/toonformat (no PR feat(output): restore the { ok, command, result, next_actions } envelope (DEVX-543) #113 adapter).Test plan
cargo fmt --check,cargo clippy -- -D warnings,cargo test(326 passed)gddy auth login --help,gddy --version, andgddy auth statusbypass onboardinggddy auth loginas a PENDING org → agreement links on stderr → Enter →onboarding: complete+org_idgddy auth loginwithout--accept-agreements→ exit 1 /AGREEMENTS_REQUIREDgddy auth login --accept-agreements→ completes without promptorg_id/onboarding: completeonboarding: failedwarningMade with Cursor