ROSAENG-66712 | fix: replace non-portable sed -i with redirect-and-move #184
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.52) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #184"
general
weight: 0.35
michaelryanmcneill
PR Summary
Replace all non-portable GNU-isms in the Makefile with POSIX-compatible alternatives, fixing macOS compatibility across all targets.
Detailed Description of the Issue
The Makefile uses several GNU-specific constructs that fail on macOS:
1.
sed -i— BSD sed requires a backup extension argument while GNU sed does not, causinginvalid command codeerrors on macOS.2.
readlink -f— GNU coreutils extension not available on macOS.3. *
\sin sed patterns* — GNU sed extension, not POSIX-portable.Additionally, in the
verifytarget,sedandmvwere chained with&&. Bash exempts the left-hand side of an&&list fromset -e, so asedfailure would silently allowterraform validateto run against the unmodified file. The maintainer utility targets had noset -eat all.Related Issues and PRs
Type of Change
Previous Behavior
make verifyandmake pre-push-checksfail on macOS withsed: invalid command code e.readlink -fin theverifytarget fails on macOS (not a GNU coreutils system).dev-environment,registry-environment,change-ocp-version,change-module-version) also fail on macOS due tosed -i.change-module-versionuses\s(GNU sed extension) which may not match whitespace on non-GNU systems.verifytarget, asedfailure is silently swallowed becauseset -edoes not apply to the left-hand side of&&lists, allowingterraform validateto run against the unmodified pinned version instead of the floor version.set -e, so a failedseddoes not stop the loop.Behavior After This Change
readlink -freplaced with portablecd && pwd.\sreplaced with POSIX[[:space:]].verifytarget,sedandmvare separate;-terminated commands soset -ecatches either failure beforeterraform validateruns.set -ewith separatedsed/mvcommands for the same error-propagation guarantee.How to Test (Step-by-Step)
Preconditions
Test Steps
1. Run
make verifyon macOS (BSD sed)2. Confirm all examples validate at both pinned and floor AWS provider versions
3. Run
make pre-push-checksto confirm the full gate passes4. Verify
make dev-environmentswitches provider source toterraform.local/local/rhcs5. Verify
make registry-environmentswitches it back toterraform-redhat/rhcsExpected Results
sedorreadlinkerrors on any platformProof of the Fix
Breaking Changes
Breaking Change Details / Migration Plan
N/A
Developer Verification Checklist
rhcsresources/variables), I linked official Red Hat or cited ROSA HCP documentation that supports reference alignment, or I explained why the change still belongs in-repo per [developer-docs/submodules.md](developer-docs/submodules.md).[JIRA-TICKET] | [TYPE]: <MESSAGE>.make pre-push-checkspasses (or each step:verify,verify-gen,lint,unit-tests,license-check,docs-lint).make terraform-docs).<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Chores
<!-- end of auto-generated comment: release notes by coderabbit.ai -->