Skip to content

feat(auth): complete developer onboarding during auth login (DEVX-545)#129

Closed
smukherjee-godaddy wants to merge 1 commit into
godaddy:rust-portfrom
smukherjee-godaddy:DEVX-545-auth-onboarding
Closed

feat(auth): complete developer onboarding during auth login (DEVX-545)#129
smukherjee-godaddy wants to merge 1 commit into
godaddy:rust-portfrom
smukherjee-godaddy:DEVX-545-auth-onboarding

Conversation

@smukherjee-godaddy

Copy link
Copy Markdown
Contributor

Summary

  • Intercept gddy auth login at the binary boundary so OAuth still runs through cli-engine, then complete org onboarding via devx-core (/onboarding/status + /onboarding/cli).
  • Prompt PENDING users for agreement acceptance on a TTY (stderr links + Enter); require --accept-agreements in non-TTY flows; emit structured AGREEMENTS_REQUIRED otherwise.
  • Enrich the native login envelope with org_id / onboarding, keep onboarding API failures non-fatal after OAuth success, and re-render with the caller’s original json / human / toon format (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, and gddy auth status bypass onboarding
  • Interactive: gddy auth login as a PENDING org → agreement links on stderr → Enter → onboarding: complete + org_id
  • Non-interactive: gddy auth login without --accept-agreements → exit 1 / AGREEMENTS_REQUIRED
  • Non-interactive: gddy auth login --accept-agreements → completes without prompt
  • Already ACTIVE org → no prompt; login data includes org_id / onboarding: complete
  • Devx-core unavailable after OAuth → login still succeeds with onboarding: failed warning

Made with Cursor

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>

Copilot AI 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.

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 onboarding module (client/types/flow/prompt) to query /onboarding/status and call /onboarding/cli when needed.
  • Adds a new auth_login dispatch path in main.rs to 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 (plus DEVX_CORE_URL override) 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.

Comment on lines +37 to +41
let prompt_accepted = if status.status == "PENDING" && is_tty {
Some(prompt_accept_agreements(reader, stderr).unwrap_or(false))
} else {
None
};
Comment on lines +17 to +25
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,
}
Comment on lines +41 to +46
"--output" | "-o" => {
index += 1;
if index < args.len() {
index += 1;
}
}

@jpage-godaddy jpage-godaddy 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.

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

@smukherjee-godaddy

smukherjee-godaddy commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of a revised approach agreed with JPage.

Why: gddy is general-purpose; GPA agreement acceptance should not run on auth login.

New direction (DEVX-545):

  • Do not onboard during gddy auth login
  • Gate onboarding on gddy application init (future: gddy gpa application init / optional gddy gpa onboard)
  • Only PENDING users are prompted (TTY) or must pass --accept-agreements (non-TTY)
  • Non-GPA commands stay unaffected

Ticket: https://godaddy-corp.atlassian.net/browse/DEVX-545

@smukherjee-godaddy

Copy link
Copy Markdown
Contributor Author

Closed — superseded by application-init onboarding approach on DEVX-545.

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