Skip to content

Prepare connection and password helpers for branches, and tidy up output - #268

Open
nathanjcochran wants to merge 1 commit into
mainfrom
nathan/branches-0-foundation
Open

nathanjcochran wants to merge 1 commit into
mainfrom
nathan/branches-0-foundation

Conversation

@nathanjcochran

@nathanjcochran nathanjcochran commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Groundwork for branch support, which the PRs stacked on this one add, plus a few unrelated cleanups. Apart from the cleanups listed below, nothing user-facing changes.

  • API client. openapi.yaml is synced from the Tiger Cloud API spec and the client is regenerated. This brings in the branch endpoints and the resolve endpoint, which nothing uses yet.
  • Connection targets. ConnectionTarget held two api.Service values: the one to connect to, and the one whose credentials to use. A read replica set had to be dressed up as a service to fit. It now holds just what connecting needs (kind, ID, name, status, environment tag, endpoint, pooler) and a CredentialOwner, with a constructor per kind. GetConnectionDetails takes a target, and CheckServiceReady became CheckReady, which takes a status.
  • Password storage. The keyring and pgpass storage, SavePasswordWithResult, and GetPassword take a PasswordTarget (project ID, ID, and endpoint) instead of an api.Service. The keyring key format is unchanged. The password reset helpers take a CredentialOwner.

User-facing cleanups:

  • Empty lists stay structured. service list and service backup list print [] for an empty list with -o json/yaml, instead of nothing. Empty-result messages appear only in table output, on stderr. This also applies to service backup region list and service metrics series.
  • No guessed ports. An endpoint or connection pooler without a port is no longer shown with 5432 or 6432 filled in, in tiger service get/list or the MCP service detail. pgpass storage, which keys entries by host and port, refuses such an endpoint rather than assuming 5432.
  • Password updates accept only the 204 the API returns, not a 200.

The output*Table functions now take their writer first, and the service output functions take an options struct.

…tidy up output

Sync openapi.yaml and regenerate the API client.

Connections now go through a ConnectionTarget built from what connecting
needs (endpoint, status, environment tag, credential owner) rather than a
pair of api.Service values, and passwords are stored against a
PasswordTarget. A read replica set is no longer dressed up as a service.

Also:
- Empty lists print [] in json/yaml; their table-case messages go to stderr.
- output*Table functions take their writer first.
- No port is guessed for an endpoint without one.
- The password update endpoints accept only a 204.
@nathanjcochran
nathanjcochran added this pull request to stack #273 October 21, 2026 22:07
@nathanjcochran nathanjcochran changed the title Prepare connection and password helpers for non-service targets, and tidy up output Prepare connection and password helpers for branches, and tidy up output Oct 21, 2026
@nathanjcochran
nathanjcochran marked this pull request as ready for review October 21, 2026 22:20
@nathanjcochran
nathanjcochran requested a review from a team as a code owner October 21, 2026 22:20
@nathanjcochran nathanjcochran self-assigned this Oct 21, 2026
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