Skip to content

Detect unnoticed changes across generated webpack/Rspack configs - #4839

Merged
ihabadham merged 3 commits into
mainfrom
ihabadham/test/approve-generated-config-tree
Aug 5, 2026
Merged

Detect unnoticed changes across generated webpack/Rspack configs#4839
ihabadham merged 3 commits into
mainfrom
ihabadham/test/approve-generated-config-tree

Conversation

@ihabadham

@ihabadham ihabadham commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Fixes #4838

Why

#4790 made unexpected changes to generated serverWebpackConfig.js visible, but a React on Rails installation produces a coordinated configuration tree. The remaining generated files had focused behavior and transform coverage without one review point for additions, removals, renames, or textual drift across the final installation output.

That left coverage inconsistent within the same generated entity. It also meant Pro/RSC post-render transformations could change client, server/client orchestration, or RSC config output without appearing in the existing server-template approval.

This PR keeps the existing semantic, structural-anchor, and historical/customized transform specs. It adds exact-output coverage as another layer rather than replacing them.

Approach selected

After assessing the alternatives in #4838, this PR approves each meaningful generated configuration tree rather than maintaining a second filename registry or adding unrelated assertions file by file.

A reusable GeneratedTreeApproval helper receives an actual root and an approved root. It discovers files recursively and reports:

  • added files;
  • removed or renamed files;
  • byte-level changes with readable per-file diffs.

The helper has no knowledge of React on Rails filenames or generator variants. The generator spec owns only the option matrix and the lifecycle required to produce each tree.

Generated lifecycle covered

For each variant, the spec:

  1. runs the real BaseGenerator#copy_webpack_config path into a temporary destination;
  2. applies the production Pro config transformation for Pro/RSC variants;
  3. creates and transforms the production RSC configs for RSC variants;
  4. compares the final config/ subtree with its checked-in approval.

This exposed that the previous RSC server golden represented intermediate base-template output. The new RSC trees contain the final client-reference discovery transformation a real RSC installation receives.

Variant scope

The matrix covers ten meaningful branches without taking the Cartesian product:

Variant Purpose
webpack_base Base Webpack tree
webpack_pro Final Pro Webpack tree
webpack_rsc Final RSC Webpack tree
webpack_tailwind Independent Tailwind config branch
webpack_typescript TypeScript Webpack main entry
rspack_base Base Rspack tree and destination mapping
rspack_pro Final Pro Rspack tree
rspack_rsc Final RSC Rspack tree and plugin selection
rspack_typescript TypeScript Rspack main entry
webpack_base_shakapacker8 Shakapacker < 9 output-path branch

Tailwind and Shakapacker-version branches are each represented once because they are independent of the product/bundler combinations they do not alter. TypeScript is represented once per bundler because it changes the bundler-specific main entry.

Generated-output cleanup

Expanding byte-exact coverage exposed an existing trailing space emitted by add_documentation_reference. The helper now emits the same comment without trailing whitespace, and every approval is regenerated from that production output rather than edited manually.

Relationship to existing tests

This PR deliberately retains:

  • focused regression assertions for known requirements;
  • structural-anchor checks shared by current templates and upgrade fixtures;
  • historical/customized standalone-upgrade fixtures;
  • transform nesting and idempotency coverage.

The tree approvals answer a separate question: did any final generated configuration output change? Reviewers must then decide whether that change is intentional.

Non-goals

Validation

  • Full OSS RuboCop: 247 files inspected, no offenses detected.
  • Direct generator regeneration completed for all ten approved trees.
  • TypeScript approvals differ from their base counterparts only at webpack.config.ts / rspack.config.ts.
  • Ruby syntax checks passed for all changed Ruby files.
  • git diff --check passed.
  • Pre-commit hooks passed: Ruby autofix, RuboCop, ESLint, Prettier, Markdown links, and trailing newlines.
  • Pre-push hooks passed: branch RuboCop and online Markdown links.
  • Repeated Bloodhound review converged with no remaining meaningful findings.
  • The current head was not run through the local RSpec suite, following the repository policy for React on Rails PR work; hosted CI provides the test-suite evidence.

Changelog

No changelog entry: this adds test infrastructure and removes trailing whitespace from a generated documentation comment without changing runtime behavior.

Churn note

Most of the diff is checked-in generator output: 82 JavaScript/TypeScript approvals across ten variants. The executable test infrastructure is the generic 70-line tree helper plus the existing golden spec's lifecycle expansion.

Related

