feat(auth): add guided Google setup#865
Conversation
|
Codex review: needs changes before merge. Reviewed June 22, 2026, 12:19 PM ET / 16:19 UTC. Summary Reproducibility: not applicable. as a bug report, but the PR defect is source-reproducible: with gcloud installed and an active project configured, Review metrics: 3 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Security Review findings
Review detailsBest possible solution: Fix the explicit-project validation for creation, add regression coverage for an active gcloud project fallback, then leave the new command surface for maintainer acceptance. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug report, but the PR defect is source-reproducible: with gcloud installed and an active project configured, Is this the best way to solve the issue? No: the guided setup direction is plausible, but the current implementation should not allow project creation to rely on an inherited active gcloud project when the help and error text require an explicit new ID. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 861adbd73cb9. Label changesLabel changes:
Label justifications:
Evidence reviewedAcceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
82baa0a to
96d9718
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 96d97188bf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if gcloudAvailable { | ||
| account, _ = authSetupGcloudValue(ctx, "account") | ||
| if project == "" { | ||
| project, _ = authSetupGcloudValue(ctx, "project") |
There was a problem hiding this comment.
Require an explicit project before creation
Because the project is backfilled from the active gcloud config before the --create-project validation, gog auth setup --create-project passes validation whenever the user already has an active gcloud project even though no new --gcloud-project was supplied. It then prompts and runs gcloud projects create <active-project>, which normally fails after confirmation or targets an unintended configured value instead of enforcing the documented new project ID requirement.
Useful? React with 👍 / 👎.
|
Landed as Verification:
Landing fix: setup guidance now preserves a selected root |
Summary
Adds
gog auth setup, a guided path through the Google Cloud and OAuth prerequisites that currently require users to assemble several commands and Console pages themselves.The command can:
gog auth addwith matching account/client resolution;--dry-run --json --no-input.When gcloud is unavailable, the command remains useful: it emits ordered manual next steps and direct project-scoped Console URLs instead of failing unless a gcloud-only action was explicitly requested.
Design details
exec.CommandContext; no shell interpolation.CLOUDSDK_CORE_DISABLE_PROMPTS=1for deterministic automation.auth adddoes when an email is supplied, preventing a saved-client/login-client mismatch.--projectselector alias collision by naming the Cloud flag--gcloud-project(--project-idalias).User-visible examples
Validation
make ciclawmac.local: built the branch binary and ranauth setup --services gmail,drive --json --no-input; verified guided fallback status, two mapped APIs, and actionable next steps--open-consolevalidation and shared client resolution)Safety
The live proof was read-only. No Cloud project was created, no API was enabled, no credentials were stored, and no OAuth flow or browser was started.