Files
cc-ci/runner/harness/naming.py
T
autonomic-bot 542e8cfb11
continuous-integration/drone/push Build is failing
domain cutover: front doors + drone + per-run naming to ci.autonomic.zone
- acme-dns.nix: ONE dual-zone SAN cert (ci+*.ci.autonomic.zone AND ci+*.ci.commoninternet.net)
  via the same acmedns account — storage re-keyed by cc-ci-acme-storage-seed.service; handoff
  reads the new cert dir. Single secret pair => zero changes to the traefik reconciler.
- dashboard/bridge/reports: dual Host rules during the bake window (bridge gets explicit
  parentheses so && does not shadow the dashboard on the new host).
- drone abra app renamed to drone.ci.autonomic.zone (fresh DB supported: DRONE_USER_CREATE
  re-injects the sops bridge token); runner RPC + bootstrap-drone-oauth.sh follow.
- harness: app_domain() issues *.ci.autonomic.zone run domains; RUN_APP_RE / stack-name
  regexes / docker-prune accept BOTH zones during the bake. Warm stacks deliberately stay
  on the legacy zone (data-warm volumes; post-bake migration).
- URLs in bridge/dashboard defaults + recipe-report.py follow the new names.
2026-09-21 16:52:53 +00:00

24 lines
884 B
Python

"""Shared run-app domain naming (used by the conftest fixtures and the orchestrator).
Domain = "<recipe[:4]>-<6hex(recipe|pr|ref)>.ci.autonomic.zone" — short enough for Docker's
64-char swarm config/secret name limit, unique per run, collision-safe across recipes (DECISIONS.md).
(Migrated from *.ci.commoninternet.net 2026-09; the legacy zone remains valid until the bake
window ends — lifecycle/warm name matching accepts both.)
"""
from __future__ import annotations
import hashlib
import time
def _short(s: str, n: int = 8) -> str:
return "".join(c for c in s if c.isalnum())[:n] or "local"
def app_domain(recipe: str, pr: str = "0", ref: str | None = None) -> str:
ref = ref or ("local" + str(int(time.time())))
tag = _short(recipe, 4).lower()
h = hashlib.sha1(f"{recipe}|{pr}|{ref}".encode()).hexdigest()[:6]
return f"{tag}-{h}.ci.autonomic.zone"