diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a90006f0f..ca11ea73e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,6 +87,14 @@ pnpm dev:coder-acp-copilot # A single worker natively (pnpm dev:@gateway:18000` (session ID embedded as userinfo) and `DEV_PROXY_API_URL=http://gateway:18000`. ## Kubernetes Deployment diff --git a/scripts/docker-compose.test.ts b/scripts/docker-compose.test.ts new file mode 100644 index 000000000..096b29c5f --- /dev/null +++ b/scripts/docker-compose.test.ts @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { spawnSync } from "node:child_process"; +import { describe, expect, it } from "vitest"; + +interface ComposeService { + cpus?: number; + depends_on?: Record; + healthcheck?: { + test?: string[]; + start_period?: string; + }; + mem_limit?: string; + volumes?: Array<{ + source?: string; + target: string; + }>; +} + +interface ComposeConfig { + services: Record; +} + +// Keep the default unit suite runnable without Docker while preserving strict +// merged-configuration validation whenever Compose is available. +const dockerComposeAvailable = + spawnSync("docker", ["compose", "version"], { + encoding: "utf8", + }).status === 0; + +describe("development Docker Compose configuration", () => { + it.skipIf(!dockerComposeAvailable)( + "keeps the gateway cold-build resources and Copilot worker dependency", + () => { + const result = spawnSync( + "docker", + [ + "compose", + "-f", + "docker-compose.yml", + "-f", + "docker-compose.dev.yml", + "--profile", + "copilot", + "config", + "--format", + "json", + ], + { + encoding: "utf8", + env: { ...process.env, GITHUB_TOKEN: process.env.GITHUB_TOKEN ?? "" }, + }, + ); + + expect(result.status, result.stderr).toBe(0); + + const config = JSON.parse(result.stdout) as ComposeConfig; + const gateway = config.services.gateway; + const copilotWorker = config.services["coder-acp-copilot"]; + + expect(gateway.cpus).toBeUndefined(); + expect(gateway.mem_limit).toBe(String(2 * 1024 ** 3)); + expect(gateway.healthcheck?.start_period).toBe("10m0s"); + expect(gateway.healthcheck?.test).toEqual([ + "CMD-SHELL", + "wget -qO- http://127.0.0.1:18000/health || exit 1", + ]); + expect(gateway.volumes).toContainEqual( + expect.objectContaining({ + source: "gateway_target", + target: "/build/target", + }), + ); + expect(copilotWorker.depends_on?.gateway?.condition).toBe( + "service_healthy", + ); + }, + ); +}); diff --git a/website/src/styles/contributions.css b/website/src/styles/contributions.css index 6aa468603..98f3bd382 100644 --- a/website/src/styles/contributions.css +++ b/website/src/styles/contributions.css @@ -1,7 +1,9 @@ /* * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. - * + */ + +/* * Shared presentation for website contribution data: status messages, * count pills, cards, and development-only sample labels. */ diff --git a/website/src/styles/contributors.css b/website/src/styles/contributors.css index 5e75ab0ed..03ef9015a 100644 --- a/website/src/styles/contributors.css +++ b/website/src/styles/contributors.css @@ -1,7 +1,9 @@ /* * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. - * + */ + +/* * Contributors (). An avatar wall on the * landing page and a card grid on the Community > Contribute page. Shares * the card, message and sample-tag styles in contributions.css.