Update hivegrid-cloud reference to latest main

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
davidandClaude Fable 5 committed 2026-07-08 16:15:37 +02:00
1 parent e98d38e716
commit 7b21524c86
3781 files changed
+373484 -225607

No files matched your search

@@ -14,7 +14,7 @@ import {
const WORKFLOW_PATH = ".gitea/workflows/deploy.yml";
const REQUIRED_RUNNER = CI_RUNNER_LABEL;
const REQUIRED_TARGETS = ["web", "api", "worker"];
const REQUIRED_TARGETS = ["web", "api", "worker", "mcp"];
const PREFLIGHT_JOB = "deploy-preflight";
const DEPLOY_JOB = "stage-or-promote";
const PREFLIGHT_DATABASE_URL = INFRA_PREFLIGHT_DATABASE_URL;
@@ -51,10 +51,17 @@ const FORBIDDEN_E2E_PATTERN = /\b(playwright|cypress|browser|test:e2e|e2e)\b/i;
const COOLIFY_TOKEN_SECRET = "${{ secrets.COOLIFY_TOKEN }}";
const COOLIFY_API_URL_VAR = "${{ vars.COOLIFY_API_URL }}";
const COOLIFY_RESOURCE_UUIDS_VAR = "${{ vars.COOLIFY_RESOURCE_UUIDS }}";
const PRODUCTION_SEED_ARTIFACT_PATTERN = /packages\/db\/dist\/production-seed\.server\.js/;
const PRODUCTION_SEED_COMMAND_PATTERN = /\bNODE_ENV=production\s+node\s+packages\/db\/dist\/production-seed\.server\.js\b/;
const COOLIFY_MIGRATION_SLOT_PATTERN = /pre_deployment_command:\s*process\.env\.MIGRATION_COMMAND/;
const COOLIFY_SEED_SLOT_PATTERN = /post_deployment_command:\s*process\.env\.SEED_COMMAND/;
// Coolify pre/post_deployment_command never fired for docker-image apps, so
// migrations and the seed moved into the web entrypoint (start.sh, gated by
// MIGRATE_ON_BOOT/SEED_ON_BOOT). The workflow must clear the dead hook slots
// and upsert the boot flags on the web resource instead.
const COOLIFY_MIGRATION_SLOT_CLEARED_PATTERN = /pre_deployment_command:\s*""/;
const COOLIFY_SEED_SLOT_CLEARED_PATTERN = /post_deployment_command:\s*""/;
const COOLIFY_SET_ENVS_PATTERN = /coolify-deploy\.mjs\s+set-envs\s+"\$WEB_RESOURCE_UUID"/;
const MIGRATE_ON_BOOT_FLAG_PATTERN = /\bMIGRATE_ON_BOOT=true\b/;
const SEED_ON_BOOT_FLAG_PATTERN = /\bSEED_ON_BOOT=true\b/;
const STAGING_DEMO_SEED_FLAG_PATTERN = /\bSEED_DEMO_DATA=true\b/;
const STAGING_DEMO_SEED_GUARD_FLAG_PATTERN = /\bALLOW_STAGING_DEMO_SEED=true\b/;
const LITERAL_COOLIFY_URL_PATTERN = /https?:\/\/[^\s'\"]*(?:coolify|webhook)[^\s'\"]*/i;
const LITERAL_PRODUCTION_REGISTRY_PATTERN =
/\b(?:ghcr\.io|registry\.docker\.com|docker\.io|registry\.[A-Za-z0-9.-]+|[A-Za-z0-9.-]+:\d{2,5})\/[A-Za-z0-9._/-]+/i;
@@ -70,6 +77,7 @@ const HOST_OVERRIDE_WRITE_PATTERN = INFRA_HOST_OVERRIDE_WRITE_PATTERN;
const HOST_OVERRIDE_VALIDATION_PATTERN = INFRA_HOST_OVERRIDE_VALIDATION_PATTERN;
const REQUIRED_DEPENDENT_IMAGE_TAG_PATCH_RESOURCES = [
"API_RESOURCE_UUID",
"MCP_RESOURCE_UUID",
"WORKER_GENERAL_RESOURCE_UUID",
"WORKER_MAIL_RESOURCE_UUID",
"WORKER_IMPORT_RESOURCE_UUID",
@@ -537,10 +545,10 @@ export function checkDeploymentConcurrency(content) {
const passes = [];
const failures = [];
if (/^concurrency:\s*$/m.test(content) && /^\s+group:\s*boilerplate-deploy\s*$/m.test(content) && /^\s+cancel-in-progress:\s*false\s*$/m.test(content)) {
if (/^concurrency:\s*$/m.test(content) && /^\s+group:\s*hivegrid-deploy\s*$/m.test(content) && /^\s+cancel-in-progress:\s*false\s*$/m.test(content)) {
passes.push(`${WORKFLOW_PATH}: deployment concurrency serializes staging and production promotion`);
} else {
failures.push(`${WORKFLOW_PATH}: deployment workflow must define concurrency group boilerplate-deploy with cancel-in-progress: false`);
failures.push(`${WORKFLOW_PATH}: deployment workflow must define concurrency group hivegrid-deploy with cancel-in-progress: false`);
}
return { passes, failures, observations: [] };
@@ -550,7 +558,7 @@ export function checkForbiddenCommands(content, analysis) {
const passes = [];
const failures = [];
const e2eBlock = getRunBlocks(content, analysis).find(({ command }) => FORBIDDEN_E2E_PATTERN.test(command.replace(/\btoolctrl\.browser-automation\b/g, "")));
const e2eBlock = getRunBlocks(content, analysis).find(({ command }) => FORBIDDEN_E2E_PATTERN.test(command.replace(/\bhivegrid\.browser-automation\b/g, "")));
if (e2eBlock) {
failures.push(`${WORKFLOW_PATH}:${e2eBlock.lineNumber}: forbidden E2E/browser command found: ${e2eBlock.line}`);
} else {
@@ -608,9 +616,9 @@ export function checkRequiredStepHardening(content, analysis) {
predicate: (command) => /\bdocker\s+buildx\s+build\b/.test(command) && /(?:^|\s)--push(?:\s|$)/.test(command),
},
{
label: "Coolify migration command configuration",
label: "Coolify migration boot flag configuration",
predicate: (command) =>
/pre_deployment_command/.test(command) && /\bprisma\s+migrate\s+deploy\b/.test(command) && PRODUCTION_SEED_ARTIFACT_PATTERN.test(command),
COOLIFY_MIGRATION_SLOT_CLEARED_PATTERN.test(command) && COOLIFY_SET_ENVS_PATTERN.test(command) && MIGRATE_ON_BOOT_FLAG_PATTERN.test(command),
},
{
label: "Coolify deploy trigger",
@@ -644,75 +652,73 @@ export function checkDatabaseMigrationDeployContract(content, analysis) {
const passes = [];
const failures = [];
const steps = getStepBlocks(content, analysis);
const migrationStep = steps.find(({ text }) => /\bConfigure Coolify staging migration command\b/i.test(text));
const productionMigrationStep = steps.find(({ text }) => /\bConfigure Coolify production migration command\b/i.test(text));
const migrationStep = steps.find(({ text }) => /\bConfigure Coolify staging migration boot flags\b/i.test(text));
const productionMigrationStep = steps.find(({ text }) => /\bConfigure Coolify production migration boot flags\b/i.test(text));
if (!migrationStep) {
failures.push(`${WORKFLOW_PATH}: missing Coolify staging migration command configuration step`);
failures.push(`${WORKFLOW_PATH}: missing Coolify staging migration boot flag configuration step`);
return { passes, failures, observations: [] };
}
if (!productionMigrationStep) {
failures.push(`${WORKFLOW_PATH}: missing Coolify production migration command configuration step`);
failures.push(`${WORKFLOW_PATH}: missing Coolify production migration boot flag configuration step`);
} else if (
COOLIFY_MIGRATION_SLOT_PATTERN.test(productionMigrationStep.text) &&
COOLIFY_SEED_SLOT_PATTERN.test(productionMigrationStep.text) &&
/\bprisma\s+migrate\s+deploy\b/.test(productionMigrationStep.text) &&
PRODUCTION_SEED_COMMAND_PATTERN.test(productionMigrationStep.text) &&
COOLIFY_MIGRATION_SLOT_CLEARED_PATTERN.test(productionMigrationStep.text) &&
COOLIFY_SEED_SLOT_CLEARED_PATTERN.test(productionMigrationStep.text) &&
COOLIFY_SET_ENVS_PATTERN.test(productionMigrationStep.text) &&
MIGRATE_ON_BOOT_FLAG_PATTERN.test(productionMigrationStep.text) &&
SEED_ON_BOOT_FLAG_PATTERN.test(productionMigrationStep.text) &&
/ALLOWED_RESOURCE_UUIDS="\$(?:RESOLVED_COOLIFY_RESOURCE_UUIDS|COOLIFY_RESOURCE_UUIDS)"/.test(productionMigrationStep.text) &&
/docker_registry_image_tag:\s*process\.env\.IMAGE_TAG/.test(productionMigrationStep.text)
) {
passes.push(
`${WORKFLOW_PATH}:${productionMigrationStep.lineNumber}: Coolify production pre-deployment migration and post-deployment guarded seed command targets the main web application`
`${WORKFLOW_PATH}:${productionMigrationStep.lineNumber}: Coolify production boot flag configuration clears dead hook slots and sets MIGRATE_ON_BOOT/SEED_ON_BOOT on the main web application`
);
} else {
failures.push(
`${WORKFLOW_PATH}:${productionMigrationStep.lineNumber}: Coolify production migration command must patch production web app migrations, post-deployment guarded production seed, and immutable image tag`
`${WORKFLOW_PATH}:${productionMigrationStep.lineNumber}: Coolify production boot flag configuration must clear pre/post_deployment_command, upsert MIGRATE_ON_BOOT=true and SEED_ON_BOOT=true via coolify-deploy.mjs set-envs, and patch the immutable image tag`
);
}
if (COOLIFY_MIGRATION_SLOT_PATTERN.test(migrationStep.text) && /\bprisma\s+migrate\s+deploy\b/.test(migrationStep.text)) {
passes.push(`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify pre-deployment migration command is present`);
} else {
failures.push(`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify staging migration command must set pre_deployment_command to prisma migrate deploy`);
if (
productionMigrationStep &&
(STAGING_DEMO_SEED_FLAG_PATTERN.test(productionMigrationStep.text) || STAGING_DEMO_SEED_GUARD_FLAG_PATTERN.test(productionMigrationStep.text))
) {
failures.push(
`${WORKFLOW_PATH}:${productionMigrationStep.lineNumber}: Coolify production boot flag configuration must not set staging demo seed flags (SEED_DEMO_DATA/ALLOW_STAGING_DEMO_SEED)`
);
} else if (productionMigrationStep) {
passes.push(`${WORKFLOW_PATH}:${productionMigrationStep.lineNumber}: Coolify production boot flag configuration keeps demo seed flags off`);
}
if (COOLIFY_SEED_SLOT_PATTERN.test(migrationStep.text)) {
passes.push(`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify post-deployment guarded seed command is present`);
} else {
failures.push(`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify staging migration command must set post_deployment_command to the guarded seed`);
}
if (/cd\s+\/myapp\b/.test(migrationStep.text) && !/cd\s+\/myapp\/packages\/db\b/.test(migrationStep.text)) {
passes.push(`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify migration command runs from the web image app root`);
if (COOLIFY_MIGRATION_SLOT_CLEARED_PATTERN.test(migrationStep.text) && COOLIFY_SEED_SLOT_CLEARED_PATTERN.test(migrationStep.text)) {
passes.push(`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify staging boot flag configuration clears the dead pre/post deployment hook slots`);
} else {
failures.push(
`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify staging migration command must run from /myapp so prisma.config.ts resolves in the final web image`
`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify staging boot flag configuration must clear pre_deployment_command and post_deployment_command (hooks never fired for docker-image apps)`
);
}
if (/\btsx\b/.test(migrationStep.text) || /node_modules\/\.pnpm\/node_modules\/\.bin/.test(migrationStep.text)) {
failures.push(`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify staging migration command must not use pnpm store-internal .bin paths`);
} else if (/\bpnpm\s+exec\s+prisma\b/.test(migrationStep.text) && PRODUCTION_SEED_COMMAND_PATTERN.test(migrationStep.text)) {
passes.push(`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify migration command uses production runtime-resolvable commands`);
} else {
failures.push(
`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify staging migration command must use pnpm exec for prisma and NODE_ENV=production node packages/db/dist/production-seed.server.js`
if (
COOLIFY_SET_ENVS_PATTERN.test(migrationStep.text) &&
MIGRATE_ON_BOOT_FLAG_PATTERN.test(migrationStep.text) &&
SEED_ON_BOOT_FLAG_PATTERN.test(migrationStep.text) &&
STAGING_DEMO_SEED_FLAG_PATTERN.test(migrationStep.text) &&
STAGING_DEMO_SEED_GUARD_FLAG_PATTERN.test(migrationStep.text)
) {
passes.push(
`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify staging boot flag configuration upserts MIGRATE_ON_BOOT/SEED_ON_BOOT and the guarded demo seed flags on the web resource`
);
}
if (PRODUCTION_SEED_COMMAND_PATTERN.test(migrationStep.text)) {
passes.push(`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify guarded seed uses built DB package output`);
} else {
failures.push(
`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify staging migration command must run the guarded production seed from built DB output in post_deployment_command`
`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify staging boot flag configuration must upsert MIGRATE_ON_BOOT=true, SEED_ON_BOOT=true, SEED_DEMO_DATA=true, and ALLOW_STAGING_DEMO_SEED=true via coolify-deploy.mjs set-envs`
);
}
if (/\bcurl\b[\s\S]*--request PATCH[\s\S]*\/applications\/\$WEB_RESOURCE_UUID/.test(migrationStep.text)) {
passes.push(`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify migration command is patched through the application API`);
passes.push(`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify boot flag configuration patches the web application through the application API`);
} else {
failures.push(`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify staging migration command must be patched through the application API`);
failures.push(`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify staging boot flag configuration must patch the web application through the application API`);
}
if (
@@ -764,7 +770,7 @@ export function checkDatabaseMigrationDeployContract(content, analysis) {
passes.push(`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify staging image-tag patch covers api and all separate worker applications`);
} else {
failures.push(
`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify staging image-tag patch must cover api, worker-general, worker-mail, worker-import, worker-webhook, and worker-plugin applications`
`${WORKFLOW_PATH}:${migrationStep.lineNumber}: Coolify staging image-tag patch must cover api, mcp, worker-general, worker-mail, worker-import, worker-webhook, and worker-plugin applications`
);
}
@@ -807,7 +813,7 @@ export function checkDatabaseMigrationDeployContract(content, analysis) {
passes.push(`${WORKFLOW_PATH}:${productionMigrationStep.lineNumber}: Coolify production image-tag patch covers api and all separate worker applications`);
} else if (productionMigrationStep) {
failures.push(
`${WORKFLOW_PATH}:${productionMigrationStep.lineNumber}: Coolify production image-tag patch must cover api, worker-general, worker-mail, worker-import, worker-webhook, and worker-plugin applications`
`${WORKFLOW_PATH}:${productionMigrationStep.lineNumber}: Coolify production image-tag patch must cover api, mcp, worker-general, worker-mail, worker-import, worker-webhook, and worker-plugin applications`
);
}
@@ -1095,27 +1101,7 @@ function checkCoolifyDependentHealthWaitContract(content, options, analysis) {
/HTTP_RESOURCE/.test(waitStep.text) &&
/WORKER_RESOURCE/.test(waitStep.text) &&
new RegExp(`${options.label.includes("staging") ? "STAGING" : "PRODUCTION"}_WORKER_RESOURCE_UUIDS`).test(waitStep.text) &&
/docker exec /.test(waitStep.text) &&
/docker ps --filter name=\$RESOURCE_UUID/.test(waitStep.text) &&
/node apps\/worker\/dist\/health\.js/.test(waitStep.text) &&
/WORKER_REVISION/.test(waitStep.text) &&
/WORKER_ENABLED/.test(waitStep.text) &&
/workerEnabled/.test(waitStep.text) &&
/worker health reports workerEnabled=false/.test(waitStep.text) &&
/WORKER_STATUS/.test(waitStep.text) &&
/\[\s*"\$WORKER_STATUS"\s*!=\s*"ready"\s*\]/.test(waitStep.text) &&
/worker health status is not ready/.test(waitStep.text) &&
/WORKER_GROUP/.test(waitStep.text) &&
/WORKER_QUEUES/.test(waitStep.text) &&
/worker group does not match expected queue group/.test(waitStep.text) &&
/worker queues do not match expected queue group/.test(waitStep.text) &&
/EXPECTED_WORKER_QUEUES="[^"]*toolctrl\.email/.test(waitStep.text) &&
/EXPECTED_WORKER_QUEUES="[^"]*toolctrl\.notifications[^"]*toolctrl\.maintenance[^"]*toolctrl\.file-scan/.test(waitStep.text) &&
/EXPECTED_WORKER_QUEUES="[^"]*toolctrl\.imports[^"]*toolctrl\.exports/.test(waitStep.text) &&
/EXPECTED_WORKER_QUEUES="[^"]*toolctrl\.ai-chatbot[^"]*toolctrl\.browser-automation/.test(waitStep.text) &&
/EXPECTED_WORKER_QUEUES="[^"]*toolctrl\.plugin-invoke/.test(waitStep.text) &&
/for EXPECTED_WORKER_QUEUE in \$EXPECTED_WORKER_QUEUES/.test(waitStep.text) &&
/worker live revision matches image tag/.test(waitStep.text) &&
/worker Coolify status is healthy and image tag matches expected alias/.test(waitStep.text) &&
/is an HTTP resource but has no health URL/.test(waitStep.text) &&
/CONFIGURED_IMAGE_TAG/.test(waitStep.text) &&
/EXPECTED_IMAGE_ALIAS/.test(waitStep.text) &&
@@ -1123,24 +1109,24 @@ function checkCoolifyDependentHealthWaitContract(content, options, analysis) {
/\[\s*"\$CONFIGURED_IMAGE_TAG"\s*!=\s*"\$EXPECTED_IMAGE_ALIAS"\s*\]/.test(waitStep.text)
) {
passes.push(
`${WORKFLOW_PATH}:${waitStep.lineNumber}: ${options.label} dependent health wait handles HTTP resources, worker live readiness, and non-HTTP alias tags explicitly`
`${WORKFLOW_PATH}:${waitStep.lineNumber}: ${options.label} dependent health wait handles HTTP resources, worker Coolify status, and non-HTTP alias tags explicitly`
);
} else {
failures.push(
`${WORKFLOW_PATH}:${waitStep.lineNumber}: ${options.label} dependent health wait must fail HTTP resources without health URLs, require worker execute health status=ready and workerEnabled=true, and compare alias tags for non-HTTP resources`
`${WORKFLOW_PATH}:${waitStep.lineNumber}: ${options.label} dependent health wait must fail HTTP resources without health URLs, require worker running:healthy status plus expected alias tag, and compare alias tags for non-HTTP resources`
);
}
if (
/worker execute endpoint unavailable; configured image tag matches expected alias/.test(waitStep.text) ||
/worker execute output unavailable; configured image tag matches expected alias/.test(waitStep.text) ||
/worker execute output is not JSON; configured image tag matches expected alias/.test(waitStep.text)
/COOLIFY_.*SSH_KEY/.test(waitStep.text) ||
/docker exec /.test(waitStep.text) ||
/docker ps --filter name=\$RESOURCE_UUID/.test(waitStep.text)
) {
failures.push(
`${WORKFLOW_PATH}:${waitStep.lineNumber}: ${options.label} dependent health wait must not pass-open worker execute failures based on image tag only`
`${WORKFLOW_PATH}:${waitStep.lineNumber}: ${options.label} dependent health wait must not expose SSH secrets or use docker exec from CI logs`
);
} else {
passes.push(`${WORKFLOW_PATH}:${waitStep.lineNumber}: ${options.label} dependent health wait fails worker execute failures closed`);
passes.push(`${WORKFLOW_PATH}:${waitStep.lineNumber}: ${options.label} dependent health wait avoids SSH-backed worker probes`);
}
if (/manual runtime revision verification required after deploy/.test(waitStep.text)) {
@@ -1406,13 +1392,12 @@ export function checkDockerTargets(content, analysis) {
const usesStableRegistryBuildCache =
/CACHE_REF="\$REGISTRY\/\$IMAGE_NAMESPACE\/\$IMAGE_PREFIX\/build-cache:\$TARGET"/.test(content) &&
/--cache-from\s+"type=registry,ref=\$CACHE_REF"/.test(content) &&
/--cache-to\s+"type=registry,ref=\$CACHE_REF,mode=max(?:,[^"]*)?"/.test(content);
/--cache-from\s+"type=registry,ref=\$CACHE_REF"/.test(content);
if (usesStableRegistryBuildCache) {
passes.push(`${WORKFLOW_PATH}: staging Docker builds use stable registry cache refs per image namespace and target`);
passes.push(`${WORKFLOW_PATH}: staging Docker builds read stable registry cache refs per image namespace and target`);
} else {
failures.push(
`${WORKFLOW_PATH}: staging Docker builds must use --cache-from/--cache-to with a stable registry cache ref under $REGISTRY/$IMAGE_NAMESPACE/$IMAGE_PREFIX/build-cache:$TARGET`
`${WORKFLOW_PATH}: staging Docker builds must use --cache-from with a stable registry cache ref under $REGISTRY/$IMAGE_NAMESPACE/$IMAGE_PREFIX/build-cache:$TARGET`
);
}
@@ -1456,15 +1441,15 @@ export function checkImageVariables(content, analysis) {
const usesNamespaceVariable = /\bIMAGE_NAMESPACE\b/.test(content);
const usesImagePrefix = /\bIMAGE_PREFIX\b/.test(content);
if (usesGiteaRegistry && usesNamespaceVariable && usesImagePrefix) {
passes.push(`${WORKFLOW_PATH}: image references use the Gitea Package Registry namespace and boilerplate target path`);
passes.push(`${WORKFLOW_PATH}: image references use the Gitea Package Registry namespace and HiveGrid target path`);
} else {
failures.push(`${WORKFLOW_PATH}: image references must use ${GIT_HOST} with IMAGE_NAMESPACE and IMAGE_PREFIX`);
}
if (/\$IMAGE_PREFIX\/\$TARGET/.test(content)) {
passes.push(`${WORKFLOW_PATH}: image paths match existing Coolify boilerplate/{web|api|worker} resources`);
passes.push(`${WORKFLOW_PATH}: image paths match existing Coolify hivegrid/{web|api|worker|mcp} resources`);
} else {
failures.push(`${WORKFLOW_PATH}: image paths must match existing Coolify boilerplate/{web|api|worker} resources`);
failures.push(`${WORKFLOW_PATH}: image paths must match existing Coolify hivegrid/{web|api|worker|mcp} resources`);
}
const literalRegistryLine = getWorkflowLines(content, analysis).find(
@@ -1516,7 +1501,7 @@ export function checkTagStrategy(content, analysis) {
/fetch-depth:\s*0/.test(content) &&
/\bgit\s+cat-file\s+-e\s+"\$IMAGE_TAG\^\{commit\}"/.test(content) &&
/\bgit\s+merge-base\s+--is-ancestor\s+"\$IMAGE_TAG"\s+origin\/main\b/.test(content) &&
/for TARGET in web api worker; do[\s\S]*docker\s+buildx\s+imagetools\s+inspect\s+"\$IMAGE:\$IMAGE_TAG"\s+--format[\s\S]*docker\s+buildx\s+imagetools\s+inspect\s+"\$IMAGE:staging"\s+--format[\s\S]*SHA_DIGEST[\s\S]*STAGING_DIGEST[\s\S]*done/.test(
/for TARGET in web api worker mcp; do[\s\S]*docker\s+buildx\s+imagetools\s+inspect\s+"\$IMAGE:\$IMAGE_TAG"\s+--format[\s\S]*docker\s+buildx\s+imagetools\s+inspect\s+"\$IMAGE:staging"\s+--format[\s\S]*SHA_DIGEST[\s\S]*STAGING_DIGEST[\s\S]*done/.test(
content
);
@@ -1575,9 +1560,7 @@ export function checkSentryDeployMarkerContract(content, analysis) {
if (
/\bSENTRY_ENVIRONMENT=staging\b/.test(sentryStep.text) &&
/RELEASE_SHA="\$\{SHA\}"/.test(sentryStep.text) &&
/boilerplate-api/.test(sentryStep.text) &&
/boilerplate-worker/.test(sentryStep.text) &&
/boilerplate-web/.test(sentryStep.text)
/for PROJECT in api worker web\b/.test(sentryStep.text)
) {
passes.push(`${WORKFLOW_PATH}:${sentryStep.lineNumber}: Sentry deploy marker covers staging SHA and all runtime projects`);
} else {
@@ -1657,7 +1640,7 @@ export function checkGiteaVariableNames(content) {
const failures = [];
if (FORBIDDEN_GITEA_HOST_OVERRIDE_PATTERN.test(content)) {
failures.push(`${WORKFLOW_PATH}: GITEA_HOST_IP is forbidden because Gitea reserves the GITEA_ variable prefix; use TOOLCTRL_GITEA_HOST_IP`);
failures.push(`${WORKFLOW_PATH}: GITEA_HOST_IP is forbidden because Gitea reserves the GITEA_ variable prefix; use HIVEGRID_GITEA_HOST_IP`);
} else {
passes.push(`${WORKFLOW_PATH}: internal host override avoids the reserved GITEA_ variable prefix`);
}
@@ -1665,9 +1648,9 @@ export function checkGiteaVariableNames(content) {
const hostWrites = [...content.matchAll(HOST_OVERRIDE_WRITE_PATTERN)].length;
const validations = [...content.matchAll(HOST_OVERRIDE_VALIDATION_PATTERN)].length;
if (hostWrites > validations) {
failures.push(`${WORKFLOW_PATH}: TOOLCTRL_GITEA_HOST_IP must be validated before writing to /etc/hosts`);
failures.push(`${WORKFLOW_PATH}: HIVEGRID_GITEA_HOST_IP must be validated before writing to /etc/hosts`);
} else {
passes.push(`${WORKFLOW_PATH}: internal host override validates TOOLCTRL_GITEA_HOST_IP before /etc/hosts writes`);
passes.push(`${WORKFLOW_PATH}: internal host override validates HIVEGRID_GITEA_HOST_IP before /etc/hosts writes`);
}
return { passes, failures, observations: [] };