Repository navigation
Make the Compile Recipe and the Clone Instruction Portable - #166
Conversation
GNU and BSD sed disagree on a bare -i, which BSD reads as taking the next argument as a backup suffix, so the recipe's placeholder substitution failed on macOS, a supported platform. The step now writes sed's output to a mktemp file and moves it into place, so it uses no -i form and never touches a sibling path such as a secrets.yaml.bak someone moved aside. It also fails closed. The key, the template's placeholder, the substitution, and the move are one condition, so an empty key, a missing or placeholder-free template, or a failed mv leaves no secrets.yaml for the guard to keep on every later run, and the temp file is removed on any failure. The adopter clone instruction named develop while every other consumption instruction in the README and the template headers names main. It now defaults to main, and keeps develop as the route for tracking changes before they are promoted.
|
Warning Review limit reachedNext included review available in 5 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new secrets generation recipe should use mktemp with an explicit template (ideally under $config_dir) to remain portable across mktemp implementations.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
This PR improves cross-platform portability of the operational compile recipe and aligns adoption instructions with the repository’s default branch conventions.
Changes:
- Update the README clone instruction to default to
main, withdevelopnoted as the pre-promotion tracking option. - Replace the
sed -i-basedsecrets.yamlgeneration step with a temp-file + move workflow that avoids GNU/BSDsedincompatibilities.
| File | Description |
|---|---|
| README.md | Defaults the adopter clone command to main and documents develop as an opt-in tracking branch. |
| OPERATIONS.md | Reworks secrets.yaml generation to avoid sed -i and to clean up temp files on failure. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
A bare mktemp fails on implementations that require a template, and the file's own lint recipe already names one under /tmp, so this matches it.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The updated secrets-generation snippet can still behave incorrectly when mktemp fails because $tmp is used without verifying that it was created successfully.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
Resolved since last review (1)
A failed mktemp left tmp empty, so the redirect failed with an unrelated error before the step's own message. mktemp now runs inside the condition, only after the key and the template check pass, and the cleanup runs only when a temp file exists.

What
Answers the two findings Copilot raised against the promotion pull request #164.
OPERATIONS.mdcompile recipe generatedsecrets.yamlwithsed -i, which GNU and BSD sed read differently. BSD sed takes the argument after a bare-ias a backup suffix, so the step failed on macOS, a supported platform. It now writessed's output to amktempfile and moves it into place, with no-iform at all.README.mdadopter clone instruction nameddevelopwhile every other consumption instruction, in the README and in each template'sExternal usage:header, namesmain. It now defaults tomainand keepsdevelopas the route for tracking changes before they are promoted.Why the step changed more than the finding asked
The review passes on this branch found that each obvious fix failed a different way, and each is closed here:
sed -i.bakplusrmof the backup is portable, but deletes a realsecrets.yaml.baksomeone moved aside.mvinstalls an emptysecrets.yamlwhensedfails, and one with an empty key whenopensslfails. The existing guard then keeps that broken file on every later run, so the compile fails on missing secrets a long way from the cause.The key, the template's placeholder, the substitution, and the move are now one condition. Any failure leaves no
secrets.yamland removes the temp file.Verification
The block was extracted from the file as written and run under both
bashanddash, with an isolatedTMPDIRso a leaked temp file counts exactly:secrets.yamlwritten with the placeholder replacedopensslfailsmvfails into a read-only directorymktempfailsThe
mktempand redirect form also ran under busybox. BSD sed itself was not available to execute here, and the step no longer relies on any-ibehavior, which is what differed.Notes
The generated file now takes
mktemp's mode 0600 rather than the 0644cpgave, which suits a secrets file and is readable by the container, since the recipe runs it as the invoking user.The
commentslabel is not needed here, since this change adds no comment line in code or config.🤖 Generated with Claude Code