Summary by CodeRabbit

  • Bug Fixes

    • Improved generated documentation references by placing the source on a new line for cleaner formatting.
  • Tests

    • Expanded validation of complete generated configuration trees across supported setup variants, including Tailwind, TypeScript, and server-rendered configurations.
    • Added snapshot comparison and regeneration coverage for added, removed, changed, and stale generated files.
    • Added checks to ensure all approved configuration variants remain covered and accurately reported.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c5e9cfa6-13a6-4f39-98ea-16818be26e38

📥 Commits

Reviewing files that changed from the base of the PR and between b1c6116 and b4eb3bb.

⛔ Files ignored due to path filters (83)
  • react_on_rails/spec/react_on_rails/fixtures/generated/README.md is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_base/config/rspack/ServerClientOrBoth.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_base/config/rspack/clientWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_base/config/rspack/commonWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_base/config/rspack/development.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_base/config/rspack/production.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_base/config/rspack/rspack.config.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_base/config/rspack/serverWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_base/config/rspack/test.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_pro/config/rspack/ServerClientOrBoth.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_pro/config/rspack/clientWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_pro/config/rspack/commonWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_pro/config/rspack/development.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_pro/config/rspack/production.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_pro/config/rspack/rspack.config.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_pro/config/rspack/serverWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_pro/config/rspack/test.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_rsc/config/rspack/ServerClientOrBoth.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_rsc/config/rspack/clientWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_rsc/config/rspack/commonWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_rsc/config/rspack/development.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_rsc/config/rspack/production.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_rsc/config/rspack/rscWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_rsc/config/rspack/rspack.config.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_rsc/config/rspack/serverWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_rsc/config/rspack/test.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_typescript/config/rspack/ServerClientOrBoth.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_typescript/config/rspack/clientWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_typescript/config/rspack/commonWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_typescript/config/rspack/development.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_typescript/config/rspack/production.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_typescript/config/rspack/rspack.config.ts is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_typescript/config/rspack/serverWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_typescript/config/rspack/test.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base/config/webpack/ServerClientOrBoth.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base/config/webpack/clientWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base/config/webpack/commonWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base/config/webpack/development.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base/config/webpack/production.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base/config/webpack/serverWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base/config/webpack/test.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base/config/webpack/webpack.config.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base_shakapacker8/config/webpack/ServerClientOrBoth.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base_shakapacker8/config/webpack/clientWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base_shakapacker8/config/webpack/commonWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base_shakapacker8/config/webpack/development.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base_shakapacker8/config/webpack/production.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base_shakapacker8/config/webpack/serverWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base_shakapacker8/config/webpack/test.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base_shakapacker8/config/webpack/webpack.config.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_pro/config/webpack/ServerClientOrBoth.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_pro/config/webpack/clientWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_pro/config/webpack/commonWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_pro/config/webpack/development.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_pro/config/webpack/production.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_pro/config/webpack/serverWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_pro/config/webpack/test.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_pro/config/webpack/webpack.config.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_rsc/config/webpack/ServerClientOrBoth.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_rsc/config/webpack/clientWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_rsc/config/webpack/commonWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_rsc/config/webpack/development.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_rsc/config/webpack/production.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_rsc/config/webpack/rscWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_rsc/config/webpack/serverWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_rsc/config/webpack/test.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_rsc/config/webpack/webpack.config.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_tailwind/config/webpack/ServerClientOrBoth.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_tailwind/config/webpack/clientWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_tailwind/config/webpack/commonWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_tailwind/config/webpack/development.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_tailwind/config/webpack/production.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_tailwind/config/webpack/serverWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_tailwind/config/webpack/test.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_tailwind/config/webpack/webpack.config.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_typescript/config/webpack/ServerClientOrBoth.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_typescript/config/webpack/clientWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_typescript/config/webpack/commonWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_typescript/config/webpack/development.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_typescript/config/webpack/production.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_typescript/config/webpack/serverWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_typescript/config/webpack/test.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_typescript/config/webpack/webpack.config.ts is excluded by !**/generated/**
📒 Files selected for processing (4)
  • react_on_rails/lib/generators/react_on_rails/generator_helper.rb
  • react_on_rails/spec/react_on_rails/generated_tree_approval_spec.rb
  • react_on_rails/spec/react_on_rails/generators/generator_golden_output_spec.rb
  • react_on_rails/spec/react_on_rails/support/generated_tree_approval.rb
🚧 Files skipped from review as they are similar to previous changes (4)
  • react_on_rails/lib/generators/react_on_rails/generator_helper.rb
  • react_on_rails/spec/react_on_rails/generated_tree_approval_spec.rb
  • react_on_rails/spec/react_on_rails/generators/generator_golden_output_spec.rb
  • react_on_rails/spec/react_on_rails/support/generated_tree_approval.rb

Walkthrough

The PR adds generated-tree approval utilities and expands generator golden-output coverage from one file to complete configuration trees across Base, Pro, RSC, and Tailwind variants. It also removes an extra space from documentation references.

Changes

Documentation reference formatting

Layer / File(s) Summary
Documentation reference formatting
react_on_rails/lib/generators/react_on_rails/generator_helper.rb
add_documentation_reference now joins the message and source with a newline without a trailing space.

Generated configuration tree coverage

Layer / File(s) Summary
Generated tree comparison utility
react_on_rails/spec/react_on_rails/support/generated_tree_approval.rb, react_on_rails/spec/react_on_rails/generated_tree_approval_spec.rb
GeneratedTreeApproval compares added, removed, and changed files, reports mismatches, snapshots binary file contents, regenerates approved trees, and has isolated temporary-directory coverage.
Complete generator golden-output coverage
react_on_rails/spec/react_on_rails/generators/generator_golden_output_spec.rb
The spec generates complete configuration trees for Base, Pro, RSC, and Tailwind variants, supports TypeScript setup, compares approved directories, and detects orphaned variants.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Sequence Diagram(s)

sequenceDiagram
  participant GeneratorGoldenOutput
  participant BaseProRscGenerator
  participant GeneratedTreeApproval
  participant ApprovedConfigTree
  GeneratorGoldenOutput->>BaseProRscGenerator: Generate and transform configuration
  BaseProRscGenerator-->>GeneratorGoldenOutput: Return complete configuration tree
  GeneratorGoldenOutput->>GeneratedTreeApproval: Compare actual and approved trees
  GeneratedTreeApproval->>ApprovedConfigTree: Read approved files
  GeneratedTreeApproval-->>GeneratorGoldenOutput: Return tree differences
Loading

Suggested labels: full-ci

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive The implementation matches issue #4838, but approved generated trees are excluded by the !/generated/ path filter and cannot be verified. Review the excluded generated fixture trees to confirm byte-faithful approvals for all required Webpack and Rspack variants.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: detecting unnoticed changes in generated Webpack and Rspack configuration files.
Out of Scope Changes check ✅ Passed All reviewed changes support issue #4838, including tree approval utilities, expanded golden coverage, and the related whitespace fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ihabadham/test/approve-generated-config-tree

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.

❤️ Share

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

@greptile-apps

greptile-apps Bot commented Aug 2, 2026

Copy link
Copy Markdown

Greptile Summary

This PR expands generator golden-output coverage from individual server configuration files to complete Webpack and Rspack configuration trees across eight representative variants.

  • Adds a reusable recursive tree approval and regeneration helper.
  • Exercises the base, Pro, RSC, Tailwind, Rspack, and Shakapacker-version branches.
  • Checks in the resulting approved configuration trees.
  • Removes trailing whitespace from generated documentation-reference comments.

Confidence Score: 5/5

The PR appears safe to merge; no actionable correctness, security, or test-coverage defect remains in the changed paths.

The approval helper compares complete generated file sets and byte contents deterministically, while the expanded spec follows the production base-to-Pro-to-RSC transformation order for each represented configuration variant.

Important Files Changed

Filename Overview
react_on_rails/spec/react_on_rails/support/generated_tree_approval.rb Adds deterministic recursive byte-level tree comparison, readable mismatch reporting, and approval regeneration.
react_on_rails/spec/react_on_rails/generators/generator_golden_output_spec.rb Expands golden testing to eight complete generated bundler-config variants while retaining existing structural and transform checks.
react_on_rails/lib/generators/react_on_rails/generator_helper.rb Removes an unintended trailing space from generated documentation-reference comments.
react_on_rails/spec/react_on_rails/fixtures/generated/README.md Documents the complete-tree approval scope, variant matrix, regeneration workflow, and formatting constraints.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  V["Variant matrix"] --> B["BaseGenerator.copy_webpack_config"]
  B --> P{"Pro or RSC?"}
  P -->|Yes| PT["Apply Pro config transforms"]
  P -->|No| R{"RSC?"}
  PT --> R
  R -->|Yes| RT["Create and transform RSC configs"]
  R -->|No| C["Snapshot generated config tree"]
  RT --> C
  C --> A["Compare with checked-in approved tree"]
  A --> D["Report added, removed, and changed files"]
Loading

Reviews (1): Last reviewed commit: "Approve complete generated config trees" | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
react_on_rails/spec/react_on_rails/generators/generator_golden_output_spec.rb (1)

405-418: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use a named RSpec subject for the tree comparison.

The per-variant it blocks (lines 405-418) call GeneratedTreeApproval.compare and assert on the result inline, without a named subject. Define the comparison as a named subject instead.

♻️ Proposed refactor using a named subject
     GeneratorGoldenOutput::VARIANTS.each do |variant|
       it "matches the approved tree for the #{variant[:name]} variant" do
-        GeneratorGoldenOutput.generate(variant) do |actual_root|
-          comparison = GeneratedTreeApproval.compare(
-            actual_root,
-            GeneratorGoldenOutput.approved_root(variant)
-          )
-
-          expect(comparison.match?).to be(true),
-                                       -> { GeneratorGoldenOutput.mismatch_message(variant, comparison) }
-        end
+        GeneratorGoldenOutput.generate(variant) do |actual_root|
+          comparison_result = GeneratedTreeApproval.compare(
+            actual_root,
+            GeneratorGoldenOutput.approved_root(variant)
+          )
+
+          expect(comparison_result.match?).to be(true),
+                                              -> { GeneratorGoldenOutput.mismatch_message(variant, comparison_result) }
+        end
       end
     end

Based on coding guidelines "use named RSpec subjects such as subject(:method_result)".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@react_on_rails/spec/react_on_rails/generators/generator_golden_output_spec.rb`
around lines 405 - 418, In the generated configuration trees spec, define a
named RSpec subject for the result of GeneratedTreeApproval.compare using the
current actual and approved roots, then update the expectation to assert against
that subject while preserving the existing mismatch message and per-variant
behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@react_on_rails/spec/react_on_rails/generators/generator_golden_output_spec.rb`:
- Around line 405-418: In the generated configuration trees spec, define a named
RSpec subject for the result of GeneratedTreeApproval.compare using the current
actual and approved roots, then update the expectation to assert against that
subject while preserving the existing mismatch message and per-variant behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: de2bccfa-0065-48c1-ba7b-1b7671d5e216

📥 Commits

Reviewing files that changed from the base of the PR and between 8d08075 and 20a3677.

⛔ Files ignored due to path filters (67)
  • react_on_rails/spec/react_on_rails/fixtures/generated/README.md is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_base/config/rspack/ServerClientOrBoth.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_base/config/rspack/clientWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_base/config/rspack/commonWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_base/config/rspack/development.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_base/config/rspack/production.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_base/config/rspack/rspack.config.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_base/config/rspack/serverWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_base/config/rspack/test.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_pro/config/rspack/ServerClientOrBoth.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_pro/config/rspack/clientWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_pro/config/rspack/commonWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_pro/config/rspack/development.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_pro/config/rspack/production.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_pro/config/rspack/rspack.config.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_pro/config/rspack/serverWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_pro/config/rspack/test.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_rsc/config/rspack/ServerClientOrBoth.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_rsc/config/rspack/clientWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_rsc/config/rspack/commonWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_rsc/config/rspack/development.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_rsc/config/rspack/production.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_rsc/config/rspack/rscWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_rsc/config/rspack/rspack.config.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_rsc/config/rspack/serverWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/rspack_rsc/config/rspack/test.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base/config/webpack/ServerClientOrBoth.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base/config/webpack/clientWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base/config/webpack/commonWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base/config/webpack/development.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base/config/webpack/production.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base/config/webpack/serverWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base/config/webpack/test.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base/config/webpack/webpack.config.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base_shakapacker8/config/webpack/ServerClientOrBoth.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base_shakapacker8/config/webpack/clientWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base_shakapacker8/config/webpack/commonWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base_shakapacker8/config/webpack/development.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base_shakapacker8/config/webpack/production.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base_shakapacker8/config/webpack/serverWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base_shakapacker8/config/webpack/test.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_base_shakapacker8/config/webpack/webpack.config.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_pro/config/webpack/ServerClientOrBoth.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_pro/config/webpack/clientWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_pro/config/webpack/commonWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_pro/config/webpack/development.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_pro/config/webpack/production.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_pro/config/webpack/serverWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_pro/config/webpack/test.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_pro/config/webpack/webpack.config.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_rsc/config/webpack/ServerClientOrBoth.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_rsc/config/webpack/clientWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_rsc/config/webpack/commonWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_rsc/config/webpack/development.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_rsc/config/webpack/production.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_rsc/config/webpack/rscWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_rsc/config/webpack/serverWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_rsc/config/webpack/test.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_rsc/config/webpack/webpack.config.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_tailwind/config/webpack/ServerClientOrBoth.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_tailwind/config/webpack/clientWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_tailwind/config/webpack/commonWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_tailwind/config/webpack/development.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_tailwind/config/webpack/production.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_tailwind/config/webpack/serverWebpackConfig.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_tailwind/config/webpack/test.js is excluded by !**/generated/**
  • react_on_rails/spec/react_on_rails/fixtures/generated/webpack_tailwind/config/webpack/webpack.config.js is excluded by !**/generated/**
📒 Files selected for processing (3)
  • react_on_rails/lib/generators/react_on_rails/generator_helper.rb
  • react_on_rails/spec/react_on_rails/generators/generator_golden_output_spec.rb
  • react_on_rails/spec/react_on_rails/support/generated_tree_approval.rb

@ihabadham ihabadham changed the title Test: approve complete generated config trees Detect unnoticed changes across generated webpack/Rspack configs Aug 2, 2026
@claude

claude Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Review summary

This PR adds a generic GeneratedTreeApproval helper (spec/react_on_rails/support/generated_tree_approval.rb) and wires it into generator_golden_output_spec.rb to snapshot the entire generated config/webpack/config/rspack tree per variant, rather than a single serverWebpackConfig.js file. Most of the diff (66 of 70 files) is checked-in generated fixture output.

What I checked

  • generated_tree_approval.rb (new, ~70 lines): snapshot reads every file under a root into a path => bytes hash via File.binread; Comparison diffs two snapshots into added/removed/changed sets. Straightforward, no bugs found.
  • generator_golden_output_spec.rb: the generate lifecycle now runs BaseGenerator#copy_webpack_config, then (for pro/rsc variants) instantiates ProGenerator/RscGenerator and calls their private update_webpack_config_for_pro / create_rsc_webpack_config / update_webpack_configs_for_rsc transforms via __send__ against the same temp destination — mirroring the __send__-based pattern already used elsewhere in base_generator.rb.
    • I verified this two-phase approach is not redundant: install_generator.rb genuinely invokes the standalone react_on_rails:pro/react_on_rails:rsc generators after the base template render even during a fresh --pro/--rsc install (see install_generator.rb:323-332), so simulating both phases here accurately reflects production behavior rather than conflating an "upgrade" path with a "fresh install" path. This also explains why the new webpack_rsc/rspack_rsc server-config goldens are substantially larger than before — the old golden only captured the base-template's simple rscClientReferences object and missed the final client-reference-discovery IIFE that update_webpack_configs_for_rsc adds, which the PR description calls out explicitly.
    • Confirmed using_rspack? is correctly stubbed via a singleton method on every generator instance created through the new generator_for helper (Base, Pro, Rsc), so bundler-directory resolution stays deterministic across all three phases.
    • Confirmed old references to the removed golden_path/relative_path/GENERATED_FILE API are fully cleaned up — no dangling call sites left in the spec file.
  • generator_helper.rb: trivial trailing-space fix in add_documentation_reference ("#{message} \n#{source}""#{message}\n#{source}"). Confirmed no other spec asserts on the old trailing-space form, so this is safe.
  • README.md: accurately describes the new layout; the **/*generated* prettier-ignore and **/generated/ eslint-ignore patterns it references do exist in .prettierignore/eslint config.
  • Spot-checked several of the regenerated fixture files (webpack_rsc, rspack_rsc) against the templates/transform source — content is consistent with what the described production code path would emit.

