feat(git-gate): include hostname in deploy key title
lint / lint (push) Successful in 2m27s
test / unit (pull_request) Successful in 1m19s
test / integration (pull_request) Successful in 31s
test / coverage (pull_request) Successful in 1m26s

Closes #388 (part 1 of 3). Deploy key titles now carry the machine
hostname so keys provisioned on different hosts don't collide with
each other on the forge when a prior bottle was never torn down.

Title format: bot-bottle:<hostname>:<slug>:<repo-name>
This commit is contained in:
2026-07-17 02:27:11 +00:00
parent ec55dfde0c
commit 0060f5229e
2 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -10,6 +10,7 @@ from __future__ import annotations
import os
import dataclasses
import socket
from pathlib import Path
from typing import TYPE_CHECKING
@@ -46,7 +47,7 @@ def _provision_dynamic_key(
owner_repo = entry.UpstreamPath
if owner_repo.endswith(".git"):
owner_repo = owner_repo[:-4]
title = f"bot-bottle:{slug}:{entry.Name}"
title = f"bot-bottle:{socket.gethostname()}:{slug}:{entry.Name}"
info(f"provisioning deploy key for git-gate.repos[{entry.Name!r}]")
key_id, private_key_bytes = provisioner.create(owner_repo, title)