Skip to content

Google: warn of a project the login can't read - #113

Open
odgrim wants to merge 2 commits into
mainfrom
track-a/google-project-warning
Open

odgrim wants to merge 2 commits into
mainfrom
track-a/google-project-warning

Conversation

@odgrim

@odgrim odgrim commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Change

A project Google refuses the principal is still used, but the identity now warns:

someone@example.com can't read project "locked-9999": commands that use it may be refused.

Before, the project was taken silently. Runbooks main showed "Project X is not accessible with these credentials".

  • Only a refusal warns, as denies_project reads one (403 PERMISSION_DENIED and the like). A project Google can't answer for, such as a 503, has no warning.
  • select of another project drops the warning.
  • A pinned project Google refuses is still pinMismatch.

Decisions

  • The warning lives on the chosen project (ChosenProject { target, warning }), so a select that replaces the project can't keep a stale warning.
  • The project id is quoted and escaped, since it comes from gcloud's configuration or the environment.

Gaps

  • The "(another account)" label on a gcloud configuration set up for another account comes in a separate change.
  • No test pins that the project id in the warning is quoted: quoted is tested only through Google: waiting prompt, keyFile ~, and Sign-In unavailable without a client #108's account test.
  • No test checks that a project Google confirms has no warning before select.
  • select doesn't ask Google, so a selected project the identity can't read has no warning.
  • The warning prints the principal as identity.principal holds it, not cut or escaped.

Evidence

  • a_project_the_identity_cannot_read_is_used_with_a_warning failed before the change: left: false right: true, with identity {"kind":"user",...,"targets":{"project":{"id":"locked-9999","name":"locked-9999"}}} and no warnings.
  • Hand mutants, each failing only that test (151 passed, 1 failed): select keeping the old warning, and warning on any error.
  • mise run check: 485 tests run: 485 passed, 0 skipped.
  • CI's mutation test at 1c447ac: 5 mutants tested in 3m: 1 caught, 4 unviable. Audit dependencies is red, as on main, until the pin-project-lite 0.2.19 lock update.

A project Google refuses the principal is still used, since a credential
without resourcemanager.projects.get still works, but the identity now
warns that commands using it may be refused. Runbooks main said so too.
A project Google can't answer for has no warning, and selecting another
project drops it.
@odgrim
odgrim force-pushed the track-a/google-project-warning branch from ad83ff2 to e91fec6 Compare December 6, 2026 07:57
@odgrim
odgrim changed the base branch from track-a/google-release-gaps to main December 6, 2026 15:26
@odgrim
odgrim marked this pull request as ready for review December 6, 2026 15:43

This branch has not been deployed

No deployments
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.

1 participant