Minor (non-blocking)

  • Left one inline nit on generated_tree_approval.rb about FNM_DOTMATCH picking up stray dotfiles as spurious "added" entries — very unlikely in practice since the generator never writes dotfiles into config/.
  • The README's variant table has some inconsistent column padding (cosmetic only, renders fine as markdown).

Not verified

  • I wasn't able to execute bundle exec rspec in this sandboxed session, so I relied on static review rather than confirming the suite is green. The PR description states 35 examples, 0 failures and a full RuboCop/ESLint/Prettier pass, which I have no reason to doubt given the diff is internally consistent.

Overall this is a well-scoped, well-documented test-infrastructure change with no functional/runtime risk (the one production code change is a whitespace fix). No blocking issues found.

@ihabadham

Copy link
Copy Markdown
Collaborator Author

+ci-status

@ihabadham

Copy link
Copy Markdown
Collaborator Author

+ci-run-hosted

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

CI Status

Head SHA: 20a3677f28ef
Changed files: 70
Docs-only heuristic (matches ci-changes-detector metadata paths): no
ready-for-hosted-ci label: absent
force-full-hosted-ci label: absent
Current hosted-CI waiver: not present for this SHA
Automatic release-target hosted mode: inactive
Observed exact-head coverage: modes[missing=9]; successful=0, pending=0, failed=0, missing=9

