Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
+120
-107
@@ -18,7 +18,7 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
quality:
|
||||
verify-1:
|
||||
runs-on: toolctrl-ci
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -49,6 +49,21 @@ jobs:
|
||||
run: pnpm run verify:health-baseline
|
||||
- name: Verify API inventory
|
||||
run: pnpm run verify:api-inventory
|
||||
- name: Verify UI mock static baseline
|
||||
run: pnpm run verify:ui-visual
|
||||
- name: Test UI hot-swap
|
||||
run: pnpm run test:hot-swap
|
||||
verify-2:
|
||||
runs-on: toolctrl-ci
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Enable Corepack
|
||||
run: corepack enable
|
||||
- name: Pin pnpm
|
||||
run: corepack prepare pnpm@10.33.0 --activate
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Verify tenant isolation report
|
||||
run: pnpm run verify:tenant-isolation-report
|
||||
- name: Verify sidebar routes
|
||||
@@ -61,14 +76,8 @@ jobs:
|
||||
run: pnpm run verify:onboarding-flow
|
||||
- name: Verify Phase C boundaries
|
||||
run: pnpm run verify:phase-c-boundaries
|
||||
- name: Verify Feature Manifest core without plugins
|
||||
run: pnpm run verify:core-build-without-plugins-smoke
|
||||
- name: Verify Feature Manifest removed modules
|
||||
run: pnpm run verify:removed-modules
|
||||
- name: Verify UI mock static baseline
|
||||
run: pnpm run verify:ui-visual
|
||||
- name: Test UI hot-swap
|
||||
run: pnpm run test:hot-swap
|
||||
- name: Verify accessibility coverage
|
||||
run: pnpm run verify:a11y-coverage
|
||||
- name: Test accessibility smoke
|
||||
@@ -81,6 +90,17 @@ jobs:
|
||||
run: pnpm run verify:release-docs
|
||||
- name: Verify docs links
|
||||
run: pnpm run verify:docs-links
|
||||
typecheck-test:
|
||||
runs-on: toolctrl-ci
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Enable Corepack
|
||||
run: corepack enable
|
||||
- name: Pin pnpm
|
||||
run: corepack prepare pnpm@10.33.0 --activate
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Typecheck
|
||||
run: pnpm typecheck
|
||||
- name: Lint
|
||||
@@ -89,10 +109,21 @@ jobs:
|
||||
run: pnpm run test:foundation
|
||||
- name: Package tests
|
||||
run: pnpm run test:packages
|
||||
- name: Mobile wrapper tests
|
||||
run: pnpm run test:mobile
|
||||
- name: Unit tests
|
||||
run: pnpm test
|
||||
build:
|
||||
runs-on: toolctrl-ci
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Enable Corepack
|
||||
run: corepack enable
|
||||
- name: Pin pnpm
|
||||
run: corepack prepare pnpm@10.33.0 --activate
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Verify Feature Manifest core without plugins
|
||||
run: pnpm run verify:core-build-without-plugins-smoke
|
||||
- name: Build
|
||||
run: pnpm run build:ci
|
||||
- name: Verify bundle size
|
||||
@@ -122,11 +153,11 @@ jobs:
|
||||
- name: Verify OpenAPI security
|
||||
run: pnpm run verify:openapi-security
|
||||
- name: Typecheck API
|
||||
run: pnpm --filter @toolctrl/api typecheck
|
||||
run: pnpm --filter @hivegrid/api typecheck
|
||||
- name: Test API
|
||||
run: pnpm exec vitest run apps/api/src
|
||||
- name: Build API
|
||||
run: pnpm --filter @toolctrl/api build
|
||||
run: pnpm --filter @hivegrid/api build
|
||||
worker:
|
||||
runs-on: toolctrl-ci
|
||||
steps:
|
||||
@@ -139,15 +170,15 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Typecheck Worker
|
||||
run: pnpm --filter @toolctrl/worker typecheck
|
||||
run: pnpm --filter @hivegrid/worker typecheck
|
||||
- name: Test Worker
|
||||
run: pnpm --filter @toolctrl/worker exec vitest run
|
||||
run: pnpm --filter @hivegrid/worker exec vitest run
|
||||
- name: Verify workflow outbox native readiness
|
||||
run: pnpm run verify:workflow-outbox-native
|
||||
- name: Build Worker
|
||||
run: pnpm --filter @toolctrl/worker build
|
||||
run: pnpm --filter @hivegrid/worker build
|
||||
- name: Health Check Worker
|
||||
run: pnpm --filter @toolctrl/worker health
|
||||
run: pnpm --filter @hivegrid/worker health
|
||||
database:
|
||||
runs-on: toolctrl-ci
|
||||
steps:
|
||||
@@ -161,6 +192,8 @@ jobs:
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Generate database client
|
||||
run: pnpm run db:generate
|
||||
- name: Verify migrations schema parity
|
||||
run: pnpm run verify:migrations-parity
|
||||
- name: Verify database migration status
|
||||
run: pnpm run verify:db-migrate-status:staging
|
||||
env:
|
||||
@@ -170,7 +203,7 @@ jobs:
|
||||
COOLIFY_STAGING_SSH_KEY: \${{ secrets.COOLIFY_STAGING_SSH_KEY }}
|
||||
docker-smoke:
|
||||
runs-on: toolctrl-ci
|
||||
needs: [quality, api, worker, database]
|
||||
needs: [verify-1, verify-2, typecheck-test, build, api, worker, database]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -180,11 +213,11 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
docker build --target web --build-arg APP_REVISION=ci-smoke-revision --tag toolctrl-web:smoke . &
|
||||
docker build --target web --build-arg APP_REVISION=ci-smoke-revision --tag hivegrid-web:smoke . &
|
||||
web_pid=$!
|
||||
docker build --target api --build-arg APP_REVISION=ci-smoke-revision --tag toolctrl-api:smoke . &
|
||||
docker build --target api --build-arg APP_REVISION=ci-smoke-revision --tag hivegrid-api:smoke . &
|
||||
api_pid=$!
|
||||
docker build --target worker --build-arg APP_REVISION=ci-smoke-revision --tag toolctrl-worker:smoke . &
|
||||
docker build --target worker --build-arg APP_REVISION=ci-smoke-revision --tag hivegrid-worker:smoke . &
|
||||
worker_pid=$!
|
||||
status=0
|
||||
wait "$web_pid" || status=$?
|
||||
@@ -192,25 +225,17 @@ jobs:
|
||||
wait "$worker_pid" || status=$?
|
||||
exit "$status"
|
||||
- name: Validate web Docker artifacts
|
||||
run: docker run --rm --entrypoint /bin/sh toolctrl-web:smoke -lc 'test -f /myapp/apps/web/build/server/index.js && test -d /myapp/apps/web/build/client && test -f /myapp/build/server-runtime/server.js'
|
||||
run: docker run --rm --entrypoint /bin/sh hivegrid-web:smoke -lc 'test -f /myapp/apps/web/build/server/index.js && test -d /myapp/apps/web/build/client && test -f /myapp/build/server-runtime/server.js'
|
||||
- name: Validate web Docker runtime
|
||||
run: bash scripts/docker-web-runtime-smoke.sh toolctrl-web:smoke
|
||||
run: bash scripts/docker-web-runtime-smoke.sh hivegrid-web:smoke
|
||||
- name: Validate API Docker runtime
|
||||
run: bash scripts/docker-api-runtime-smoke.sh toolctrl-api:smoke
|
||||
run: bash scripts/docker-api-runtime-smoke.sh hivegrid-api:smoke
|
||||
env:
|
||||
DOCKER_API_SMOKE_TRANSPORT: exec
|
||||
- name: Validate worker Docker runtime
|
||||
run: bash scripts/docker-worker-runtime-smoke.sh toolctrl-worker:smoke
|
||||
run: bash scripts/docker-worker-runtime-smoke.sh hivegrid-worker:smoke
|
||||
- name: Validate Docker Compose config
|
||||
run: docker compose config
|
||||
sentry-release-web:
|
||||
needs: resolve-sentry-environment
|
||||
uses: ./.gitea/workflows/_sentry-release.yml
|
||||
with:
|
||||
project: boilerplate-web
|
||||
environment: preview
|
||||
sourcemaps-path: apps/web/build/client
|
||||
sourcemaps-artifact: web-client-sourcemaps
|
||||
`;
|
||||
|
||||
const SENTRY_REUSABLE_WORKFLOW = `name: Sentry Release
|
||||
@@ -275,7 +300,10 @@ describe("verify-gitea-ci-workflow", () => {
|
||||
assert.deepEqual(result.failures, []);
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: trigger \"push\" is disabled so deploy is not queued behind CI on main"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: trigger \"workflow_dispatch\" is defined"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: pnpm@10.33.0 is pinned"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: quality job \"verify-1\" pnpm@10.33.0 is pinned"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: quality job \"verify-2\" pnpm@10.33.0 is pinned"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: quality job \"typecheck-test\" pnpm@10.33.0 is pinned"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: quality job \"build\" pnpm@10.33.0 is pinned"));
|
||||
assert.ok(result.passes.some((pass) => /^\.gitea\/workflows\/ci\.yml:\d+: runner is "toolctrl-ci"$/.test(pass)));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: command \"pnpm run verify:ci-baseline\" is ordered"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: command \"pnpm run verify:source-health\" is ordered"));
|
||||
@@ -285,14 +313,13 @@ describe("verify-gitea-ci-workflow", () => {
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: command \"pnpm run verify:health-baseline\" is ordered"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: command \"pnpm run verify:tenant-auth-baseline\" is ordered"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: command \"pnpm run verify:tenant-isolation-report\" is ordered"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: command \"pnpm run test:mobile\" is ordered"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: service job \"api\" is defined"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: service job \"api\" includes scoped command \"pnpm run verify:openapi-security\""));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: service job \"api\" includes scoped command \"pnpm --filter @toolctrl/api typecheck\""));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: service job \"api\" includes scoped command \"pnpm --filter @hivegrid/api typecheck\""));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: service job \"worker\" is defined"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: service job \"worker\" includes scoped command \"pnpm run verify:workflow-outbox-native\""));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: service job \"worker\" includes scoped command \"pnpm --filter @toolctrl/worker build\""));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: service job \"worker\" includes scoped command \"pnpm --filter @toolctrl/worker health\""));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: service job \"worker\" includes scoped command \"pnpm --filter @hivegrid/worker build\""));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: service job \"worker\" includes scoped command \"pnpm --filter @hivegrid/worker health\""));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: database job \"database\" is defined"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: service job \"api\" runs independently of \"quality\""));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: service job \"worker\" runs independently of \"quality\""));
|
||||
@@ -303,8 +330,6 @@ describe("verify-gitea-ci-workflow", () => {
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: database job \"database\" verifies private Coolify databases without exposing DATABASE_URL"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: database job \"database\" contains no deploy/seed/schema mutation commands"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: Docker smoke job \"docker-smoke\" is defined"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: Docker smoke job \"docker-smoke\" needs \"quality\""));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: Docker smoke job \"docker-smoke\" needs \"database\""));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: Docker smoke job \"docker-smoke\" does not run Corepack setup"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: Docker smoke job \"docker-smoke\" builds Docker target \"web\""));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: Docker smoke job \"docker-smoke\" builds Docker targets in parallel"));
|
||||
@@ -315,7 +340,6 @@ describe("verify-gitea-ci-workflow", () => {
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: Docker smoke job \"docker-smoke\" validates Docker Compose config"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: web source maps are uploaded as artifact \"web-client-sourcemaps\""));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/_sentry-release.yml: reusable workflow downloads requested source-map artifacts before upload"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: Sentry web release consumes artifact \"web-client-sourcemaps\""));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: Docker smoke job \"docker-smoke\" contains no registry login/push/publish commands"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: no forbidden E2E/browser commands are present"));
|
||||
assert.ok(result.passes.some((pass) => pass === ".gitea/workflows/ci.yml: CI concurrency cancels superseded pull request and branch runs"));
|
||||
@@ -368,7 +392,8 @@ describe("verify-gitea-ci-workflow", () => {
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: missing required command "pnpm lint"/);
|
||||
});
|
||||
|
||||
it("fails when pnpm setup is present only outside the quality job", () => {
|
||||
it("fails when pnpm setup is missing from one split quality job", () => {
|
||||
// String.replace removes only the first occurrence, i.e. the "verify-1" job's setup.
|
||||
const rootDir = createFixture(
|
||||
VALID_WORKFLOW.replace(" - name: Enable Corepack\n run: corepack enable\n", "")
|
||||
.replace(" - name: Pin pnpm\n run: corepack prepare pnpm@10.33.0 --activate\n", "")
|
||||
@@ -378,9 +403,9 @@ describe("verify-gitea-ci-workflow", () => {
|
||||
const result = verifyGiteaCiWorkflow(rootDir);
|
||||
const failures = result.failures.join("\n");
|
||||
|
||||
assert.match(failures, /\.gitea\/workflows\/ci\.yml: missing Corepack setup/);
|
||||
assert.match(failures, /\.gitea\/workflows\/ci\.yml: pnpm must be pinned to pnpm@10\.33\.0/);
|
||||
assert.match(failures, /\.gitea\/workflows\/ci\.yml: missing required command "pnpm install --frozen-lockfile"/);
|
||||
assert.match(failures, /\.gitea\/workflows\/ci\.yml: quality job "verify-1" missing Corepack setup/);
|
||||
assert.match(failures, /\.gitea\/workflows\/ci\.yml: quality job "verify-1" pnpm must be pinned to pnpm@10\.33\.0/);
|
||||
assert.match(failures, /\.gitea\/workflows\/ci\.yml: quality job "verify-1" missing required command "pnpm install --frozen-lockfile"/);
|
||||
});
|
||||
|
||||
it("fails when a required quality gate only appears in a shell comment", () => {
|
||||
@@ -423,19 +448,22 @@ describe("verify-gitea-ci-workflow", () => {
|
||||
it("fails when a service command ends with an unconditional true", () => {
|
||||
const rootDir = createFixture(
|
||||
VALID_WORKFLOW.replace(
|
||||
" - name: Typecheck API\n run: pnpm --filter @toolctrl/api typecheck\n",
|
||||
" - name: Typecheck API\n run: |\n pnpm --filter @toolctrl/api typecheck\n true\n",
|
||||
" - name: Typecheck API\n run: pnpm --filter @hivegrid/api typecheck\n",
|
||||
" - name: Typecheck API\n run: |\n pnpm --filter @hivegrid/api typecheck\n true\n",
|
||||
),
|
||||
);
|
||||
|
||||
const result = verifyGiteaCiWorkflow(rootDir);
|
||||
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: service job "api" command "pnpm --filter @toolctrl\/api typecheck" must not use shell success masking/);
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: service job "api" command "pnpm --filter @hivegrid\/api typecheck" must not use shell success masking/);
|
||||
});
|
||||
|
||||
it("accepts block-list needs syntax for dependent jobs", () => {
|
||||
const rootDir = createFixture(
|
||||
VALID_WORKFLOW.replace(" needs: [quality, api, worker, database]\n", " needs:\n - quality\n - api\n - worker\n - database\n"),
|
||||
VALID_WORKFLOW.replace(
|
||||
" needs: [verify-1, verify-2, typecheck-test, build, api, worker, database]\n",
|
||||
" needs:\n - verify-1\n - verify-2\n - typecheck-test\n - build\n - api\n - worker\n - database\n",
|
||||
),
|
||||
);
|
||||
|
||||
const result = verifyGiteaCiWorkflow(rootDir);
|
||||
@@ -462,14 +490,14 @@ describe("verify-gitea-ci-workflow", () => {
|
||||
it("fails when worker tests are narrowed to explicit files", () => {
|
||||
const rootDir = createFixture(
|
||||
VALID_WORKFLOW.replace(
|
||||
" run: pnpm --filter @toolctrl/worker exec vitest run\n",
|
||||
" run: pnpm --filter @toolctrl/worker exec vitest run src/handlers.test.ts src/health.test.ts",
|
||||
" run: pnpm --filter @hivegrid/worker exec vitest run\n",
|
||||
" run: pnpm --filter @hivegrid/worker exec vitest run src/handlers.test.ts src/health.test.ts",
|
||||
),
|
||||
);
|
||||
|
||||
const result = verifyGiteaCiWorkflow(rootDir);
|
||||
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: service job "worker" missing scoped command "pnpm --filter @toolctrl\/worker exec vitest run"/);
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: service job "worker" missing scoped command "pnpm --filter @hivegrid\/worker exec vitest run"/);
|
||||
});
|
||||
|
||||
it("fails when the worker service job omits the workflow outbox native readiness gate", () => {
|
||||
@@ -488,14 +516,14 @@ describe("verify-gitea-ci-workflow", () => {
|
||||
it("fails when the worker service job omits its health check", () => {
|
||||
const rootDir = createFixture(
|
||||
VALID_WORKFLOW.replace(
|
||||
" - name: Health Check Worker\n run: pnpm --filter @toolctrl/worker health\n",
|
||||
" - name: Health Check Worker\n run: pnpm --filter @hivegrid/worker health\n",
|
||||
"",
|
||||
),
|
||||
);
|
||||
|
||||
const result = verifyGiteaCiWorkflow(rootDir);
|
||||
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: service job "worker" missing scoped command "pnpm --filter @toolctrl\/worker health"/);
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: service job "worker" missing scoped command "pnpm --filter @hivegrid\/worker health"/);
|
||||
});
|
||||
|
||||
it("fails when the env drift gate is missing", () => {
|
||||
@@ -554,14 +582,14 @@ describe("verify-gitea-ci-workflow", () => {
|
||||
it("fails when a service job command only appears in a shell comment", () => {
|
||||
const rootDir = createFixture(
|
||||
VALID_WORKFLOW.replace(
|
||||
" - name: Typecheck API\n run: pnpm --filter @toolctrl/api typecheck\n",
|
||||
" - name: Typecheck API\n run: |\n # pnpm --filter @toolctrl/api typecheck\n echo skipped\n",
|
||||
" - name: Typecheck API\n run: pnpm --filter @hivegrid/api typecheck\n",
|
||||
" - name: Typecheck API\n run: |\n # pnpm --filter @hivegrid/api typecheck\n echo skipped\n",
|
||||
),
|
||||
);
|
||||
|
||||
const result = verifyGiteaCiWorkflow(rootDir);
|
||||
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: service job "api" missing scoped command "pnpm --filter @toolctrl\/api typecheck"/);
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: service job "api" missing scoped command "pnpm --filter @hivegrid\/api typecheck"/);
|
||||
});
|
||||
|
||||
it("fails when the tenant isolation report gate is missing", () => {
|
||||
@@ -572,17 +600,19 @@ describe("verify-gitea-ci-workflow", () => {
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: missing required command "pnpm run verify:tenant-isolation-report"/);
|
||||
});
|
||||
|
||||
it("fails when the API inventory gate runs after typecheck", () => {
|
||||
it("fails when a verify-2 gate runs out of its canonical order", () => {
|
||||
// tenant-isolation-report is canonically the first verify-2 gate; moving it after the
|
||||
// sidebar/i18n gates pushes those earlier gates out of order within the owning job.
|
||||
const rootDir = createFixture(
|
||||
VALID_WORKFLOW.replace(
|
||||
" - name: Verify API inventory\n run: pnpm run verify:api-inventory\n - name: Verify tenant isolation report\n run: pnpm run verify:tenant-isolation-report\n - name: Verify sidebar routes\n run: pnpm run verify:sidebar-routes\n - name: Verify i18n\n run: pnpm run verify:i18n\n",
|
||||
" - name: Verify tenant isolation report\n run: pnpm run verify:tenant-isolation-report\n - name: Verify sidebar routes\n run: pnpm run verify:sidebar-routes\n - name: Verify i18n\n run: pnpm run verify:i18n\n - name: Verify API inventory\n run: pnpm run verify:api-inventory\n",
|
||||
" - name: Verify tenant isolation report\n run: pnpm run verify:tenant-isolation-report\n - name: Verify sidebar routes\n run: pnpm run verify:sidebar-routes\n - name: Verify i18n\n run: pnpm run verify:i18n\n",
|
||||
" - name: Verify sidebar routes\n run: pnpm run verify:sidebar-routes\n - name: Verify i18n\n run: pnpm run verify:i18n\n - name: Verify tenant isolation report\n run: pnpm run verify:tenant-isolation-report\n",
|
||||
),
|
||||
);
|
||||
|
||||
const result = verifyGiteaCiWorkflow(rootDir);
|
||||
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: command "pnpm run verify:i18n" must run after previous quality gates/);
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: command "pnpm run verify:sidebar-routes" must run after previous quality gates/);
|
||||
});
|
||||
|
||||
it("fails when a job uses ubuntu-latest instead of the required Gitea runner", () => {
|
||||
@@ -631,8 +661,8 @@ describe("verify-gitea-ci-workflow", () => {
|
||||
" - name: Test API\n run: pnpm exec vitest run apps/api/src\n",
|
||||
"",
|
||||
).replace(
|
||||
" - name: Build Worker\n run: pnpm --filter @toolctrl/worker build\n",
|
||||
" - name: Build Worker\n run: pnpm --filter @toolctrl/worker build\n - name: Misplaced API tests\n run: pnpm exec vitest run apps/api/src\n",
|
||||
" - name: Build Worker\n run: pnpm --filter @hivegrid/worker build\n",
|
||||
" - name: Build Worker\n run: pnpm --filter @hivegrid/worker build\n - name: Misplaced API tests\n run: pnpm exec vitest run apps/api/src\n",
|
||||
),
|
||||
);
|
||||
|
||||
@@ -712,24 +742,24 @@ describe("verify-gitea-ci-workflow", () => {
|
||||
});
|
||||
|
||||
it("fails when the database job contains a migration deploy command", () => {
|
||||
const rootDir = createFixture(VALID_WORKFLOW.replace(" - name: Verify database migration status\n run: pnpm run verify:db-migrate-status:staging\n", " - name: Verify database migration status\n run: pnpm run verify:db-migrate-status:staging\n - name: Deploy migrations\n run: pnpm --filter @toolctrl/db prisma migrate deploy\n"));
|
||||
const rootDir = createFixture(VALID_WORKFLOW.replace(" - name: Verify database migration status\n run: pnpm run verify:db-migrate-status:staging\n", " - name: Verify database migration status\n run: pnpm run verify:db-migrate-status:staging\n - name: Deploy migrations\n run: pnpm --filter @hivegrid/db prisma migrate deploy\n"));
|
||||
|
||||
const result = verifyGiteaCiWorkflow(rootDir);
|
||||
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: database job "database" contains forbidden deploy\/seed\/schema mutation command: run: pnpm --filter @toolctrl\/db prisma migrate deploy/);
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: database job "database" contains forbidden deploy\/seed\/schema mutation command: run: pnpm --filter @hivegrid\/db prisma migrate deploy/);
|
||||
});
|
||||
|
||||
it("fails when the database job hides a migration deploy command in a multiline run block", () => {
|
||||
const rootDir = createFixture(
|
||||
VALID_WORKFLOW.replace(
|
||||
" - name: Verify database migration status\n run: pnpm run verify:db-migrate-status:staging\n",
|
||||
" - name: Verify database migration status\n run: pnpm run verify:db-migrate-status:staging\n - name: Deploy migrations\n run: |\n pnpm run db:generate\n pnpm --filter @toolctrl/db prisma migrate deploy\n",
|
||||
" - name: Verify database migration status\n run: pnpm run verify:db-migrate-status:staging\n - name: Deploy migrations\n run: |\n pnpm run db:generate\n pnpm --filter @hivegrid/db prisma migrate deploy\n",
|
||||
),
|
||||
);
|
||||
|
||||
const result = verifyGiteaCiWorkflow(rootDir);
|
||||
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: database job "database" contains forbidden deploy\/seed\/schema mutation command: run: pnpm run db:generate\npnpm --filter @toolctrl\/db prisma migrate deploy/);
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: database job "database" contains forbidden deploy\/seed\/schema mutation command: run: pnpm run db:generate\npnpm --filter @hivegrid\/db prisma migrate deploy/);
|
||||
});
|
||||
|
||||
it("fails when the database job contains an E2E browser command", () => {
|
||||
@@ -761,27 +791,10 @@ describe("verify-gitea-ci-workflow", () => {
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: missing required Docker smoke job "docker-smoke"/);
|
||||
});
|
||||
|
||||
it("fails when the Docker smoke job is missing a required dependency", () => {
|
||||
const rootDir = createFixture(VALID_WORKFLOW.replace(" needs: [quality, api, worker, database]\n", " needs: [quality, api]\n"));
|
||||
|
||||
const result = verifyGiteaCiWorkflow(rootDir);
|
||||
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: Docker smoke job "docker-smoke" must declare needs including "worker"/);
|
||||
assert.doesNotMatch(result.failures.join("\n"), /must declare needs including "quality"/);
|
||||
});
|
||||
|
||||
it("fails when the Docker smoke job does not depend on the database job", () => {
|
||||
const rootDir = createFixture(VALID_WORKFLOW.replace(" needs: [quality, api, worker, database]\n", " needs: [quality, api, worker]\n"));
|
||||
|
||||
const result = verifyGiteaCiWorkflow(rootDir);
|
||||
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: Docker smoke job "docker-smoke" must declare needs including "database"/);
|
||||
});
|
||||
|
||||
it("fails when a Docker target build is missing from the Docker smoke job", () => {
|
||||
const rootDir = createFixture(
|
||||
VALID_WORKFLOW.replace(" - name: Build API\n run: pnpm --filter @toolctrl/api build\n", " - name: Build API\n run: pnpm --filter @toolctrl/api build\n - name: Misplaced Docker API build\n run: docker buildx build --target api --file Dockerfile .\n").replace(
|
||||
" docker build --target api --build-arg APP_REVISION=ci-smoke-revision --tag toolctrl-api:smoke . &\n api_pid=$!\n",
|
||||
VALID_WORKFLOW.replace(" - name: Build API\n run: pnpm --filter @hivegrid/api build\n", " - name: Build API\n run: pnpm --filter @hivegrid/api build\n - name: Misplaced Docker API build\n run: docker buildx build --target api --file Dockerfile .\n").replace(
|
||||
" docker build --target api --build-arg APP_REVISION=ci-smoke-revision --tag hivegrid-api:smoke . &\n api_pid=$!\n",
|
||||
"",
|
||||
),
|
||||
);
|
||||
@@ -793,7 +806,7 @@ describe("verify-gitea-ci-workflow", () => {
|
||||
});
|
||||
|
||||
it("fails when a Docker smoke build omits the revision build arg", () => {
|
||||
const rootDir = createFixture(VALID_WORKFLOW.replace("docker build --target web --build-arg APP_REVISION=ci-smoke-revision --tag toolctrl-web:smoke .", "docker build --target web --tag toolctrl-web:smoke ."));
|
||||
const rootDir = createFixture(VALID_WORKFLOW.replace("docker build --target web --build-arg APP_REVISION=ci-smoke-revision --tag hivegrid-web:smoke .", "docker build --target web --tag hivegrid-web:smoke ."));
|
||||
|
||||
const result = verifyGiteaCiWorkflow(rootDir);
|
||||
|
||||
@@ -804,74 +817,74 @@ describe("verify-gitea-ci-workflow", () => {
|
||||
const rootDir = createFixture(
|
||||
VALID_WORKFLOW.replace(
|
||||
" - name: Validate Docker Compose config\n run: docker compose config\n",
|
||||
" - name: Validate Docker Compose config\n run: docker compose config\n - name: Publish image\n run: docker push registry.example.com/toolctrl/api:latest\n",
|
||||
" - name: Validate Docker Compose config\n run: docker compose config\n - name: Publish image\n run: docker push registry.example.com/hivegrid/api:latest\n",
|
||||
),
|
||||
);
|
||||
|
||||
const result = verifyGiteaCiWorkflow(rootDir);
|
||||
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: Docker smoke job "docker-smoke" contains forbidden publish command: run: docker push registry\.example\.com\/toolctrl\/api:latest/);
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: Docker smoke job "docker-smoke" contains forbidden publish command: run: docker push registry\.example\.com\/hivegrid\/api:latest/);
|
||||
});
|
||||
|
||||
it("fails when the Docker smoke job omits web artifact validation", () => {
|
||||
const rootDir = createFixture(
|
||||
VALID_WORKFLOW.replace(
|
||||
" - name: Validate web Docker artifacts\n run: docker run --rm --entrypoint /bin/sh toolctrl-web:smoke -lc 'test -f /myapp/apps/web/build/server/index.js && test -d /myapp/apps/web/build/client && test -f /myapp/build/server-runtime/server.js'\n",
|
||||
" - name: Validate web Docker artifacts\n run: docker run --rm --entrypoint /bin/sh hivegrid-web:smoke -lc 'test -f /myapp/apps/web/build/server/index.js && test -d /myapp/apps/web/build/client && test -f /myapp/build/server-runtime/server.js'\n",
|
||||
"",
|
||||
),
|
||||
);
|
||||
|
||||
const result = verifyGiteaCiWorkflow(rootDir);
|
||||
|
||||
assert.match(result.failures.join("\n"), /Docker smoke job "docker-smoke" missing command "docker run --rm --entrypoint \/bin\/sh toolctrl-web:smoke/);
|
||||
assert.match(result.failures.join("\n"), /Docker smoke job "docker-smoke" missing command "docker run --rm --entrypoint \/bin\/sh hivegrid-web:smoke/);
|
||||
});
|
||||
|
||||
it("fails when the Docker smoke job omits web runtime validation", () => {
|
||||
const rootDir = createFixture(
|
||||
VALID_WORKFLOW.replace(
|
||||
" - name: Validate web Docker runtime\n run: bash scripts/docker-web-runtime-smoke.sh toolctrl-web:smoke\n",
|
||||
" - name: Validate web Docker runtime\n run: bash scripts/docker-web-runtime-smoke.sh hivegrid-web:smoke\n",
|
||||
"",
|
||||
),
|
||||
);
|
||||
|
||||
const result = verifyGiteaCiWorkflow(rootDir);
|
||||
|
||||
assert.match(result.failures.join("\n"), /Docker smoke job "docker-smoke" missing command "bash scripts\/docker-web-runtime-smoke\.sh toolctrl-web:smoke"/);
|
||||
assert.match(result.failures.join("\n"), /Docker smoke job "docker-smoke" missing command "bash scripts\/docker-web-runtime-smoke\.sh hivegrid-web:smoke"/);
|
||||
});
|
||||
|
||||
it("fails when the Docker smoke job omits API runtime validation", () => {
|
||||
const rootDir = createFixture(
|
||||
VALID_WORKFLOW.replace(
|
||||
" - name: Validate API Docker runtime\n run: bash scripts/docker-api-runtime-smoke.sh toolctrl-api:smoke\n env:\n DOCKER_API_SMOKE_TRANSPORT: exec\n",
|
||||
" - name: Validate API Docker runtime\n run: bash scripts/docker-api-runtime-smoke.sh hivegrid-api:smoke\n env:\n DOCKER_API_SMOKE_TRANSPORT: exec\n",
|
||||
"",
|
||||
),
|
||||
);
|
||||
|
||||
const result = verifyGiteaCiWorkflow(rootDir);
|
||||
|
||||
assert.match(result.failures.join("\n"), /Docker smoke job "docker-smoke" missing command "bash scripts\/docker-api-runtime-smoke\.sh toolctrl-api:smoke"/);
|
||||
assert.match(result.failures.join("\n"), /Docker smoke job "docker-smoke" missing command "bash scripts\/docker-api-runtime-smoke\.sh hivegrid-api:smoke"/);
|
||||
});
|
||||
|
||||
it("fails when the Docker smoke job omits worker runtime validation", () => {
|
||||
const rootDir = createFixture(
|
||||
VALID_WORKFLOW.replace(
|
||||
" - name: Validate worker Docker runtime\n run: bash scripts/docker-worker-runtime-smoke.sh toolctrl-worker:smoke\n",
|
||||
" - name: Validate worker Docker runtime\n run: bash scripts/docker-worker-runtime-smoke.sh hivegrid-worker:smoke\n",
|
||||
"",
|
||||
),
|
||||
);
|
||||
|
||||
const result = verifyGiteaCiWorkflow(rootDir);
|
||||
|
||||
assert.match(result.failures.join("\n"), /Docker smoke job "docker-smoke" missing command "bash scripts\/docker-worker-runtime-smoke\.sh toolctrl-worker:smoke"/);
|
||||
assert.match(result.failures.join("\n"), /Docker smoke job "docker-smoke" missing command "bash scripts\/docker-worker-runtime-smoke\.sh hivegrid-worker:smoke"/);
|
||||
});
|
||||
|
||||
it("fails when Docker smoke target builds are not parallelized", () => {
|
||||
const sequentialBuilds = ` - name: Build web Docker target
|
||||
run: docker build --target web --build-arg APP_REVISION=ci-smoke-revision --tag toolctrl-web:smoke .
|
||||
run: docker build --target web --build-arg APP_REVISION=ci-smoke-revision --tag hivegrid-web:smoke .
|
||||
- name: Build api Docker target
|
||||
run: docker build --target api --build-arg APP_REVISION=ci-smoke-revision --tag toolctrl-api:smoke .
|
||||
run: docker build --target api --build-arg APP_REVISION=ci-smoke-revision --tag hivegrid-api:smoke .
|
||||
- name: Build worker Docker target
|
||||
run: docker build --target worker --build-arg APP_REVISION=ci-smoke-revision --tag toolctrl-worker:smoke .
|
||||
run: docker build --target worker --build-arg APP_REVISION=ci-smoke-revision --tag hivegrid-worker:smoke .
|
||||
`;
|
||||
const rootDir = createFixture(
|
||||
VALID_WORKFLOW.replace(/ - name: Build Docker smoke targets\n shell: bash\n run: \|\n(?: .*\n)+? - name: Validate web Docker artifacts\n/, `${sequentialBuilds} - name: Validate web Docker artifacts\n`),
|
||||
@@ -886,20 +899,20 @@ describe("verify-gitea-ci-workflow", () => {
|
||||
const rootDir = createFixture(
|
||||
VALID_WORKFLOW.replace(
|
||||
" - name: Validate Docker Compose config\n run: docker compose config\n",
|
||||
" - name: Validate Docker Compose config\n run: docker compose config\n - name: Publish image\n run: |\n docker compose config\n docker push registry.example.com/toolctrl/api:latest\n",
|
||||
" - name: Validate Docker Compose config\n run: docker compose config\n - name: Publish image\n run: |\n docker compose config\n docker push registry.example.com/hivegrid/api:latest\n",
|
||||
),
|
||||
);
|
||||
|
||||
const result = verifyGiteaCiWorkflow(rootDir);
|
||||
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: Docker smoke job "docker-smoke" contains forbidden publish command: run: docker compose config\ndocker push registry\.example\.com\/toolctrl\/api:latest/);
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: Docker smoke job "docker-smoke" contains forbidden publish command: run: docker compose config\ndocker push registry\.example\.com\/hivegrid\/api:latest/);
|
||||
});
|
||||
|
||||
it("does not treat Docker publish commands outside Docker smoke as Docker smoke publish failures", () => {
|
||||
const rootDir = createFixture(
|
||||
VALID_WORKFLOW.replace(
|
||||
" - name: Build API\n run: pnpm --filter @toolctrl/api build\n",
|
||||
" - name: Build API\n run: pnpm --filter @toolctrl/api build\n - name: Misplaced publish\n run: docker push registry.example.com/toolctrl/api:latest\n",
|
||||
" - name: Build API\n run: pnpm --filter @hivegrid/api build\n",
|
||||
" - name: Build API\n run: pnpm --filter @hivegrid/api build\n - name: Misplaced publish\n run: docker push registry.example.com/hivegrid/api:latest\n",
|
||||
),
|
||||
);
|
||||
|
||||
@@ -932,14 +945,14 @@ describe("verify-gitea-ci-workflow", () => {
|
||||
it("fails when a forbidden browser command is present in a service job", () => {
|
||||
const rootDir = createFixture(
|
||||
VALID_WORKFLOW.replace(
|
||||
" - name: Build API\n run: pnpm --filter @toolctrl/api build\n",
|
||||
" - name: Build API\n run: pnpm --filter @toolctrl/api build\n - name: Browser smoke\n run: pnpm --filter @toolctrl/api exec browser test\n",
|
||||
" - name: Build API\n run: pnpm --filter @hivegrid/api build\n",
|
||||
" - name: Build API\n run: pnpm --filter @hivegrid/api build\n - name: Browser smoke\n run: pnpm --filter @hivegrid/api exec browser test\n",
|
||||
),
|
||||
);
|
||||
|
||||
const result = verifyGiteaCiWorkflow(rootDir);
|
||||
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: forbidden E2E\/browser command found: run: pnpm --filter @toolctrl\/api exec browser test/);
|
||||
assert.match(result.failures.join("\n"), /\.gitea\/workflows\/ci\.yml: forbidden E2E\/browser command found: run: pnpm --filter @hivegrid\/api exec browser test/);
|
||||
});
|
||||
|
||||
it("fails when the internal host override uses the reserved GITEA_ prefix", () => {
|
||||
@@ -951,11 +964,11 @@ describe("verify-gitea-ci-workflow", () => {
|
||||
});
|
||||
|
||||
it("fails when the internal host override is written without token validation", () => {
|
||||
const rootDir = createFixture(`${VALID_WORKFLOW}\n host-smoke:\n runs-on: toolctrl-ci\n steps:\n - name: Resolve internal host\n run: |\n if [ -n \"\${TOOLCTRL_GITEA_HOST_IP:-}\" ]; then\n printf '%s git.tool-ctrl.de\\n' \"$TOOLCTRL_GITEA_HOST_IP\" >> /etc/hosts\n fi\n`);
|
||||
const rootDir = createFixture(`${VALID_WORKFLOW}\n host-smoke:\n runs-on: toolctrl-ci\n steps:\n - name: Resolve internal host\n run: |\n if [ -n \"\${HIVEGRID_GITEA_HOST_IP:-}\" ]; then\n printf '%s git.tool-ctrl.de\\n' \"$HIVEGRID_GITEA_HOST_IP\" >> /etc/hosts\n fi\n`);
|
||||
|
||||
const result = verifyGiteaCiWorkflow(rootDir);
|
||||
|
||||
assert.match(result.failures.join("\n"), /TOOLCTRL_GITEA_HOST_IP must be validated before writing to \/etc\/hosts/);
|
||||
assert.match(result.failures.join("\n"), /HIVEGRID_GITEA_HOST_IP must be validated before writing to \/etc\/hosts/);
|
||||
});
|
||||
|
||||
it("fails when web source maps are not uploaded for the Sentry release", () => {
|
||||
|
||||
Reference in new issue
Block a user