Repository navigation
Tags
Tags
feat(database): in-place PostgreSQL major version upgrades
Add UpgradeDatabaseVersion for POST /v3alpha1/databases/{id}/upgrade-version
with its pre-flight checks, and expose MajorUpgradesAvailable and the
progress of the latest major upgrade (VersionUpgrade) on databases.
Also stop promising a single restart per database for engine upgrades: a
database can restart more than once while its engine steps through releases.
build: bump x/net to v0.61.0 and run every workflow on the go.mod too… …lchain The security workflow fails on four golang.org/x/net advisories (GO-2026-6603, 6611, 6612, 6617) found in v0.55.0 and fixed in v0.60.0. Every x/net release from v0.60.0 on requires go 1.26.0, so the go directive moves from 1.25.13 to 1.26.0 along with the bump; consumers on Go 1.25 will switch toolchains automatically under GOTOOLCHAIN=auto. The toolchain directive moves to go1.26.10, which also clears GO-2026-6809 (crypto/x509) that govulncheck reports against go1.26.9. test and lint used the GO_VERSION repository variable (1.25.13), which can no longer build the module, and security asked for the 1.26 line independently of the other two. All three now read go.mod, so the toolchain line is the single place that selects the Go version for building, linting and scanning. Verified locally on go1.26.10: go build, go test and govulncheck ./... (no vulnerabilities found). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ci: run govulncheck on Go 1.26
The security job installs golang.org/x/vuln/cmd/govulncheck@latest, and v1.8.0
requires Go 1.26 ("golang.org/x/vuln@v1.8.0 requires go >= 1.26.0 (running go
1.25.13; GOTOOLCHAIN=local)"), so every run has failed at the install step since
that release regardless of the change under test. setup-go pins GOTOOLCHAIN=local,
so the toolchain directive in go.mod does not help here; the job now asks for the
1.26 line itself (check-latest picks the newest patch, 1.26.8 today, which also
clears the six standard-library advisories the scan would otherwise report).
lint and test keep following the GO_VERSION variable; moving that to 1.26 as well
would make the three jobs agree again.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Fix FindObjectStoreCredential for names longer than 30 characters (#290) Credentials auto-created alongside an object store get a generated name: the store name trimmed to 29 characters (when longer than 30) plus a hash/uid suffix. Searching by the original full-length name could never match, since the search string is no longer a substring of the stored name, so lookups returned ZeroMatchesError. Also try the trimmed 29-character prefix in the partial-match check so lookups by the untrimmed name succeed. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Fix/listvpcips pagination (#287) * Auto-paginate ListVPCIPs (follow-up to #285) ListVPCIPs hits a different endpoint (/v2/vpc/ips) than the classic ListIPs (/v2/ips) and was missed in the audit for #285. Same shape of bug — single un-paginated request, server returns only the first page, caller silently sees a truncated list. This is the path the terraform-provider-civo civo_reserved_ip data source migrated to via FindVPCIP. End-to-end verification against staging with civogo v0.7.1 still showed customers unable to resolve Reserved IPs past the first page, even after the api-go off-by-one fix landed — because the SDK never asked for page 2 of /v2/vpc/ips. Routes ListVPCIPs through the same paginateAll helper introduced in #285. FindVPCIP benefits transparently since it wraps ListVPCIPs. Adds two regression tests covering the trailing-item case via both the direct ListVPCIPs call and the FindVPCIP convenience wrapper. Originating customer report tracked in civo&599 (civogo) and civo&598 (api-go side). Closes the gap exposed during staging verification. * Cover ListDatabaseBackup and add ListAllActions Audit follow-up to civogo#285 + the ListVPCIPs commit in this branch. ListDatabaseBackup /v2/databases/{id}/backups paginates server-side unconditionally and the SDK previously sent no per_page param, so any database with > 20 backups silently truncated. Affects civo-cli `civo db backup list` and `civo db backup delete` via FindDatabaseBackup. Routed through paginateAll using the same caller-transparent pattern as ListIPs. ListAllActions ListActions takes *ActionListRequest with PerPage/Page fields that are optional. Callers passing a zero-valued request hit only the first page silently. Rather than change ListActions semantics (which would break any external Go consumer relying on explicit pagination), added a sibling ListAllActions that iterates internally — pairs with ListActions the way ListAllInstances pairs with ListInstances. Filters on the request are preserved across page fetches; Page/PerPage on the filters are overridden by the iterator. Both fixes covered by regression tests in pagination_test.go using the existing newMultiPageServer helper. No active downstream callers of ListAllActions today; ListDatabaseBackup fix unblocks civo-cli for accounts with > 20 backups per database. * Drop CHANGELOG.md additions This repo's CHANGELOG.md hasn't been updated by other PRs since 2021 — maintaining release notes for these pagination fixes here would be inconsistent with the rest of the codebase. Releases are documented via git tags + GitHub Releases instead. Removes the bullets I added in #285 (now part of v0.7.1) plus the new bullets added earlier in this branch. * Add per-file regression tests for ListAllActions and ListVPCIPs/FindVPCIP The mechanism-focused boundary tests sat in pagination_test.go, but the conventional location for API-contract regression tests is the per-file test file (matching the existing TestListActions / TestListVPCIPs / TestFindVPCIP patterns). action_test.go gains: - TestListAllActions basic API contract, single page - TestListAllActions_AcrossPages verifies iteration across 3 pages - TestListAllActions_PreservesFilters verifies filter fields on ActionListRequest are forwarded to every page request and that Page/PerPage on the filters are overridden by the iterator (callers cannot accidentally short-circuit pagination by passing a small per_page) vpc_test.go gains: - TestListVPCIPs_IteratesAllPages verifies the /v2/vpc/ips path correctly aggregates items across all pages - TestFindVPCIP_OnSecondPage covers the customer-visible terraform-provider symptom: data "civo_reserved_ip" with an id whose owning IP sits past the first server page must now resolve cleanly Removed the corresponding TestListVPCIPs_TrailingItem / TestFindVPCIP_FindsItemPastFirstPage / TestListAllActions_MultiPage from pagination_test.go (now redundant with the per-file versions). TestListDatabaseBackup_TrailingItem stays in pagination_test.go since no database_backup_test.go file exists in the package. All tests pass; no source changes.
Auto-paginate the no-arg List* helpers (#285) ListIPs, ListAccounts, ListApplications, ListDatabases, ListKubernetesClusters and ListObjectStores previously sent a single GET /v2/... with no pagination parameters and silently returned whatever fit on the server-side first page (default 20 items). For accounts with more resources than that — typical in production — page 2 onward was invisible to civogo callers including civo-cli (`civo ip ls`) and terraform-provider-civo (`civo_reserved_ip`, `civo_kubernetes_cluster`, `civo_object_store`, `civo_database`). The customer ticket that surfaced this: an account with > 20 Reserved IPs in fra1 / lon1 could not see one specific IP via the CLI or Terraform. Tracked in api-go epic civo&598 (server-side off-by-one, fixed in civo/api-go!1354) and civogo epic civo&599 (this change). The fix introduces a shared `paginateAll` helper in `pagination.go` and routes the six no-arg `List*` functions through it. The merged response always reports `Page=1, Pages=1, PerPage=len(Items)`. Iteration is sequential and capped (100 pages / 10,000 items) with an explicit ErrPaginationCapExceeded rather than spinning forever. Two existing magic-number workarounds were retired in the same change: - ListAllInstances no longer uses ListInstances(1, 99999999). - FindObjectStoreCredential no longer uses ListObjectStoreCredentials(1, 10000). Both depended on api-go's paginator early-return path and would silently re-truncate the day server-side adds a per_page cap. They now share the same iterator. Includes regression tests covering: single page, multi-page in order, trailing-item-on-last-page (the customer's case), and hard-cap exhaustion. Updated affected fixtures that asserted the old buggy semantics (Pages>1 on a single-item response, PerPage=20 on the merged result). Co-authored-by: david.woolger@civo.com <david.woolger@civo.com>
PreviousNext