Repository navigation
Conversation
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
More details
Atomic fixture directory creation removes random-name collisions, and explicit failure returns prevent setup from continuing with an empty path when mktemp fails.
🤖 Bits Code Review · Commit 1249b5a
Scan-Build Report
Bug Summary
Reports
|
|||||||||||||||||||||||||||||||||||||||||||||||||
CI Test ResultsRun: #41920831693 | Commit:
Status Overview
Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled Summary: Total: 32 | Passed: 32 | Failed: 0 Updated: 2026-11-04 22:21:21 UTC |
What does this PR do?:
Creates the fixture directories in
test_release_automation.shwithmktemp -dinstead of$TEMP_DIR/<name>-$RANDOM. A failedmktempnow makes the helper return non-zero, so setup stops instead of continuing with an empty path.Motivation:
release-automation-testsfailed on #937 for a reason unrelated to that PR (job). One run creates 10 remotes and 10 work trees with$RANDOMnames. Two names collided (work-10350), sogit initreused an existing repo,git remote add originfailed, and the job exited 128. The chance is about 0.14% per run, but each occurrence is a false red that someone has to diagnose.Additional Notes:
.gitsuffix on the bare remote's name is dropped. BSD/macOSmktemponly replaces trailingXs, and a bare repo works without the suffix.|| return 1matters becausesetup_remote/setup_workrun inside$(...), whereset -eis off. Without it, a failedmktempwould leave the path empty, andgit -C ""would act on the invoking checkout.mktempis the only new failure point. The old$RANDOMpath could never be empty.git init,cp,git push) are still swallowed for the same$(...)reason. This was already true before this change.shopt -s inherit_errexitwould close it suite-wide, but it changes failure behavior for every command substitution in the script, so it deserves its own change./code-review(medium) on both commits. The first round's findings on the empty-path case are fixed in the second commit. The re-review raised only the pre-existinginherit_errexitgap above. No Critical/High findings are open.How to test the change?:
.github/scripts/tests/test_release_automation.shlocallybash -non the scriptmktempfailure inside$(f)underset -euo pipefailaborts the callershellcheckrelease-automation-testsThe collision itself is too rare to reproduce on demand. The fix removes its cause:
mktemp -dcreates each directory atomically under a unique name.For Datadog employees:
credentials of any kind, I've requested a security review (run the
dd:platform-security-reviewskill, or file a request via the PSEC review form).
bewairealso runs automatically on every PR.🤖 Generated with Claude Code