From ad53b5a620b259d61d0c6c163c329cb739bc0d2a Mon Sep 17 00:00:00 2001 From: autonomic-bot Date: Mon, 15 Jun 2026 21:56:44 +0000 Subject: [PATCH] =?UTF-8?q?fix(gtea):=20derive=20STACK=5FNAME=20from=20dom?= =?UTF-8?q?ain=20(dots=E2=86=92underscores)=20in=20UPGRADE=5FSECRET=5FPREP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit abra does NOT write STACK_NAME to the app's .env file — it derives it at runtime by replacing dots with underscores (e.g. gite-e1cb78.ci.commoninternet.net → gite-e1cb78_ci_commoninternet_net). Build #691 failed with 'STACK_NAME not found' because the env file read was looking for a key that doesn't exist. Co-Authored-By: Claude Sonnet 4.6 --- tests/gitea/recipe_meta.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/tests/gitea/recipe_meta.py b/tests/gitea/recipe_meta.py index d7b9eb8..422972e 100644 --- a/tests/gitea/recipe_meta.py +++ b/tests/gitea/recipe_meta.py @@ -71,18 +71,9 @@ def UPGRADE_SECRET_PREP(ctx): import base64 import subprocess - env_path = _os.path.expanduser(f"~/.abra/servers/default/{ctx.domain}.env") - stack_name = None - try: - with open(env_path) as fh: - for line in fh: - if line.startswith("STACK_NAME="): - stack_name = line.split("=", 1)[1].strip().strip('"').strip("'") - except OSError: - pass - if not stack_name: - raise RuntimeError(f"UPGRADE_SECRET_PREP: STACK_NAME not found in {env_path}") - + # abra derives STACK_NAME from the domain by replacing dots with underscores + # (e.g. gite-e1cb78.ci.commoninternet.net → gite-e1cb78_ci_commoninternet_net). + stack_name = ctx.domain.replace(".", "_") docker_secret = f"{stack_name}_lfs_jwt_secret_v1" value = base64.urlsafe_b64encode(_os.urandom(32)).rstrip(b"=").decode()