Skip to content

fix(tests): terminate find -exec and pass {} — the placeholder step was a no-op - #63

Merged
hyperpolymath merged 5 commits into
mainfrom
fix/find-exec-terminator
Sep 12, 2026
Merged

hyperpolymath merged 5 commits into
mainfrom
fix/find-exec-terminator

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

tests/e2e/template_instantiation_test.sh ran find … -exec bash -c '…' _ "\$file", which has two defects on one line:

  1. No ; or + terminator — the file does not parse (SC2067).
  2. "\$file" where {} belongs — \$file is assigned only inside the -exec body, so in the outer scope it is unset. \$1 arrived empty, file="", and every grep/sed operated on an empty path.

⚠ The consequence is worse than a lint error. The placeholder-replacement step silently did nothing, then logged "All placeholder tokens replaced". A test whose entire purpose is to prove instantiation worked was passing without replacing a single token — a plausible cause of estate repos shipping with literal {{project}} still in their sources.

Corrected to ' _ {} \; so find passes each matched path.

Found by an estate-wide sweep of 5,111 scripts across 375 repos: this identical stale copy exists in 30 repositories. rsr-template-repo's own copy is already correct and restructured (371 lines vs the 268 here), so these are stale duplicates that never picked up the upstream fix.

…as a no-op

tests/e2e/template_instantiation_test.sh ran:

    find ... -exec bash -c '
        file="$1"
        ... grep/sed over $file ...
    ' _ "$file"

Two defects in that one line:

  1. No ';' or '+' terminator, so the file does not parse (SC2067).
  2. "$file" is passed where {} belongs. $file is assigned ONLY inside the
     -exec body, so in the outer scope it is UNSET — $1 arrived empty, file=""
     and every grep/sed operated on an empty path.

⚠ The consequence is worse than a lint error: the placeholder-replacement step
SILENTLY DID NOTHING, then logged "All placeholder tokens replaced". A test
whose whole purpose is to prove instantiation worked was passing without
replacing a single token. That is a plausible cause of estate repos shipping
with literal {{project}} tokens still in their sources.

Corrected to "' _ {} \;" so find passes each matched path.

Found by an estate-wide shellcheck sweep of 5,111 scripts across 375 repos:
this identical stale copy exists in 30 repositories. rsr-template-repo's own
copy is already correct and restructured (371 lines vs the 268 here), so these
are stale duplicates that never picked up the upstream fix.
@coderabbitai

coderabbitai Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Free

Run ID: c0e6e880-336f-4387-ab7f-ce70f311139e

📥 Commits

Reviewing files that changed from the base of the PR and between a914747 and 6130397.

📒 Files selected for processing (1)
  • tests/e2e/template_instantiation_test.sh

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Tests
    • Improved end-to-end coverage for template instantiation workflows.
    • Updated test processing to ensure replacement values are applied consistently across generated files.
    • Corrected file handling in the test pipeline, improving reliability when validating template-based project creation.

Walkthrough

The end-to-end template test now exports replacement variables for the child shell and passes each matched file through find -exec.

Changes

Template instantiation test

Layer / File(s) Summary
Shell processing inputs
tests/e2e/template_instantiation_test.sh
The test exports placeholder replacement variables and passes each matched path with {} to find -exec.

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


Note

🎁 Summarized by CodeRabbit Free

The PR author is not assigned a seat. If you are a newly provisioned user and your organization has automatic seat assignment enabled, open a new pull request to trigger seat assignment. Otherwise, ask an organization administrator to assign a seat through the team management page at https://app.coderabbit.ai/settings/team-management.

A rabbit checks each shell-bound string
Variables travel on exported wing
Each matched file follows the brace
The template test completes its race
Clean paths now hop into place

Comment @coderabbitai help to get the list of available commands.

@gitar-bot

This comment has been minimized.

@hyperpolymath
hyperpolymath enabled auto-merge (squash) August 28, 2026 07:47
@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath merged commit 1d345ea into main Sep 12, 2026
5 of 35 checks passed
@hyperpolymath
hyperpolymath deleted the fix/find-exec-terminator branch September 12, 2026 17:27
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