Skip to content

fix(setup): allow deselecting previously enabled APIs in gws auth setup#570

Open
haunchen wants to merge 1 commit intogoogleworkspace:mainfrom
haunchen:worktree-fix-529-deselect-apis
Open

fix(setup): allow deselecting previously enabled APIs in gws auth setup#570
haunchen wants to merge 1 commit intogoogleworkspace:mainfrom
haunchen:worktree-fix-529-deselect-apis

Conversation

@haunchen
Copy link
Contributor

Summary

gws auth setup marks already-enabled APIs as is_fixed: true in the TUI picker, preventing users from deselecting them. This is a problem when:

  • The user initially selected all APIs by mistake
  • Their Google Workspace org restricts certain APIs
  • They want to reduce the scope of enabled APIs

Changes:

  • Change is_fixed: alreadyis_fixed: false so previously enabled APIs are pre-selected but toggleable
  • Add disable_apis() function (mirrors enable_apis()) to disable deselected APIs via gcloud services disable
  • Update picker help text to indicate that deselecting disables the API
  • Update status message to report disabled count
  • Add dry-run support with apis_would_disable output

Closes #529

Test plan

  • cargo clippy -- -D warnings — clean
  • cargo test — 42 setup tests pass (including 4 new tests)
  • New: test_pipeline_previously_enabled_can_be_deselected — verifies pre-selected items can be toggled off
  • New: test_disable_apis_with_no_apis — empty input returns empty results
  • New: test_disable_apis_with_invalid_project — invalid project produces failure with error message
  • Manual: run gws auth setup on a project with previously enabled APIs, deselect one, confirm it gets disabled

…tup`

The API picker marked already-enabled APIs as `is_fixed: true`, preventing
users from reducing their enabled API set. Now previously enabled APIs are
pre-selected but toggleable. Deselected APIs are disabled via
`gcloud services disable`.

Closes googleworkspace#529
@changeset-bot
Copy link

changeset-bot bot commented Mar 20, 2026

🦋 Changeset detected

Latest commit: 5ecdefc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@googleworkspace/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gemini-code-assist
Copy link
Contributor

Warning

Gemini encountered an error creating the summary. You can try again by commenting /gemini summary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gws auth setup cannot deselect previously enabled APIs

2 participants