Skip to content

test(flags): pin the Bash scope fold with the #720 review's rows - #738

Open
jflowers wants to merge 1 commit into
redhat-et:mainfrom
jflowers:test/bash-scope-rows
Open

jflowers wants to merge 1 commit into
redhat-et:mainfrom
jflowers:test/bash-scope-rows

Conversation

@jflowers

@jflowers jflowers commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #720. The review asked for five fixture rows that scope.sh didn't cover, and they didn't make it in before the merge. This adds them to test/bashenvfix/scope.sh and section 14 of test/bashenvcheck.sh. Test only, no code change, so no changelog fragment.

Row Shape Expected
SC_BG local X=1 & X=2 absent (the & makes the local a child shell)
SC_GLOB2 local X; declare -g X=1; X=local absent (the global is 1 after the call)
SC_GRP { local X; }; X=2 required (a group is not a child shell)
SC_OUTER local X; ( local X ); X=2 required
SC_DECL local X; declare X=1 required

Each expectation was checked against bash 5.3.

SC_OUTER is the one that matters most. I switched the fold in shellNarrowBoundWrites to "latest local wins" (bindEnd = std::min( Pos{…}, functionEnd )), and SC_OUTER was the only row in the gate that went red. Every other scope row, sc_twice included, still passed. Without it the std::max has no test.

Verified on 6c018f6 (plain dev build): bashenvcheck ALL PASS, manifestcheck PASS.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Updated shell environment checks to verify that additional variables are absent where expected and that required variables can be read. This expands coverage of variable visibility and read behavior in the scope fixtures.

…rows

Five rows redhat-et#720's scope.sh did not cover, each checked against bash 5.3:
SC_BG (`local X &`) and SC_GLOB2 (a write after `declare -g`) absent;
SC_GRP (a { } group's local), SC_DECL (plain declare after local) and
SC_OUTER (`local X; ( local X ); X=2`) stay requirements.

SC_OUTER is the only row that pins the std::max in shellNarrowBoundWrites:
with the fold switched to "latest local wins" it is the one gate row that
goes red, every other scope row still passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review.

Walkthrough

The scope fixture documentation and checks now include additional required-read and absent-name expectations.

Changes: Scope fixture checks

Layer / File(s) Summary
Update scope expectations
test/bashenvcheck.sh
The absent-name checks add SC_BG and SC_GLOB2. The required-read checks add SC_GRP, SC_OUTER, and SC_DECL.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Suggested reviewers: joyful-ii-v-i

Merge Risk: Minimal · up to c7054 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "test(flags): pin the Bash scope fold with the #720 review's rows" is specific and matches the changeset. The raw summary and objectives show the PR adds scope expectations to test/bashenvch…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "test(flags): pin the Bash scope fold with the #720 review's rows" is specific and matches the changeset. The raw summary and objectives show the PR adds scope expectations to test/bashenvcheck.sh: SC_BG and SC_GLOB2 must be absent, and SC_GRP, SC_OUTER, and SC_DECL must be required. The PR is test-only and follows up on #720 review feedback. The title's wording ("pin the Bash scope fold") is somewhat jargon-heavy, but it names the real aspect of the change and the test-only nature. The title is concise and conveys the primary change to a teammate scanning history.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 6c018f6 and c70545e.

Files ignored due to path filters: 1

  • test/bashenvfix/scope.sh is excluded by !test/*fix/**
Files selected for processing: 1

  • test/bashenvcheck.sh

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant