Context
golangci-lint v2 (landed in LeanerCloud/cloud-commitments-cli#1137) type-checks //go:build integration files. This exposed that the internal/analytics integration tests (postgres_analytics_db_test.go, postgres_analytics_integration_test.go) were written against a removed QueryRequest.AccountID API and the old single-string account signatures of QueryByProvider / QueryByService / QueryMonthlyTotals. They had not compiled since the account-filter model changed to AccountUUIDs + AccountExternalIDsByProvider.
A compile-fix PR restores type-checking (so CI Lint passes) by mechanically remapping the removed account arg to:
AccountExternalIDsByProvider: map[string][]string{"aws": {"<acct>"}, "gcp": {"<acct>"}}
for every query call/struct, keyed under both providers the suite uses.
What this issue tracks (NOT done in the compile-fix PR)
These integration tests run only under Docker/testcontainers (CI Lint just type-checks them), so the compile-fix did not verify their runtime behavior. The account-filter area has historically broken silently (see the global lesson: four successive "fixes" merged green while the bug survived because tests filtered the wrong column). So before trusting these tests:
Acceptance
Integration tests pass under Docker AND a deliberately-wrong account filter makes them fail (proving they actually exercise the filter).
Context
golangci-lint v2 (landed in LeanerCloud/cloud-commitments-cli#1137) type-checks
//go:build integrationfiles. This exposed that theinternal/analyticsintegration tests (postgres_analytics_db_test.go,postgres_analytics_integration_test.go) were written against a removedQueryRequest.AccountIDAPI and the old single-string account signatures ofQueryByProvider/QueryByService/QueryMonthlyTotals. They had not compiled since the account-filter model changed toAccountUUIDs+AccountExternalIDsByProvider.A compile-fix PR restores type-checking (so CI Lint passes) by mechanically remapping the removed account arg to:
for every query call/struct, keyed under both providers the suite uses.
What this issue tracks (NOT done in the compile-fix PR)
These integration tests run only under Docker/testcontainers (CI Lint just type-checks them), so the compile-fix did not verify their runtime behavior. The account-filter area has historically broken silently (see the global lesson: four successive "fixes" merged green while the bug survived because tests filtered the wrong column). So before trusting these tests:
go test -tags=integration ./internal/analytics/) and confirm eacht.Runstill asserts the intended rows.AccountExternalIDsByProviderremap matches each test's saved snapshot providers (the blanket{"aws","gcp"}mapping may over- or under-match a block that previously filtered account-wide or by a single provider).AccountUUIDsvsAccountExternalIDsByProviderchoice is correct per case (snapshots are saved with an external account id, not a UUID).Acceptance
Integration tests pass under Docker AND a deliberately-wrong account filter makes them fail (proving they actually exercise the filter).