Repository navigation
Conversation
…rd runs; check-scripts also parses with /bin/bash
Owner
|
Thanks @saingge! Independent review: MERGE. We moved your commit unchanged, with your authorship, into #552, so CI runs without fork approval and we can handle CHANGELOG conflicts. This PR closes when #552 merges; the merge commit carries a Co-authored-by line for you. Generated by Claude Code |
MendixMau
added a commit
that referenced
this pull request
Oct 22, 2026
…rd runs (#552, from #532) project-bin/script-owners.sh drops an apostrophe in a comment inside $(...) and uses (pat) case patterns so bash 3.2 parses it; bin/check-scripts.sh also parses with /bin/bash when that differs from the bash on PATH. Contributed by @saingge in #532. Review: MERGE — correct bash 3.2 parse fix; check-scripts 120/120 on Linux. Security review: safe. Co-authored-by: saingge <262679532+saingge@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013jQvaonym9V1wKKfAEPmRr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Direct lane (changes to
bin/,project-bin/)What changed and why:
project-bin/script-owners.shdid not parse under macOS's default/bin/bash(3.2.57).exec.shcalls it asbash …/script-owners.sh check … 2>/dev/null || true(project-bin/exec.sh:1139), so on a Mac wherebashis/bin/bashthe restatement guard (#498) printed nothing and warned about nothing, with no error. Two bash 3.2 scanner limits inside theOUT="$( … )"block caused it:# rc 0: O's work …) opens a quote that never closes (bash -nfails: "unexpected EOF while looking for matching `''"). The comment now reads "the work of O".casepattern without a leading(ends the$( … )early (case a in a) …fails at run time with "syntax error near unexpected tokennewline'").bash -ndoes NOT catch this one. The four patterns in the block's twocasestatements (not_live,revert) now use the POSIX form(pattern)`.bin/check-scripts.shnow also runs/bin/bash -nwhen the bash on PATH is a different bash, so a Mac contributor with a newer bash first on PATH still sees the first kind of failure. CI (ubuntu) has only bash 5, so CI cannot catch either; the second kind is only caught by running the fixture under /bin/bash on a Mac.Impact
project-bin/script-owners.sh(10 lines),bin/check-scripts.sh. Draft #311 also edits script-owners.sh (an earlier form of the same guard; #498 merged the guard); if #311 is revived it will conflict here. No new tools; the check-scripts change only reads/bin/bash, and is skipped when/bin/bashis the bash on PATH (Linux, Git Bash).bash -n, milliseconds per file). Nothing in exec.Field evidence: exec.sh's guard call on macOS (Darwin 25.6.0), /bin/bash 3.2.57. Reproduced with a two-script project built from the fixture's captured
mxcliDESCRIBE output (tests/wave2/fixtures/context-pack/capture/describe): the older script is replayed over the newer owner's write. Before:checkprints nothing, rc=2 (stderr dropped as exec.sh does). After:REVERT MICROFLOW Sales.ACT_ApprovalStep_Reject mdlsource/09-reject-fix.mdl newer owner mdlsource/09-reject-fix.mdl — replaying this script reverts it, rc=1. No full app run; the evidence is the toolkit's own fixture.tests/wave2/test-restatement-guard.shunder /bin/bash 3.2.57 (16 of 58 pass on origin/master, 58 of 58 here) and, for the same file, under bash 5.2.37/5.2.21 in containers (see Verification)./bin/bashguard is skipped where it is the same bash as PATH (Linux, Git Bash).CHANGELOG.mdline appended, creditedVerification
x="$(echo hi/# O's work/echo there/)"→bash -n: "unexpected EOF while looking for matching''"; same text with "Os" parses. Second repro:x="$(case a in a) echo ok ;; esac)"→bash -npasses, running it fails with "command substitution: line 1: syntax error near unexpected tokennewline'";(a)instead ofa)works./bin/bash -n project-bin/script-owners.sh: fails on origin/master 393d253 (line 290 / 295), passes after.bash -n project-bin/script-owners.shpasses indebian:stable-slim(5.2.37),python:3.12-slim(5.2.37) andubuntu:24.04(5.2.21).bin/check-scripts.sh: "120/120 shell script(s) parse"; with the /bin/bash branch forced on over origin/master's script-owners.sh it reports "FAIL … does not parse under this bash (or /bin/bash)", with the fix 120/120./bin/bash tests/wave2/test-restatement-guard.sh <origin/master project-bin/exec.sh>→ "== 16 passed, 42 failed"; on this branch → "== 58 passed, 0 failed".ubuntu:24.04(bash 5.2.21, no java): 44 passed, 14 failed; every failure is in the "exec.sh:" sections, which need java for the gate (origin/master fails the same sections there). The parser, order, check and ledger sections, which run script-owners.sh directly, pass.bin/check-portability.shon the two changed scripts: clean.bin/check-pr-discipline.sh origin/master: clean.bin/check-no-client-data.shandLEAKGUARD_BASE=origin/master bin/check-no-client-data.sh: clean, no new capitalised words.gh pr list --state all --search script-ownersshows exec.sh: warn on stale-DESCRIBE and co-owned restatements; roll back an mxbuild crash on the written model #311 (draft), fix(exec): warn when replaying an older owning script reverts newer work (#269) #498 (merged, the guard), fix(exec): warn when a script restates from a stale DESCRIBE (#261) #503; none touches the bash 3.2 parse. Issue Restatement guard: mark the ledger on git pull/checkout of the model #504 is a different change to the ledger.