`gcloud services list` False Negatives When Combining `--limit` and `--filter`

Open Beginner friendly
#242 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
79/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
google-cloud

Research direction

Review .agents/skills/gcloud/SKILL.md under Data Reduction Strategies → Limiting and Location Discovery, plus .agents/skills/gcloud/references/cli-usage.md around project setup. Confirm the documented commands address filtered gcloud services list checks, Firestore location discovery, project verification, ADC quota project sync, and Cloud Run region setup. Done means those guidance updates are present and use the intended command examples.

Written by the indexing model from the issue text.

Description

1. The Core Problem (gcloud services list + --limit + --filter)
  • What the skill currently instructs: gcloud/SKILL.md mandates data reduction flags (--limit, --filter, --format) on every gcloud ... list invocation to avoid context window exhaustion.
  • What happens in practice: When checking whether a set of required APIs is enabled on a project (for example, run.googleapis.com, firestore.googleapis.com, cloudbuild.googleapis.com, and artifactregistry.googleapis.com), an agent following the data-reduction rule runs:
    gcloud services list --enabled \
      --filter="config.name:(run.googleapis.com OR firestore.googleapis.com OR cloudbuild.googleapis.com OR artifactregistry.googleapis.com)" \
      --format="table(config.name,state)" \
      --limit=10 --quiet
    
  • Why it fails: In the Google Cloud SDK (lib/surface/services/list.py), gcloud services list passes args.limit directly to serviceusage.ListServices(project, args.enabled, args.page_size, args.limit) before client-side --filter evaluation runs.
  • Symptom: --limit=10 retrieves only the first 10 enabled services on the project in alphabetical order (which includes artifactregistry.googleapis.com, starting with a) and stops paging before reaching cloudbuild.googleapis.com, firestore.googleapis.com, or run.googleapis.com. Even immediately after gcloud services enable succeeds, re-running the check still shows only artifactregistry.googleapis.com, causing false negatives where enabled APIs appear disabled.
  • Fix in patch: Documents this gotcha under Data Reduction Strategies → Limiting in SKILL.md, instructing agents to omit --limit and rely on --filter="config.name:(...)" + --format="table(config.name,state)" when checking specific APIs via gcloud services list.
2. Secondary Onboarding & Discovery Gaps Addressed
  • Firestore location discovery: Provisioning a Firestore database requires an explicit --location flag, and available Firestore locations differ from Compute Engine regions (including multi-regions like nam5/eur3). The patch adds gcloud firestore locations list --format="table(locationId,displayName)" to Location Discovery in SKILL.md.
  • Project lookup, verification, and ADC quota project sync: references/cli-usage.md previously showed gcloud config set core/project {project_id} in isolation without showing how to discover available projectId values, verify the active project, synchronize the Application Default Credentials (ADC) quota project (gcloud auth application-default set-quota-project), or set the default Cloud Run region (gcloud config set run/region) non-interactively with --quiet.

0001-gcloud-document-services-list-limit-gotcha-and-proje.patch

Dominant language
Python
Stars
23.1k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from google/skills

All issues in google/skills

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.