chore(infra): Gitea-Host auf git.hg-int.dev umstellen

Gitea läuft seit 2026-11-11 auf hivegrid-control (git.hg-int.dev);
git.tool-ctrl.de wird abgeschaltet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
raffaelandClaude Opus 5.5 committed 2026-11-11 18:53:32 +01:00
1 parent c4701e5b37
commit d09f79b673
56 files changed
+138 -138

No files matched your search

@@ -13,7 +13,7 @@ const envOr = (key, fallback) => {
export const CI_RUNNER_LABEL = envOr("HIVEGRID_CI_RUNNER", "toolctrl-ci");
export const DEPLOY_RUNNER_LABEL = envOr("HIVEGRID_DEPLOY_RUNNER", "toolctrl-deploy");
export const IMAGE_PREFIX = envOr("HIVEGRID_IMAGE_PREFIX", "hivegrid");
export const GIT_HOST = envOr("HIVEGRID_GIT_HOST", "git.tool-ctrl.de");
export const GIT_HOST = envOr("HIVEGRID_GIT_HOST", "git.hg-int.dev");
export const REGISTRY_NAMESPACE = envOr("HIVEGRID_REGISTRY_NAMESPACE", "toolctrl-labs");
export const DB_USER = envOr("HIVEGRID_DB_USER", "hivegrid");
export const DB_NAME = envOr("HIVEGRID_DB_NAME", "hivegrid");
@@ -75,7 +75,7 @@ describe("repository metrics publication contract", () => {
it("embeds both live SVGs and links their CSVs plus the local generators", () => {
const readme = read(README_PATH);
const assetBase = "https://git.tool-ctrl.de/toolctrl-labs/HiveGrid-Cloud/releases/download/loc-metrics";
const assetBase = "https://git.hg-int.dev/toolctrl-labs/HiveGrid-Cloud/releases/download/loc-metrics";
expect(readme).toContain(`![LOC-Verlauf](${assetBase}/loc-history.svg)`);
expect(readme).toContain(`${assetBase}/loc-history.csv`);
@@ -6,7 +6,7 @@
//
// Environment:
// GITEA_TOKEN required. PAT with repository write scope.
// GITEA_HOST default: git.tool-ctrl.de
// GITEA_HOST default: git.hg-int.dev
// REPO "owner/repo" (provided by Gitea workflow context).
// PR_NUMBER PR number to post on.
// COMMENT_PATH optional, default: bundle-comment.md
@@ -17,7 +17,7 @@ const MARKER = "<!-- bundle-budget-report -->";
async function main() {
const token = process.env.GITEA_TOKEN;
const host = process.env.GITEA_HOST || "git.tool-ctrl.de";
const host = process.env.GITEA_HOST || "git.hg-int.dev";
const repo = process.env.REPO;
const prNumber = process.env.PR_NUMBER;
const commentPath = process.env.COMMENT_PATH || "bundle-comment.md";
@@ -6,7 +6,7 @@
//
// Environment:
// GITEA_TOKEN required. PAT with repository write scope.
// GITEA_HOST default: git.tool-ctrl.de
// GITEA_HOST default: git.hg-int.dev
// REPO "owner/repo" (provided by Gitea workflow context).
// PR_NUMBER PR number to post on.
// COMMENT_PATH optional, default: coverage-comment.md
@@ -16,7 +16,7 @@ import fs from "node:fs";
async function main() {
const token = process.env.GITEA_TOKEN;
const host = process.env.GITEA_HOST || "git.tool-ctrl.de";
const host = process.env.GITEA_HOST || "git.hg-int.dev";
const repo = process.env.REPO;
const prNumber = process.env.PR_NUMBER;
const commentPath = process.env.COMMENT_PATH || "coverage-comment.md";
@@ -120,6 +120,6 @@ describe("e2e readiness workflows", () => {
assert.ok(source.includes("runs-on: toolctrl-ci"));
assert.ok(source.includes("HIVEGRID_GITEA_HOST_IP"));
assert.ok(source.includes("git.tool-ctrl.de"));
assert.ok(source.includes("git.hg-int.dev"));
});
});
@@ -1439,7 +1439,7 @@ 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 \"\${HIVEGRID_GITEA_HOST_IP:-}\" ]; then\n printf '%s git.tool-ctrl.de\\n' \"$HIVEGRID_GITEA_HOST_IP\" >> /etc/hosts\n fi\n`
`${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.hg-int.dev\\n' \"$HIVEGRID_GITEA_HOST_IP\" >> /etc/hosts\n fi\n`
);
const result = verifyGiteaCiWorkflow(rootDir);
@@ -2319,7 +2319,7 @@ export function checkIsolatedDeployBuildKit(rootDir, content, analysis) {
const validatedHostExitIndex = setupText.indexOf("exit 1", validatedHostIndex);
const validatedHostEndIndex = setupText.indexOf("\n fi", validatedHostIndex);
const builderExecIndex = setupText.indexOf("docker exec \\\n --env HIVEGRID_GITEA_HOST_IP=");
const staleRemovalIndex = setupText.indexOf('awk -v host="git.tool-ctrl.de" \'', builderExecIndex);
const staleRemovalIndex = setupText.indexOf('awk -v host="git.hg-int.dev" \'', builderExecIndex);
const staleRemovalEndIndex = setupText.indexOf('\' /etc/hosts > "$HOSTS_TMP"', staleRemovalIndex);
const staleRemovalText =
staleRemovalIndex >= 0 && staleRemovalEndIndex > staleRemovalIndex
@@ -2327,7 +2327,7 @@ export function checkIsolatedDeployBuildKit(rootDir, content, analysis) {
: "";
const replaceHostsIndex = setupText.indexOf('cat "$HOSTS_TMP" > /etc/hosts', staleRemovalEndIndex);
const appendHostIndex = setupText.indexOf(
'printf \'%s git.tool-ctrl.de\\n\' "$HIVEGRID_GITEA_HOST_IP" >> /etc/hosts',
'printf \'%s git.hg-int.dev\\n\' "$HIVEGRID_GITEA_HOST_IP" >> /etc/hosts',
replaceHostsIndex
);
const hostCountIndex = setupText.indexOf('BUILDKIT_HOST_COUNT="$(awk ', appendHostIndex);
@@ -2359,10 +2359,10 @@ export function checkIsolatedDeployBuildKit(rootDir, content, analysis) {
/if\s*\(\s*rewritten\s*!=\s*""\s*\)\s*\{\s*print\s+rewritten/.test(staleRemovalText);
const countsEveryHostToken =
hostCountText.trim() ===
'BUILDKIT_HOST_COUNT="$(awk -v host="git.tool-ctrl.de" \'{ for (field = 2; field <= NF; field += 1) if ($field == host) count += 1 } END { print count + 0 }\' /etc/hosts)"';
'BUILDKIT_HOST_COUNT="$(awk -v host="git.hg-int.dev" \'{ for (field = 2; field <= NF; field += 1) if ($field == host) count += 1 } END { print count + 0 }\' /etc/hosts)"';
const countsOnlyTheValidatedHostToken =
exactHostCountText.trim() ===
'BUILDKIT_EXACT_HOST_COUNT="$(awk -v host="git.tool-ctrl.de" -v ip="$HIVEGRID_GITEA_HOST_IP" \'$1 == ip { for (field = 2; field <= NF; field += 1) if ($field == host) count += 1 } END { print count + 0 }\' /etc/hosts)"';
'BUILDKIT_EXACT_HOST_COUNT="$(awk -v host="git.hg-int.dev" -v ip="$HIVEGRID_GITEA_HOST_IP" \'$1 == ip { for (field = 2; field <= NF; field += 1) if ($field == host) count += 1 } END { print count + 0 }\' /etc/hosts)"';
const hostOverrideOrderIsSafe =
requiredHostIndex >= 0 &&
requiredHostIndex < requiredHostExitIndex &&
@@ -2389,7 +2389,7 @@ export function checkIsolatedDeployBuildKit(rootDir, content, analysis) {
if (configuresBuildKitRegistryHost) {
passes.push(`${WORKFLOW_PATH}: isolated BuildKit replaces and verifies its validated registry host mapping`);
} else {
failures.push(`${WORKFLOW_PATH}: staging must require, validate, replace, and verify exactly one git.tool-ctrl.de mapping inside isolated BuildKit`);
failures.push(`${WORKFLOW_PATH}: staging must require, validate, replace, and verify exactly one git.hg-int.dev mapping inside isolated BuildKit`);
}
const quiescesHostContainer =
@@ -41,7 +41,7 @@ jobs:
stage-or-promote:
runs-on: toolctrl-deploy
env:
REGISTRY: git.tool-ctrl.de
REGISTRY: git.hg-int.dev
IMAGE_NAMESPACE: toolctrl-labs
IMAGE_PREFIX: hivegrid
DEPLOY_BUILDER_NAME: hivegrid-deploy-v0312-gc1
@@ -82,7 +82,7 @@ jobs:
echo "HIVEGRID_GITEA_HOST_IP must be a single IPv4 or IPv6 token"
exit 1
fi
printf '%s git.tool-ctrl.de\\n' "$HIVEGRID_GITEA_HOST_IP" >> /etc/hosts
printf '%s git.hg-int.dev\\n' "$HIVEGRID_GITEA_HOST_IP" >> /etc/hosts
fi
- name: Checkout code
uses: actions/checkout@v4
@@ -180,7 +180,7 @@ jobs:
sh -eu <<'HIVEGRID_BUILDKIT_HOST_OVERRIDE'
HOSTS_TMP="$(mktemp)"
trap 'rm -f "$HOSTS_TMP"' EXIT HUP INT TERM
awk -v host="git.tool-ctrl.de" '
awk -v host="git.hg-int.dev" '
{
rewritten = ""
for (field = 1; field <= NF; field += 1) {
@@ -195,9 +195,9 @@ jobs:
}
' /etc/hosts > "$HOSTS_TMP"
cat "$HOSTS_TMP" > /etc/hosts
printf '%s git.tool-ctrl.de\\n' "$HIVEGRID_GITEA_HOST_IP" >> /etc/hosts
BUILDKIT_HOST_COUNT="$(awk -v host="git.tool-ctrl.de" '{ for (field = 2; field <= NF; field += 1) if ($field == host) count += 1 } END { print count + 0 }' /etc/hosts)"
BUILDKIT_EXACT_HOST_COUNT="$(awk -v host="git.tool-ctrl.de" -v ip="$HIVEGRID_GITEA_HOST_IP" '$1 == ip { for (field = 2; field <= NF; field += 1) if ($field == host) count += 1 } END { print count + 0 }' /etc/hosts)"
printf '%s git.hg-int.dev\\n' "$HIVEGRID_GITEA_HOST_IP" >> /etc/hosts
BUILDKIT_HOST_COUNT="$(awk -v host="git.hg-int.dev" '{ for (field = 2; field <= NF; field += 1) if ($field == host) count += 1 } END { print count + 0 }' /etc/hosts)"
BUILDKIT_EXACT_HOST_COUNT="$(awk -v host="git.hg-int.dev" -v ip="$HIVEGRID_GITEA_HOST_IP" '$1 == ip { for (field = 2; field <= NF; field += 1) if ($field == host) count += 1 } END { print count + 0 }' /etc/hosts)"
if [ "$BUILDKIT_HOST_COUNT" -ne 1 ] || [ "$BUILDKIT_EXACT_HOST_COUNT" -ne 1 ]; then
echo "BuildKit registry host override did not converge to exactly one validated mapping"
exit 1
@@ -2248,21 +2248,21 @@ describe("verify-gitea-deploy-workflow", () => {
);
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
});
it("fails when isolated BuildKit appends without replacing a stale registry host mapping", () => {
const unsafeWorkflow = VALID_WORKFLOW.replace('cat "$HOSTS_TMP" > /etc/hosts', 'cat "$HOSTS_TMP" > /tmp/unapplied-hosts');
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
});
it("fails when isolated BuildKit accepts a stale mapping beside the exact registry host mapping", () => {
const unsafeWorkflow = VALID_WORKFLOW.replace('"$BUILDKIT_HOST_COUNT" -ne 1', '"$BUILDKIT_HOST_COUNT" -lt 1');
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
});
it("fails when isolated BuildKit no longer removes stale registry host tokens", () => {
@@ -2272,14 +2272,14 @@ describe("verify-gitea-deploy-workflow", () => {
);
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
});
it("fails when isolated BuildKit no longer resets the rewritten hosts line per record", () => {
const unsafeWorkflow = VALID_WORKFLOW.replace(' rewritten = ""\n for (field', " for (field");
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
});
it("fails when isolated BuildKit moves the rewritten hosts reset outside the record block", () => {
@@ -2289,17 +2289,17 @@ describe("verify-gitea-deploy-workflow", () => {
);
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
});
it("fails when isolated BuildKit moves the entire hosts rewrite into an AWK BEGIN block", () => {
const unsafeWorkflow = VALID_WORKFLOW.replace(
' awk -v host="git.tool-ctrl.de" \'\n {',
' awk -v host="git.tool-ctrl.de" \'\n BEGIN {'
' awk -v host="git.hg-int.dev" \'\n {',
' awk -v host="git.hg-int.dev" \'\n BEGIN {'
);
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
});
it("fails when isolated BuildKit hard-codes a passing registry host count", () => {
@@ -2309,24 +2309,24 @@ describe("verify-gitea-deploy-workflow", () => {
);
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
});
it("fails when isolated BuildKit counts a different hostname", () => {
const unsafeWorkflow = VALID_WORKFLOW.replace(
'BUILDKIT_HOST_COUNT="$(awk -v host="git.tool-ctrl.de"',
'BUILDKIT_HOST_COUNT="$(awk -v host="git.hg-int.dev"',
'BUILDKIT_HOST_COUNT="$(awk -v host="localhost"'
);
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
});
it("fails when isolated BuildKit drops the validated-IP predicate", () => {
const unsafeWorkflow = VALID_WORKFLOW.replace("'$1 == ip { for (field", "'1 == 1 { for (field");
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
});
it("fails when isolated BuildKit validates the IP only after writing its hosts file", () => {
@@ -2339,7 +2339,7 @@ describe("verify-gitea-deploy-workflow", () => {
assert.notEqual(validationIndex, -1);
const withoutValidation =
VALID_WORKFLOW.slice(0, validationIndex) + VALID_WORKFLOW.slice(validationIndex + validationBlock.length);
const builderAppend = ` printf '%s git.tool-ctrl.de\\n' "$HIVEGRID_GITEA_HOST_IP" >> /etc/hosts
const builderAppend = ` printf '%s git.hg-int.dev\\n' "$HIVEGRID_GITEA_HOST_IP" >> /etc/hosts
`;
const appendIndex = withoutValidation.lastIndexOf(builderAppend);
assert.notEqual(appendIndex, -1);
@@ -2348,7 +2348,7 @@ describe("verify-gitea-deploy-workflow", () => {
withoutValidation.slice(0, insertIndex) + validationBlock + withoutValidation.slice(insertIndex);
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
});
it("fails when the missing BuildKit host override guard is pass-open", () => {
@@ -2358,7 +2358,7 @@ describe("verify-gitea-deploy-workflow", () => {
);
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
});
it("fails when the invalid BuildKit host override guard is pass-open", () => {
@@ -2368,7 +2368,7 @@ describe("verify-gitea-deploy-workflow", () => {
);
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
});
it("fails when the BuildKit host count mismatch guard is pass-open", () => {
@@ -2378,7 +2378,7 @@ describe("verify-gitea-deploy-workflow", () => {
);
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
});
it("fails when isolated deploy BuildKit shutdown is not always-run", () => {
@@ -3057,7 +3057,7 @@ describe("verify-gitea-deploy-workflow", () => {
assert.notEqual(validationIndex, -1);
const withoutValidation =
VALID_WORKFLOW.slice(0, validationIndex) + VALID_WORKFLOW.slice(validationIndex + validationBlock.length);
const runnerAppend = ` printf '%s git.tool-ctrl.de\\n' "$HIVEGRID_GITEA_HOST_IP" >> /etc/hosts
const runnerAppend = ` printf '%s git.hg-int.dev\\n' "$HIVEGRID_GITEA_HOST_IP" >> /etc/hosts
`;
const appendIndex = withoutValidation.indexOf(runnerAppend);
assert.notEqual(appendIndex, -1);
@@ -3072,7 +3072,7 @@ describe("verify-gitea-deploy-workflow", () => {
it("fails when the internal host override is written without token validation", () => {
const result = verifyGiteaDeployWorkflow(
createFixture(
`${VALID_WORKFLOW}\n host-smoke:\n runs-on: toolctrl-deploy\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`
`${VALID_WORKFLOW}\n host-smoke:\n runs-on: toolctrl-deploy\n steps:\n - name: Resolve internal host\n run: |\n if [ -n \"\${HIVEGRID_GITEA_HOST_IP:-}\" ]; then\n printf '%s git.hg-int.dev\\n' \"$HIVEGRID_GITEA_HOST_IP\" >> /etc/hosts\n fi\n`
)
);