From 4076cf67b7c6c9c38b4f3e5a83bffa2f3a6f74b2 Mon Sep 17 00:00:00 2001 From: tinqs-limited Date: Sun, 7 Jun 2026 20:08:27 +0100 Subject: [PATCH] fix(ci): make Spot runner names unique per dispatch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit runnerName used runID[:12], which for a given commit always collapsed to e.g. `spot-deploy-7fa70fc-depl` — so a single push triggering both deploy-arikigame and release (both runs-on: deploy), or any same-commit rerun, registered colliding runner names and confused task routing. Use the full runID (sha+workflow+ms), sanitised for the runner-name charset. Co-Authored-By: Claude Opus 4.8 --- orchestrator/dispatch/main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/orchestrator/dispatch/main.go b/orchestrator/dispatch/main.go index 20c5115..4e3b11e 100644 --- a/orchestrator/dispatch/main.go +++ b/orchestrator/dispatch/main.go @@ -302,7 +302,13 @@ func startSpotRunner(ctx context.Context, c cfg, label, runID string) (string, e return "", fmt.Errorf("unknown label: %s", label) } - runnerName := fmt.Sprintf("spot-%s-%s", label, runID[:12]) + // runID = "--" already encodes everything unique. + // The old runID[:12] truncation collapsed every deploy of a commit to the + // same name (e.g. deploy-arikigame + release on one push), confusing task + // routing and same-commit reruns. Use the full runID, sanitised for the + // runner-name charset (no dots/slashes from workflow filenames). + safeID := strings.NewReplacer(".", "-", "/", "-").Replace(runID) + runnerName := fmt.Sprintf("spot-%s-%s", label, safeID) userData := userDataScript(c, label, runnerName) client := ec2.NewFromConfig(awsCfg)