From 2ca9123f450a246fc6269732019ce2a1f93c9656 Mon Sep 17 00:00:00 2001 From: Roman Kennke Date: Wed, 4 Nov 2026 21:49:26 +0000 Subject: [PATCH 1/2] Create release-test fixture dirs with mktemp (PROF-16478) setup_remote and setup_work named their directories with $RANDOM. A run creates ten of each, so two names can collide: git init then reuses an existing repo, remote add fails, and the job exits 128. mktemp -d gives each fixture a unique directory. Co-Authored-By: Claude Opus 5.5 --- .github/scripts/tests/test_release_automation.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/scripts/tests/test_release_automation.sh b/.github/scripts/tests/test_release_automation.sh index cab0e25ae4..9cf06bd487 100755 --- a/.github/scripts/tests/test_release_automation.sh +++ b/.github/scripts/tests/test_release_automation.sh @@ -163,7 +163,8 @@ pass # --- Release script integration tests (hermetic, local bare remote) ---------- setup_remote() { - local remote="$TEMP_DIR/remote-$RANDOM.git" + local remote + remote=$(mktemp -d "$TEMP_DIR/remote-XXXXXX") git init --bare --quiet "$remote" git --git-dir="$remote" config core.hooksPath /dev/null echo "$remote" @@ -172,7 +173,8 @@ setup_remote() { setup_work() { local remote=$1 local branch=$2 - local work="$TEMP_DIR/work-$RANDOM" + local work + work=$(mktemp -d "$TEMP_DIR/work-XXXXXX") git init --quiet -b "$branch" "$work" git -C "$work" config user.name "Release Test" git -C "$work" config user.email "release-test@example.invalid" From 1249b5ad21251683b5933fbaf943e8af946ecbe3 Mon Sep 17 00:00:00 2001 From: Roman Kennke Date: Wed, 4 Nov 2026 21:53:28 +0000 Subject: [PATCH 2/2] Stop release-test setup when mktemp fails (PROF-16478) Both helpers run inside $(...), where errexit is off. A failed mktemp would leave the path empty, and git -C "" would then act on the invoking checkout. Return non-zero so the caller's assignment fails. Co-Authored-By: Claude Opus 5.5 --- .github/scripts/tests/test_release_automation.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/tests/test_release_automation.sh b/.github/scripts/tests/test_release_automation.sh index 9cf06bd487..21ee4fc287 100755 --- a/.github/scripts/tests/test_release_automation.sh +++ b/.github/scripts/tests/test_release_automation.sh @@ -164,7 +164,7 @@ pass setup_remote() { local remote - remote=$(mktemp -d "$TEMP_DIR/remote-XXXXXX") + remote=$(mktemp -d "$TEMP_DIR/remote-XXXXXX") || return 1 git init --bare --quiet "$remote" git --git-dir="$remote" config core.hooksPath /dev/null echo "$remote" @@ -174,7 +174,7 @@ setup_work() { local remote=$1 local branch=$2 local work - work=$(mktemp -d "$TEMP_DIR/work-XXXXXX") + work=$(mktemp -d "$TEMP_DIR/work-XXXXXX") || return 1 git init --quiet -b "$branch" "$work" git -C "$work" config user.name "Release Test" git -C "$work" config user.email "release-test@example.invalid"