Only the required gate is active unless hosted CI is requested.

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Hosted CI Requested

Triggered 9 workflow(s) for 20a3677f28ef.
Skipped 0 workflow(s) with equivalent exact-head coverage.
Mode: optimized hosted CI (path-selected by script/ci-changes-detector).
Added ready-for-hosted-ci, so future commits will keep running optimized hosted CI until +ci-stop-hosted is used.

View progress in the Actions tab.

@github-actions github-actions Bot added the ready-for-hosted-ci Run optimized hosted GitHub CI for this PR label Aug 2, 2026
@ihabadham

ihabadham commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator Author

No description provided.

@ihabadham

Copy link
Copy Markdown
Collaborator Author

Review follow-up: I’m skipping the suggestion to use a named RSpec subject. comparison is a local value created inside each variant’s generator callback, not an unnamed RSpec subject, and the proposed change only renames that local variable. Extracting it into subject would complicate the callback-scoped lifecycle without improving the assertion.

@ihabadham

ihabadham commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator Author

No description provided.

@claude

claude Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Review: Detect unnoticed changes across generated webpack/Rspack configs

Reviewed the PR diff (gh pr diff 4839), focusing on the actual executable code — generated_tree_approval.rb, generator_golden_output_spec.rb, generated_tree_approval_spec.rb, and the one-line fix in generator_helper.rb. The remaining ~4,000 lines are checked-in generated fixture output, which I spot-checked but did not deep-review line by line (it's a faithful record of existing template/transform output, not new logic).

Overview

Adds a GeneratedTreeApproval helper (support/generated_tree_approval.rb) that snapshots a directory tree (byte-exact, via File.binread) and diffs it against an approved tree, reporting added/removed/changed files. generator_golden_output_spec.rb is extended to run the real generator lifecycle (copy_webpack_config → Pro transform → RSC transform) for 10 variants and compare the resulting config/ tree against checked-in approvals, replacing the previous single-file (serverWebpackConfig.js-only) golden comparison. Also fixes a trailing-whitespace bug in add_documentation_reference.

Strengths

  • GeneratedTreeApproval is small, generic, and well-tested (generated_tree_approval_spec.rb covers added/removed/changed files, including dotfiles via FNM_DOTMATCH, and the regenerate-replaces-stale-files case).
  • The lifecycle simulation in GeneratorGoldenOutput.generate is careful about a real footgun: bundler_main_config_path (base_generator.rb) does File.exist?("config/rspack/rspack.config.ts") with a relative path, so the spec correctly wraps only copy_webpack_config in Dir.chdir(destination) to stop the repo checkout's own files from leaking into the check. I verified apply_pro_config/apply_rsc_config (called outside that Dir.chdir) exclusively use destination_root-joined absolute paths internally, so this is safe — but it's a subtle invariant that isn't documented. A future contributor adding a new __send__'d transform to apply_pro_config/apply_rsc_config that happens to use a relative File.exist? check would silently reintroduce the bug this Dir.chdir works around. A one-line comment noting "these must not use relative File checks" would make that invariant self-enforcing.
  • seed_typescript_main_config's synthetic .ts content was verified to match shakapacker_esm_default_configs exactly (the no-type-annotation ESM variant), so it genuinely exercises the "auto-upgrade standard Shakapacker config" branch in copy_webpack_main_config rather than accidentally falling into the "already customized" path.
  • The add_documentation_reference trailing-space fix is real and now transitively pinned by the byte-exact tree comparison (every regenerated fixture containing that comment reflects the fix).

Minor / non-blocking

  • No dedicated unit spec exercises add_documentation_reference directly — coverage is only transitive, via the byte-exact fixtures. Not a problem given the approval spec would catch any regression, but a one-line spec would make the intent explicit.
  • README.md's new comparison table has uneven column padding (cosmetic; markdown renders it fine either way).
  • I wasn't able to run RuboCop/RSpec locally in this environment (command execution was restricted), so I relied on static review — the PR description's own validation notes (RuboCop clean, syntax checks, hooks) cover that ground.

Verdict

No correctness, security, or performance issues found in the test infrastructure itself. The design (generic tree-diff helper + variant matrix run through the real generator lifecycle) is a solid improvement over the single-file golden test, and the reasoning in the PR description for scope decisions (non-goals, variant selection) is sound and matches what's implemented.

@ihabadham

ihabadham commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

No description provided.

@ihabadham
ihabadham force-pushed the ihabadham/test/approve-generated-config-tree branch from b1c6116 to b4eb3bb Compare August 4, 2026 18:42
@ihabadham

Copy link
Copy Markdown
Collaborator Author

+ci-status

@ihabadham

Copy link
Copy Markdown
Collaborator Author

+ci-run-hosted

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

CI Status

Head SHA: b4eb3bb99213
Changed files: 87
Docs-only heuristic (matches ci-changes-detector metadata paths): no
ready-for-hosted-ci label: present
force-full-hosted-ci label: absent
Current hosted-CI waiver: not present for this SHA
Automatic release-target hosted mode: inactive
Observed exact-head coverage: modes[missing=9]; successful=0, pending=0, failed=0, missing=9

Optimized hosted CI is enabled for this PR.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Hosted CI Requested

Triggered 9 workflow(s) for b4eb3bb99213.
Skipped 0 workflow(s) with equivalent exact-head coverage.
Mode: optimized hosted CI (path-selected by script/ci-changes-detector).
Added ready-for-hosted-ci, so future commits will keep running optimized hosted CI until +ci-stop-hosted is used.

View progress in the Actions tab.

@claude

claude Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review: Detect unnoticed changes across generated webpack/Rspack configs

Overview

This PR generalizes the existing single-file golden-output spec (serverWebpackConfig.js only) into a full tree approval system that pins the entire generated config/webpack or config/rspack output for 10 generator variants. The core addition is a small, reusable GeneratedTreeApproval module (react_on_rails/spec/react_on_rails/support/generated_tree_approval.rb) that diffs an actual output tree against a checked-in approved tree, reporting added/removed/changed files with readable diffs. The bulk of the diff (82 files) is regenerated fixture content plus a one-line whitespace fix in add_documentation_reference.

Code quality

  • GeneratedTreeApproval is well-factored: it has zero knowledge of React on Rails filenames/generators, taking only actual_root/approved_root paths. That keeps the helper reusable and easy to reason about independently of the generator spec.
  • The helper ships its own unit spec (generated_tree_approval_spec.rb) covering added/removed/changed detection and the regenerate (replace, not merge) semantics — good practice for test infrastructure that other specs depend on.
  • GeneratorGoldenOutput#generate now wraps the lifecycle (copy_webpack_config → Pro transform → RSC transform) and adds ensure GeneratorMessages.clear, preventing state leakage between variant runs — a nice correctness improvement over the previous version.
  • Running copy_webpack_config via Dir.chdir(destination) { ... } with a comment explaining it prevents File.exist? checks from picking up files in the repo checkout — a subtle, well-documented fix.
  • I verified several of the PR's factual claims directly against the checked-in fixtures:
    • webpack_typescript/rspack_typescript differ from their base counterparts only in webpack.config.ts/rspack.config.ts (confirmed via diff -rq).
    • webpack_tailwind differs from webpack_base only in commonWebpackConfig.js (confirmed).
    • The trailing-whitespace fix in add_documentation_reference is applied consistently across all regenerated fixtures (no stray trailing spaces remain).
  • No leftover references to the removed helper methods (relative_path, golden_path, differ, missing_golden_message) — the refactor is internally consistent.

Potential concerns (low severity / worth a second look, not blocking)

  • GeneratedTreeApproval.snapshot uses Dir.glob(File.join(root, "**", "*"), File::FNM_DOTMATCH). This flag combination is a known Ruby footgun where dotfile matching can behave unexpectedly around ./.. in some Ruby versions. It's very likely fine here since results are filtered through File.file? (directories including ./.. are dropped), and the intent — catching dotfiles like .generated-metadata — is explicitly tested. Still, worth a quick sanity check on the Ruby version(s) this runs under in CI, since a wide surprise match would only show up as slow/odd test behavior rather than a loud failure.
  • The README variant table's Markdown column widths are slightly inconsistent between rows (cosmetic only, renders fine).
  • As called out in the PR description itself, this doesn't resolve Generated serverWebpackConfig.js imports 'merge' from shakapacker but never uses it #4791's unused merge import or make historical upgrade fixtures byte-identical — both explicitly scoped out, which is reasonable given the PR's stated goal.

Security / performance

  • No security implications — this is test-only infrastructure and a whitespace fix to generated documentation output.
  • Performance impact is limited to test suite runtime (reading/hashing small generated JS/TS trees across 10 variants); not a concern for production code paths.

Test coverage

  • Strong: the new tree-approval mechanism is itself unit-tested, and the expanded variant matrix (adding webpack_tailwind, webpack_typescript, rspack_typescript) closes real gaps where Pro/RSC post-render transforms could previously drift without any spec catching it.

Overall this is a solid, well-scoped test-infrastructure PR with good internal consistency between its stated claims and the actual diff.

@ihabadham

Copy link
Copy Markdown
Collaborator Author

Final refresh against current main:

  • rebased onto 9780839f1;
  • regenerated the three variants introduced here that were not available when Fix generated server config lint cleanup #4840 updated the earlier approvals;
  • confirmed those server approvals now match the corresponding current-main base output;
  • full OSS RuboCop passed (247 files inspected, no offenses detected);
  • pre-commit and pre-push hooks passed;
  • optimized hosted CI passed on exact head b4eb3bb99, including all three generator RSpec partitions and the generator examples workflow;
  • current-head Claude review found no blocking issue;
  • all review threads are resolved;
  • strict merge ledger reports complete_allowed: true.

No local test suite was run, following the global React on Rails PR rule; test evidence is from hosted CI.

@ihabadham
ihabadham added this pull request to the merge queue Aug 5, 2026
Merged via the queue into main with commit 9d2f878 Aug 5, 2026
81 checks passed
@ihabadham
ihabadham deleted the ihabadham/test/approve-generated-config-tree branch August 5, 2026 14:26
justin808 added a commit that referenced this pull request Aug 6, 2026
…out-vm-pool

* origin/main:
  Docs: move agent coordination to the HTTP backend (#4764)
  Detect unnoticed changes across generated webpack/Rspack configs (#4839)
  Fix durable ShakaPerf release evidence reuse (#4833)
  Docs: add missing content — release notes, upgrade guide, config, API references (#4843) (#4844)
  Fix incorrect docs: helper names, defaults, requirements, runtime refs (#4836)
  Scroll-priority streaming: candidate architecture evaluation (#4835) (#4841)
  Fix generated server config lint cleanup (#4840)
  Document serialized release backport policy (#4592)
  Package version-matched agent skills and docs (#4809)
  Fix ci-required base ref for PR merge-ref checkouts (#4819)
  Honor response charset and reject non-2xx HTTP-served SSR bundles (#4817)
  [Pro] Redact RSC render-error metadata on the fetched (client-navigation) payload path (#4821)
  Forward-port the 17.0.1 changelog section to main (#4814)

# Conflicts:
#	CHANGELOG.md
justin808 added a commit that referenced this pull request Aug 8, 2026
…ential-broker

* origin/main: (75 commits)
  Silence routine startup diagnostics for Rails commands (#4849)
  Docs: move agent coordination to the HTTP backend (#4764)
  Detect unnoticed changes across generated webpack/Rspack configs (#4839)
  Fix durable ShakaPerf release evidence reuse (#4833)
  Docs: add missing content — release notes, upgrade guide, config, API references (#4843) (#4844)
  Fix incorrect docs: helper names, defaults, requirements, runtime refs (#4836)
  Scroll-priority streaming: candidate architecture evaluation (#4835) (#4841)
  Fix generated server config lint cleanup (#4840)
  Document serialized release backport policy (#4592)
  Package version-matched agent skills and docs (#4809)
  Fix ci-required base ref for PR merge-ref checkouts (#4819)
  Honor response charset and reject non-2xx HTTP-served SSR bundles (#4817)
  [Pro] Redact RSC render-error metadata on the fetched (client-navigation) payload path (#4821)
  Forward-port the 17.0.1 changelog section to main (#4814)
  Handle selector metacharacters in renderComponent DOM IDs (#4808)
  [Pro] Prevent caching RSC renders with errors (#4804)
  Agents: trust Copilot review identities (#4807)
  Agents: bind fleet closeout to generated pack (#4805)
  Docs: ADR 0002 — Skills-in-package over MCP for agent-native DX (#4735)
  Scope GitHub release commands to the origin repository (#4803)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-hosted-ci Run optimized hosted GitHub CI for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generator: changes to generated webpack/Rspack configs can go unnoticed

1 participant