Skip to content

Commit ba3329c

Browse files
avalleteclaude
andauthored
test(cli): mask default postgres image in container input goldens (supabase#7442)
The local container inputs precedence goldens recorded the default Postgres image tag, so every Postgres bump PR (e.g. supabase#7408) failed integration tests until the goldens were regenerated by hand. The test now redacts the current default database image as `<DEFAULT_POSTGRES_IMAGE>`, keeping the goldens focused on config precedence. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent c3f3ef2 commit ba3329c

7 files changed

Lines changed: 26 additions & 19 deletions

File tree

‎apps/cli/src/command-internal/db-bootstrap/local-container-inputs.precedence.integration.test.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ConfigProvider, Effect, FileSystem, Layer, Option, Path } from "effect"
44
import { ChildProcessSpawner } from "effect/process";
55
import * as HttpClient from "effect/http/HttpClient";
66
import * as HttpClientResponse from "effect/http/HttpClientResponse";
7+
import { catalogPins } from "@supabase/stack/internal/artifacts";
78

89
import { cliConfigValuesTestLayer } from "../../../tests/helpers/config-values-layer.ts";
910
import { mockRuntimeInfo } from "../../../tests/helpers/mocks.ts";
@@ -16,6 +17,9 @@ import { buildLocalDbContainerInputs } from "./local-container-inputs.ts";
1617

1718
const TARGET_REF = "abcdefghijklmnopqrst";
1819
const GOLDEN_DIR = "./testdata/config-precedence/local-container-inputs";
20+
const DEFAULT_POSTGRES_IMAGE = catalogPins().find(
21+
(entry) => entry.service === "database" && entry.isDefault,
22+
)!.pin.upstreamImage;
1923

2024
const BASE_CONFIG = `project_id = "golden-shadow"
2125
@@ -192,7 +196,10 @@ describe("local container inputs precedence goldens", () => {
192196
projectEnvValues: configEnvOnly(setup.projectEnvValues ?? {}),
193197
},
194198
};
195-
const goldenText = yield* goldenJson(golden, { [workdir]: "<WORKDIR>" });
199+
const goldenText = (yield* goldenJson(golden, { [workdir]: "<WORKDIR>" })).replaceAll(
200+
`"${DEFAULT_POSTGRES_IMAGE}"`,
201+
`"<DEFAULT_POSTGRES_IMAGE>"`,
202+
);
196203
yield* Effect.promise(() =>
197204
ctx.expect(goldenText).toMatchFileSnapshot(`${GOLDEN_DIR}/${fixture.golden}.json`),
198205
);

‎apps/cli/src/command-internal/db-bootstrap/testdata/config-precedence/local-container-inputs/matched-remote-with-project-id-env.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"dbHealthTimeoutSeconds": 120,
66
"majorVersion": 17,
77
"orioledbVersion": null,
8-
"postgresConfigImage": "supabase/postgres:17.11.0.011",
9-
"postgresImage": "supabase/postgres:17.11.0.011",
8+
"postgresConfigImage": "<DEFAULT_POSTGRES_IMAGE>",
9+
"postgresImage": "<DEFAULT_POSTGRES_IMAGE>",
1010
"realtimeEnabledForSetup": true,
1111
"realtimeIpVersion": "IPv4",
1212
"realtimeMaxHeaderLength": 4096,
@@ -32,7 +32,7 @@
3232
"experimental": false,
3333
"networkId": "supabase_network_shell-project-id",
3434
"postgresSpecBase": {
35-
"configImage": "supabase/postgres:17.11.0.011",
35+
"configImage": "<DEFAULT_POSTGRES_IMAGE>",
3636
"db": {
3737
"health_timeout": "2m",
3838
"major_version": 17,

‎apps/cli/src/command-internal/db-bootstrap/testdata/config-precedence/local-container-inputs/matched-remote-with-shell-env.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"dbHealthTimeoutSeconds": 120,
66
"majorVersion": 17,
77
"orioledbVersion": null,
8-
"postgresConfigImage": "supabase/postgres:17.11.0.011",
9-
"postgresImage": "supabase/postgres:17.11.0.011",
8+
"postgresConfigImage": "<DEFAULT_POSTGRES_IMAGE>",
9+
"postgresImage": "<DEFAULT_POSTGRES_IMAGE>",
1010
"realtimeEnabledForSetup": false,
1111
"realtimeIpVersion": "IPv4",
1212
"realtimeMaxHeaderLength": 4096,
@@ -32,7 +32,7 @@
3232
"experimental": false,
3333
"networkId": "supabase_network_abcdefghijklmnopqrst",
3434
"postgresSpecBase": {
35-
"configImage": "supabase/postgres:17.11.0.011",
35+
"configImage": "<DEFAULT_POSTGRES_IMAGE>",
3636
"db": {
3737
"health_timeout": "2m",
3838
"major_version": 17,

‎apps/cli/src/command-internal/db-bootstrap/testdata/config-precedence/local-container-inputs/matched-remote.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"dbHealthTimeoutSeconds": 120,
66
"majorVersion": 17,
77
"orioledbVersion": null,
8-
"postgresConfigImage": "supabase/postgres:17.11.0.011",
9-
"postgresImage": "supabase/postgres:17.11.0.011",
8+
"postgresConfigImage": "<DEFAULT_POSTGRES_IMAGE>",
9+
"postgresImage": "<DEFAULT_POSTGRES_IMAGE>",
1010
"realtimeEnabledForSetup": true,
1111
"realtimeIpVersion": "IPv4",
1212
"realtimeMaxHeaderLength": 4096,
@@ -32,7 +32,7 @@
3232
"experimental": false,
3333
"networkId": "supabase_network_abcdefghijklmnopqrst",
3434
"postgresSpecBase": {
35-
"configImage": "supabase/postgres:17.11.0.011",
35+
"configImage": "<DEFAULT_POSTGRES_IMAGE>",
3636
"db": {
3737
"health_timeout": "2m",
3838
"major_version": 17,

‎apps/cli/src/command-internal/db-bootstrap/testdata/config-precedence/local-container-inputs/no-overrides.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"dbHealthTimeoutSeconds": 120,
66
"majorVersion": 17,
77
"orioledbVersion": null,
8-
"postgresConfigImage": "supabase/postgres:17.11.0.011",
9-
"postgresImage": "supabase/postgres:17.11.0.011",
8+
"postgresConfigImage": "<DEFAULT_POSTGRES_IMAGE>",
9+
"postgresImage": "<DEFAULT_POSTGRES_IMAGE>",
1010
"realtimeEnabledForSetup": true,
1111
"realtimeIpVersion": "IPv4",
1212
"realtimeMaxHeaderLength": 4096,
@@ -32,7 +32,7 @@
3232
"experimental": false,
3333
"networkId": "supabase_network_golden-shadow",
3434
"postgresSpecBase": {
35-
"configImage": "supabase/postgres:17.11.0.011",
35+
"configImage": "<DEFAULT_POSTGRES_IMAGE>",
3636
"db": {
3737
"health_timeout": "2m",
3838
"major_version": 17,

‎apps/cli/src/command-internal/db-bootstrap/testdata/config-precedence/local-container-inputs/project-dotenv.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"dbHealthTimeoutSeconds": 120,
66
"majorVersion": 17,
77
"orioledbVersion": null,
8-
"postgresConfigImage": "supabase/postgres:17.11.0.011",
9-
"postgresImage": "supabase/postgres:17.11.0.011",
8+
"postgresConfigImage": "<DEFAULT_POSTGRES_IMAGE>",
9+
"postgresImage": "<DEFAULT_POSTGRES_IMAGE>",
1010
"realtimeEnabledForSetup": false,
1111
"realtimeIpVersion": "IPv4",
1212
"realtimeMaxHeaderLength": 4096,
@@ -32,7 +32,7 @@
3232
"experimental": false,
3333
"networkId": "supabase_network_golden-shadow",
3434
"postgresSpecBase": {
35-
"configImage": "supabase/postgres:17.11.0.011",
35+
"configImage": "<DEFAULT_POSTGRES_IMAGE>",
3636
"db": {
3737
"health_timeout": "2m",
3838
"major_version": 17,

‎apps/cli/src/command-internal/db-bootstrap/testdata/config-precedence/local-container-inputs/shell-env.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"dbHealthTimeoutSeconds": 120,
66
"majorVersion": 17,
77
"orioledbVersion": null,
8-
"postgresConfigImage": "supabase/postgres:17.11.0.011",
9-
"postgresImage": "supabase/postgres:17.11.0.011",
8+
"postgresConfigImage": "<DEFAULT_POSTGRES_IMAGE>",
9+
"postgresImage": "<DEFAULT_POSTGRES_IMAGE>",
1010
"realtimeEnabledForSetup": false,
1111
"realtimeIpVersion": "IPv4",
1212
"realtimeMaxHeaderLength": 4096,
@@ -32,7 +32,7 @@
3232
"experimental": false,
3333
"networkId": "supabase_network_golden-shadow",
3434
"postgresSpecBase": {
35-
"configImage": "supabase/postgres:17.11.0.011",
35+
"configImage": "<DEFAULT_POSTGRES_IMAGE>",
3636
"db": {
3737
"health_timeout": "2m",
3838
"major_version": 17,

0 commit comments

Comments
 (0)