fix(ci): make Spot runner names unique per dispatch
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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 = "<sha7>-<workflow>-<ms>" 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)
|
||||
|
||||
Reference in New Issue
Block a user