Filter gauges list by project

RO
14d ago
+282-21

basecamp gauges list could only list gauges across the whole account. Basecamp's gauges report also takes a list of projects (bucket_ids on GET /reports/gauges.json), and basecamp-sdk v0.37.0 exposes it as GaugeListOptions.BucketIDs (basecamp/basecamp-sdk#1081). This change bumps the SDK to that release and passes the filter through.

What changes for users

  • --in <project> (or --project) narrows the list to one project. The group already took this flag, but list silently ignored it.
  • --projects a,b narrows it to several, as names or IDs, comma-separated or repeated. It combines with --in; repeats are dropped.
  • Gauges come back in the order the projects were named, which is how the API orders a filtered report.
  • With no project named, the list stays account-wide. A configured default project (project_id, or a global --project) never narrows this report: only a flag given to gauges list does.
  • An empty, zero or negative entry, or a name that matches no project, is refused before any request is sent.
  • The summary reads N gauge(s) in M project(s) when filtered.

The SDK bump

make bump-sdk REF=v0.37.0. One break: Reports().OverdueTodos now takes a page. reports overdue passes 0, which sends the same single request it did before. The overdue report's JSON gains the SDK's additive meta field. Proper paging for that report is #1044, which pins a later SDK and should rebase over this cleanly (the go.mod and one-line reports.go overlap resolve to its side).

The CLI's own MCP server (basecamp mcp) reads a vendored copy of the SDK model, which must match the pinned SDK, so it is re-synced from v0.37.0 with scripts/sync-mcp-model.sh. That lets its list_gauges take bucket_ids and its get_overdue_todos take page; the catalog snapshot changes by one description line.

Tests

internal/commands/gauges_test.go records the requests sent: no bucket_ids without a flag or with only a configured project; the named projects in order through --in, --project, --projects (comma-separated and repeated), the two combined, repeats dropped, IDs made canonical, and names resolved; and bad values refused with no gauges request at all. .surface and API-COVERAGE.md are updated.

The separate basecamp-mcp-server repo's matching gap is tracked on its own card and is not part of this change.


Summary by cubic

basecamp gauges list could only list gauges across the whole account; it now narrows the report to the projects you name with --in/--project or --projects, which is required to use the MCP list_gauges tool with bucket_ids.

  • --in and --projects are mutually exclusive; passing both is refused, and an empty value no longer widens the report to the whole account.
  • Bumps basecamp-sdk to v0.37.0, which exposes GaugeListOptions.BucketIDs and requires a page argument on Reports().OverdueTodos (the CLI passes 0, keeping the same single request).
  • With no project named, the list stays account-wide; a configured default project never narrows it.
  • Projects are resolved by name or ID, kept in the order named, deduplicated, and rejected if empty, zero, negative, or unknown before any request is sent.
  • Added --projects flag, updated the MCP model and catalog snapshot, refreshed the Nix vendor hash for the SDK bump, and added tests covering filtering, ordering, deduplication, and refusal cases.