From c6d2bd9ade19b2e12a795901224379dcef209920 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Sun, 16 Nov 2025 13:46:13 -0600 Subject: [PATCH 01/14] fix all pro rubocop errors --- .../react_on_rails_pro/license_public_key.rb | 18 +++--- .../lib/react_on_rails_pro/request.rb | 55 +++++++++++-------- .../lib/react_on_rails_pro/stream_request.rb | 10 ++-- .../rakelib/public_key_management.rake | 11 ++-- .../dummy/app/controllers/pages_controller.rb | 6 +- .../dummy/spec/system/integration_spec.rb | 6 +- .../react_on_rails_pro/configuration_spec.rb | 8 ++- .../license_validator_spec.rb | 39 +++++++++---- .../stream_decorator_spec.rb | 14 ++--- .../support/mock_block_helper.rb | 2 +- 10 files changed, 98 insertions(+), 71 deletions(-) diff --git a/react_on_rails_pro/lib/react_on_rails_pro/license_public_key.rb b/react_on_rails_pro/lib/react_on_rails_pro/license_public_key.rb index 9d7a3e2206..fac30d9d27 100644 --- a/react_on_rails_pro/lib/react_on_rails_pro/license_public_key.rb +++ b/react_on_rails_pro/lib/react_on_rails_pro/license_public_key.rb @@ -16,15 +16,15 @@ module LicensePublicKey # TODO: Add a prepublish check to ensure this key matches the latest public key from the API. # This should be implemented after publishing the API endpoint on the ShakaCode website. KEY = OpenSSL::PKey::RSA.new(<<~PEM.strip.strip_heredoc) - -----BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzcS/fpHz5CbnTQxb4Zot -khjzXu7xNS+Y9VKfapMaHOMzNoCMfy1++hxHJatRedr+YQfZRCjfiN168Cpe+dhe -yfNtOoLU9/+/5jTsxH+WQJWNRswyKms5HNajlIMN1GEYdZmZbvOPaZvh6ENsT+EV -HnhjJtsHl7qltBoL0ul7rONxaNHCzJcKk4lf3B2/1j1wpA91MKz4bbQVh4/6Th0E -/39f0PWvvBXzQS+yt1qaa1DIX5YL6Aug5uEpb1+6QWcN3hCzqSPBv1HahrG50rsD -gf8KORV3X2N9t6j6iqPmRqfRcTBKtmPhM9bORtKiSwBK8LsIUzp2/UUmkdHnkyzu -NQIDAQAB ------END PUBLIC KEY----- + -----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzcS/fpHz5CbnTQxb4Zot + khjzXu7xNS+Y9VKfapMaHOMzNoCMfy1++hxHJatRedr+YQfZRCjfiN168Cpe+dhe + yfNtOoLU9/+/5jTsxH+WQJWNRswyKms5HNajlIMN1GEYdZmZbvOPaZvh6ENsT+EV + HnhjJtsHl7qltBoL0ul7rONxaNHCzJcKk4lf3B2/1j1wpA91MKz4bbQVh4/6Th0E + /39f0PWvvBXzQS+yt1qaa1DIX5YL6Aug5uEpb1+6QWcN3hCzqSPBv1HahrG50rsD + gf8KORV3X2N9t6j6iqPmRqfRcTBKtmPhM9bORtKiSwBK8LsIUzp2/UUmkdHnkyzu + NQIDAQAB + -----END PUBLIC KEY----- PEM end end diff --git a/react_on_rails_pro/lib/react_on_rails_pro/request.rb b/react_on_rails_pro/lib/react_on_rails_pro/request.rb index cfe2c7ed53..e4b6a70d56 100644 --- a/react_on_rails_pro/lib/react_on_rails_pro/request.rb +++ b/react_on_rails_pro/lib/react_on_rails_pro/request.rb @@ -217,7 +217,7 @@ def common_form_data ReactOnRailsPro::Utils.common_form_data end - def create_connection + def create_connection # rubocop:disable Metrics/MethodLength, Metrics/AbcSize url = ReactOnRailsPro.configuration.renderer_url Rails.logger.info do "[ReactOnRailsPro] Setting up Node Renderer connection to #{url}" @@ -229,28 +229,37 @@ def create_connection # https://honeyryderchuck.gitlab.io/httpx/wiki/Persistent .plugin( :retries, max_retries: 1, - retry_change_requests: true, - # Official HTTPx docs says that we should use the retry_on option to decide if teh request should be retried or not - # However, HTTPx assumes that connection errors such as timeout error should be retried by default and it doesn't consider retry_on block at all at that case - # So, we have to do the following trick to avoid retries when a Timeout error happens while streaming a component - # If the streamed component returned any chunks, it shouldn't retry on errors, as it would cause page duplication - # The SSR-generated html will be written to the page two times in this case - retry_after: ->(request, response) do - if (request.stream.instance_variable_get(:@react_on_rails_received_first_chunk)) - e = response.error - raise ReactOnRailsPro::Error, "An error happened during server side render streaming of a component.\n" \ - "Original error:\n#{e}\n#{e.backtrace}" - end - - Rails.logger.info do - "[ReactOnRailsPro] An error happneding while making a request to the Node Renderer.\n" \ - "Error: #{response.error}.\n" \ - "Retrying by HTTPX \"retries\" plugin..." - end - # The retry_after block expects to return a delay to wait before retrying the request - # nil means no waiting delay - nil - end + retry_change_requests: true, + # Official HTTPx docs says that we should use the retry_on option to decide if the + # request should be retried or not + # However, HTTPx assumes that connection errors such as timeout error should be retried + # by default and it doesn't consider retry_on block at all at that case + # So, we have to do the following trick to avoid retries when a Timeout error happens + # while streaming a component + # If the streamed component returned any chunks, it shouldn't retry on errors, as it + # would cause page duplication + # The SSR-generated html will be written to the page two times in this case + retry_after: lambda do |request, response| + if request.stream.instance_variable_get(:@react_on_rails_received_first_chunk) + e = response.error + raise( + ReactOnRailsPro::Error, + "An error happened during server side render streaming " \ + "of a component.\nOriginal error:\n#{e}\n#{e.backtrace}" + ) + end + + Rails.logger.info do + "[ReactOnRailsPro] An error occurred while making " \ + "a request to the Node Renderer.\n" \ + "Error: #{response.error}.\n" \ + "Retrying by HTTPX \"retries\" plugin..." + end + # The retry_after block expects to return a delay to wait before + # retrying the request + # nil means no waiting delay + nil + end ) .plugin(:stream) # See https://www.rubydoc.info/gems/httpx/1.3.3/HTTPX%2FOptions:initialize for the available options diff --git a/react_on_rails_pro/lib/react_on_rails_pro/stream_request.rb b/react_on_rails_pro/lib/react_on_rails_pro/stream_request.rb index e0accae5cb..4090958a0f 100644 --- a/react_on_rails_pro/lib/react_on_rails_pro/stream_request.rb +++ b/react_on_rails_pro/lib/react_on_rails_pro/stream_request.rb @@ -51,23 +51,23 @@ def handle_chunk(chunk, position) end end - def each_chunk(&block) + def each_chunk(&block) # rubocop:disable Metrics/CyclomaticComplexity return enum_for(:each_chunk) unless block first_chunk = true @component.each_chunk do |chunk| position = first_chunk ? :first : :middle modified_chunk = handle_chunk(chunk, position) - block.call(modified_chunk) + yield(modified_chunk) first_chunk = false end # The last chunk contains the append content after the transformation # All transformations are applied to the append content last_chunk = handle_chunk("", :last) - block.call(last_chunk) unless last_chunk.empty? - rescue StandardError => err - current_error = err + yield(last_chunk) unless last_chunk.empty? + rescue StandardError => e + current_error = e rescue_block_index = 0 while current_error.present? && (rescue_block_index < @rescue_blocks.size) begin diff --git a/react_on_rails_pro/rakelib/public_key_management.rake b/react_on_rails_pro/rakelib/public_key_management.rake index dfd3367213..775d927d45 100644 --- a/react_on_rails_pro/rakelib/public_key_management.rake +++ b/react_on_rails_pro/rakelib/public_key_management.rake @@ -13,9 +13,9 @@ require "uri" # rake react_on_rails_pro:verify_public_key # Verify current configuration # rake react_on_rails_pro:public_key_help # Show help -namespace :react_on_rails_pro do +namespace :react_on_rails_pro do # rubocop:disable Metrics/BlockLength desc "Update the public key for React on Rails Pro license validation" - task :update_public_key, [:source] do |_task, args| + task :update_public_key, [:source] do |_task, args| # rubocop:disable Metrics/BlockLength source = args[:source] || "production" # Determine the API URL based on the source @@ -68,7 +68,7 @@ namespace :react_on_rails_pro do # ShakaCode's public key for React on Rails Pro license verification # The private key corresponding to this public key is held by ShakaCode # and is never committed to the repository - # Last updated: #{Time.now.utc.strftime("%Y-%m-%d %H:%M:%S UTC")} + # Last updated: #{Time.now.utc.strftime('%Y-%m-%d %H:%M:%S UTC')} # Source: #{api_url} # # You can update this public key by running the rake task: @@ -86,12 +86,13 @@ namespace :react_on_rails_pro do puts "✅ Updated Ruby public key: #{ruby_file_path}" # Update Node/TypeScript public key file - node_file_path = File.join(File.dirname(__FILE__), "..", "packages", "node-renderer", "src", "shared", "licensePublicKey.ts") + node_file_path = File.join(File.dirname(__FILE__), "..", "packages", "node-renderer", "src", "shared", + "licensePublicKey.ts") node_content = <<~TYPESCRIPT // ShakaCode's public key for React on Rails Pro license verification // The private key corresponding to this public key is held by ShakaCode // and is never committed to the repository - // Last updated: #{Time.now.utc.strftime("%Y-%m-%d %H:%M:%S UTC")} + // Last updated: #{Time.now.utc.strftime('%Y-%m-%d %H:%M:%S UTC')} // Source: #{api_url} // // You can update this public key by running the rake task: diff --git a/react_on_rails_pro/spec/dummy/app/controllers/pages_controller.rb b/react_on_rails_pro/spec/dummy/app/controllers/pages_controller.rb index f2f6d309e1..7a33950f91 100644 --- a/react_on_rails_pro/spec/dummy/app/controllers/pages_controller.rb +++ b/react_on_rails_pro/spec/dummy/app/controllers/pages_controller.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class PagesController < ApplicationController +class PagesController < ApplicationController # rubocop:disable Metrics/ClassLength include ReactOnRailsPro::RSCPayloadRenderer include RscPostsPageOverRedisHelper @@ -85,8 +85,8 @@ def redis_receiver ensure begin redis&.close - rescue StandardError => close_err - Rails.logger.warn "Failed to close Redis: #{close_err.message}" + rescue StandardError => e + Rails.logger.warn "Failed to close Redis: #{e.message}" end end diff --git a/react_on_rails_pro/spec/dummy/spec/system/integration_spec.rb b/react_on_rails_pro/spec/dummy/spec/system/integration_spec.rb index de41071d8d..82c0cbf021 100644 --- a/react_on_rails_pro/spec/dummy/spec/system/integration_spec.rb +++ b/react_on_rails_pro/spec/dummy/spec/system/integration_spec.rb @@ -396,14 +396,14 @@ def change_text_expect_dom_selector(dom_selector, expect_no_change: false) it "hydrates the component" do visit path - expect(page.html).to match(/client-bundle[^\"]*.js/) + expect(page.html).to match(/client-bundle[^"]*.js/) change_text_expect_dom_selector(selector) end it "renders the page completely on server and displays content on client even without JavaScript" do # Don't add client-bundle.js to the page to ensure that the app is not hydrated visit "#{path}?skip_js_packs=true" - expect(page.html).not_to match(/client-bundle[^\"]*.js/) + expect(page.html).not_to match(/client-bundle[^"]*.js/) # Ensure that the component state is not updated change_text_expect_dom_selector(selector, expect_no_change: true) @@ -432,7 +432,7 @@ def change_text_expect_dom_selector(dom_selector, expect_no_change: false) "#ServerComponentRouter-react-component-0" # Skip the test that fails without JavaScript - being addressed in another PR - it "renders the page completely on server and displays content on client even without JavaScript", + it "renders the page completely on server and displays content on client even without JavaScript", # rubocop:disable RSpec/NoExpectationExample skip: "Being addressed in another PR" do # This test is overridden to skip it end diff --git a/react_on_rails_pro/spec/react_on_rails_pro/configuration_spec.rb b/react_on_rails_pro/spec/react_on_rails_pro/configuration_spec.rb index 152fe27b4e..d2bbe6802c 100644 --- a/react_on_rails_pro/spec/react_on_rails_pro/configuration_spec.rb +++ b/react_on_rails_pro/spec/react_on_rails_pro/configuration_spec.rb @@ -2,7 +2,7 @@ require_relative "spec_helper" -module ReactOnRailsPro +module ReactOnRailsPro # rubocop:disable Metrics/ModuleLength RSpec.describe Configuration do after do ReactOnRailsPro.instance_variable_set(:@configuration, nil) @@ -205,7 +205,8 @@ def self.fetch(*) expect(ReactOnRailsPro.configuration.rsc_bundle_js_file).to eq("rsc-bundle.js") expect(ReactOnRailsPro.configuration.react_client_manifest_file).to eq("react-client-manifest.json") - expect(ReactOnRailsPro.configuration.react_server_client_manifest_file).to eq("react-server-client-manifest.json") + expect(ReactOnRailsPro.configuration.react_server_client_manifest_file) + .to eq("react-server-client-manifest.json") end it "allows setting rsc_bundle_js_file" do @@ -229,7 +230,8 @@ def self.fetch(*) config.react_server_client_manifest_file = "custom-server-client-manifest.json" end - expect(ReactOnRailsPro.configuration.react_server_client_manifest_file).to eq("custom-server-client-manifest.json") + expect(ReactOnRailsPro.configuration.react_server_client_manifest_file) + .to eq("custom-server-client-manifest.json") end it "allows nil values for RSC configuration options" do diff --git a/react_on_rails_pro/spec/react_on_rails_pro/license_validator_spec.rb b/react_on_rails_pro/spec/react_on_rails_pro/license_validator_spec.rb index 60d330201d..4236dc8cbe 100644 --- a/react_on_rails_pro/spec/react_on_rails_pro/license_validator_spec.rb +++ b/react_on_rails_pro/spec/react_on_rails_pro/license_validator_spec.rb @@ -75,26 +75,30 @@ ENV["REACT_ON_RAILS_PRO_LICENSE"] = expired_token end - context "in development/test environment" do + context "when in development/test environment" do before do allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new("development")) end it "raises error immediately" do - expect { described_class.validated_license_data! }.to raise_error(ReactOnRailsPro::Error, /License has expired/) + expect do + described_class.validated_license_data! + end.to raise_error(ReactOnRailsPro::Error, /License has expired/) end it "includes FREE license information in error message" do - expect { described_class.validated_license_data! }.to raise_error(ReactOnRailsPro::Error, /FREE evaluation license/) + expect do + described_class.validated_license_data! + end.to raise_error(ReactOnRailsPro::Error, /FREE evaluation license/) end end - context "in production environment" do + context "when in production environment" do before do allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new("production")) end - context "within grace period (expired < 1 month ago)" do + context "with grace period (expired < 1 month ago)" do let(:expired_within_grace) do { sub: "test@example.com", @@ -113,7 +117,8 @@ end it "logs warning with grace period remaining" do - expect(mock_logger).to receive(:error).with(/WARNING:.*License has expired.*Grace period:.*day\(s\) remaining/) + expect(mock_logger).to receive(:error) + .with(/WARNING:.*License has expired.*Grace period:.*day\(s\) remaining/) described_class.validated_license_data! end @@ -123,7 +128,7 @@ end end - context "outside grace period (expired > 1 month ago)" do + context "when outside grace period (expired > 1 month ago)" do let(:expired_outside_grace) do { sub: "test@example.com", @@ -138,11 +143,15 @@ end it "raises error" do - expect { described_class.validated_license_data! }.to raise_error(ReactOnRailsPro::Error, /License has expired/) + expect do + described_class.validated_license_data! + end.to raise_error(ReactOnRailsPro::Error, /License has expired/) end it "includes FREE license information in error message" do - expect { described_class.validated_license_data! }.to raise_error(ReactOnRailsPro::Error, /FREE evaluation license/) + expect do + described_class.validated_license_data! + end.to raise_error(ReactOnRailsPro::Error, /FREE evaluation license/) end end end @@ -168,7 +177,9 @@ end it "includes FREE license information in error message" do - expect { described_class.validated_license_data! }.to raise_error(ReactOnRailsPro::Error, /FREE evaluation license/) + expect do + described_class.validated_license_data! + end.to raise_error(ReactOnRailsPro::Error, /FREE evaluation license/) end end @@ -180,11 +191,15 @@ end it "raises error" do - expect { described_class.validated_license_data! }.to raise_error(ReactOnRailsPro::Error, /Invalid license signature/) + expect do + described_class.validated_license_data! + end.to raise_error(ReactOnRailsPro::Error, /Invalid license signature/) end it "includes FREE license information in error message" do - expect { described_class.validated_license_data! }.to raise_error(ReactOnRailsPro::Error, /FREE evaluation license/) + expect do + described_class.validated_license_data! + end.to raise_error(ReactOnRailsPro::Error, /FREE evaluation license/) end end diff --git a/react_on_rails_pro/spec/react_on_rails_pro/stream_decorator_spec.rb b/react_on_rails_pro/spec/react_on_rails_pro/stream_decorator_spec.rb index d22f321a9f..be352223ec 100644 --- a/react_on_rails_pro/spec/react_on_rails_pro/stream_decorator_spec.rb +++ b/react_on_rails_pro/spec/react_on_rails_pro/stream_decorator_spec.rb @@ -65,7 +65,7 @@ describe "#rescue" do it "catches the error happens inside the component" do - allow(mock_component).to receive(:each_chunk).and_raise(StandardError.new "Fake Error") + allow(mock_component).to receive(:each_chunk).and_raise(StandardError.new("Fake Error")) mocked_block = mock_block stream_decorator.rescue(&mocked_block.block) @@ -80,7 +80,7 @@ end it "catches the error happens inside subsequent component calls" do - allow(mock_component).to receive(:each_chunk).and_yield("Chunk1").and_raise(ArgumentError.new "Fake Error") + allow(mock_component).to receive(:each_chunk).and_yield("Chunk1").and_raise(ArgumentError.new("Fake Error")) mocked_block = mock_block stream_decorator.rescue(&mocked_block.block) @@ -96,7 +96,7 @@ end it "can yield values to the stream" do - allow(mock_component).to receive(:each_chunk).and_yield("Chunk1").and_raise(ArgumentError.new "Fake Error") + allow(mock_component).to receive(:each_chunk).and_yield("Chunk1").and_raise(ArgumentError.new("Fake Error")) mocked_block = mock_block stream_decorator.rescue(&mocked_block.block) @@ -115,11 +115,11 @@ end it "can convert the error into another error" do - allow(mock_component).to receive(:each_chunk).and_raise(StandardError.new "Fake Error") + allow(mock_component).to receive(:each_chunk).and_raise(StandardError.new("Fake Error")) mocked_block = mock_block do |error| expect(error).to be_a(StandardError) expect(error.message).to eq("Fake Error") - raise ArgumentError.new "Another Error" + raise ArgumentError, "Another Error" end stream_decorator.rescue(&mocked_block.block) @@ -129,12 +129,12 @@ end it "chains multiple rescue blocks" do - allow(mock_component).to receive(:each_chunk).and_yield("Chunk1").and_raise(StandardError.new "Fake Error") + allow(mock_component).to receive(:each_chunk).and_yield("Chunk1").and_raise(StandardError.new("Fake Error")) fist_rescue_block = mock_block do |error, &block| expect(error).to be_a(StandardError) expect(error.message).to eq("Fake Error") block.call "Chunk from first rescue block" - raise ArgumentError.new "Another Error" + raise ArgumentError, "Another Error" end second_rescue_block = mock_block do |error, &block| diff --git a/react_on_rails_pro/spec/react_on_rails_pro/support/mock_block_helper.rb b/react_on_rails_pro/spec/react_on_rails_pro/support/mock_block_helper.rb index 7b00141163..aaae4e6821 100644 --- a/react_on_rails_pro/spec/react_on_rails_pro/support/mock_block_helper.rb +++ b/react_on_rails_pro/spec/react_on_rails_pro/support/mock_block_helper.rb @@ -12,7 +12,7 @@ module MockBlockHelper def mock_block(&block) double("BlockMock").tap do |mock| # rubocop:disable RSpec/VerifiedDoubles allow(mock).to receive(:call) do |*args, &inner_block| - block.call(*args, &inner_block) if block + block&.call(*args, &inner_block) end def mock.block method(:call).to_proc From 87238932b68a8004dfe74f141c3a20eae41eb7f7 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Sun, 16 Nov 2025 13:53:40 -0600 Subject: [PATCH 02/14] give each job a specific name --- .github/workflows/examples.yml | 2 +- .github/workflows/integration-tests.yml | 2 +- .github/workflows/lint-js-and-ruby.yml | 2 +- .github/workflows/package-js-tests.yml | 2 +- .github/workflows/pro-integration-tests.yml | 6 +++--- .github/workflows/pro-lint.yml | 2 +- .github/workflows/pro-test-package-and-gem.yml | 6 +++--- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 3846462ea7..b011c8a7d2 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -57,7 +57,7 @@ jobs: script/ci-changes-detector "$BASE_REF" shell: bash - examples: + build-examples-and-test-generators: needs: detect-changes # Run on master, workflow_dispatch, OR when generators needed if: | diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 03231da3ca..caf3f7e0ea 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -141,7 +141,7 @@ jobs: path: spec/dummy/public/webpack key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} - dummy-app-integration-tests: + spec-dummy-integration-tests: needs: [detect-changes, build-dummy-app-webpack-test-bundles] # Run on master, workflow_dispatch, OR when tests needed on PR if: | diff --git a/.github/workflows/lint-js-and-ruby.yml b/.github/workflows/lint-js-and-ruby.yml index 7d0a7329c6..2793edafaa 100644 --- a/.github/workflows/lint-js-and-ruby.yml +++ b/.github/workflows/lint-js-and-ruby.yml @@ -58,7 +58,7 @@ jobs: script/ci-changes-detector "$BASE_REF" shell: bash - build: + lint-js-and-ruby: needs: detect-changes if: github.ref == 'refs/heads/master' || needs.detect-changes.outputs.run_lint == 'true' env: diff --git a/.github/workflows/package-js-tests.yml b/.github/workflows/package-js-tests.yml index 24bb2d0830..f1cafd0893 100644 --- a/.github/workflows/package-js-tests.yml +++ b/.github/workflows/package-js-tests.yml @@ -63,7 +63,7 @@ jobs: script/ci-changes-detector "$BASE_REF" shell: bash - build: + package-js-tests: needs: detect-changes # Run on master OR when JS tests needed on PR if: | diff --git a/.github/workflows/pro-integration-tests.yml b/.github/workflows/pro-integration-tests.yml index 1c5cde1a4a..fe945d956a 100644 --- a/.github/workflows/pro-integration-tests.yml +++ b/.github/workflows/pro-integration-tests.yml @@ -62,7 +62,7 @@ jobs: shell: bash # Build webpack test bundles for dummy app - build-dummy-app-webpack-test-bundles: + pro-build-dummy-app-webpack-test-bundles: needs: detect-changes if: github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_pro_tests == 'true' runs-on: ubuntu-22.04 @@ -147,7 +147,7 @@ jobs: key: v4-pro-dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }} # RSpec integration tests with Node renderer - rspec-dummy-app-node-renderer: + pro-dummy-app-node-renderer: needs: - detect-changes - build-dummy-app-webpack-test-bundles @@ -324,7 +324,7 @@ jobs: path: react_on_rails_pro/spec/dummy/yarn-error.log # Playwright E2E tests with Redis service - dummy-app-node-renderer-e2e-tests: + node-renderer-e2e-tests: needs: - detect-changes - build-dummy-app-webpack-test-bundles diff --git a/.github/workflows/pro-lint.yml b/.github/workflows/pro-lint.yml index 907ba092cd..6b73a9d8b5 100644 --- a/.github/workflows/pro-lint.yml +++ b/.github/workflows/pro-lint.yml @@ -61,7 +61,7 @@ jobs: script/ci-changes-detector "$BASE_REF" shell: bash - lint-js-and-ruby: + pro-lint-js-and-ruby: needs: detect-changes if: github.ref == 'refs/heads/master' || needs.detect-changes.outputs.run_pro_lint == 'true' runs-on: ubuntu-22.04 diff --git a/.github/workflows/pro-test-package-and-gem.yml b/.github/workflows/pro-test-package-and-gem.yml index 386d26c2cf..ab82829520 100644 --- a/.github/workflows/pro-test-package-and-gem.yml +++ b/.github/workflows/pro-test-package-and-gem.yml @@ -62,7 +62,7 @@ jobs: shell: bash # Build webpack test bundles for dummy app - build-dummy-app-webpack-test-bundles: + pro-build-dummy-app-webpack-test-bundles: needs: detect-changes if: github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_pro_tests == 'true' runs-on: ubuntu-22.04 @@ -147,7 +147,7 @@ jobs: key: v4-pro-dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }} # Jest unit tests for Pro package - package-js-tests: + pro-package-js-tests: needs: - detect-changes - build-dummy-app-webpack-test-bundles @@ -227,7 +227,7 @@ jobs: path: react_on_rails_pro/jest # RSpec tests for Pro package - rspec-package-specs: + pro-gem-tests: needs: detect-changes if: github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_pro_tests == 'true' strategy: From e47b62645044a51a9fcefcf7af2a934ed8750c43 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Sun, 16 Nov 2025 13:54:03 -0600 Subject: [PATCH 03/14] fix pro rubocop linting --- .github/workflows/pro-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pro-lint.yml b/.github/workflows/pro-lint.yml index 6b73a9d8b5..51567499b0 100644 --- a/.github/workflows/pro-lint.yml +++ b/.github/workflows/pro-lint.yml @@ -148,7 +148,7 @@ jobs: run: cd spec/dummy && bundle exec rake react_on_rails:generate_packs - name: Lint Ruby - run: bundle exec rubocop + run: bundle exec rubocop --ignore-parent-exclusion - name: Validate RBS type signatures run: bundle exec rake rbs:validate From d8205a61d307050bfb665fdef6fae34070099385 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Sun, 16 Nov 2025 15:17:49 -0600 Subject: [PATCH 04/14] update job references --- .github/workflows/pro-integration-tests.yml | 4 ++-- .github/workflows/pro-test-package-and-gem.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pro-integration-tests.yml b/.github/workflows/pro-integration-tests.yml index fe945d956a..ecec0b81df 100644 --- a/.github/workflows/pro-integration-tests.yml +++ b/.github/workflows/pro-integration-tests.yml @@ -150,7 +150,7 @@ jobs: pro-dummy-app-node-renderer: needs: - detect-changes - - build-dummy-app-webpack-test-bundles + - pro-build-dummy-app-webpack-test-bundles if: github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_pro_tests == 'true' runs-on: ubuntu-22.04 env: @@ -327,7 +327,7 @@ jobs: node-renderer-e2e-tests: needs: - detect-changes - - build-dummy-app-webpack-test-bundles + - pro-build-dummy-app-webpack-test-bundles if: github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_pro_tests == 'true' runs-on: ubuntu-22.04 env: diff --git a/.github/workflows/pro-test-package-and-gem.yml b/.github/workflows/pro-test-package-and-gem.yml index ab82829520..ff46ac8c74 100644 --- a/.github/workflows/pro-test-package-and-gem.yml +++ b/.github/workflows/pro-test-package-and-gem.yml @@ -150,7 +150,7 @@ jobs: pro-package-js-tests: needs: - detect-changes - - build-dummy-app-webpack-test-bundles + - pro-build-dummy-app-webpack-test-bundles if: github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_pro_tests == 'true' runs-on: ubuntu-22.04 # Redis service container From 1cb3a3ae68aaa9bde42b3a1994cfa2b1cb67882f Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Sun, 16 Nov 2025 15:18:14 -0600 Subject: [PATCH 05/14] try using arrays in workflow expression for matrix --- .github/workflows/examples.yml | 28 ++++----- .github/workflows/gem-tests.yml | 20 ++----- .github/workflows/integration-tests.yml | 77 +++++++++++++------------ .github/workflows/package-js-tests.yml | 10 +--- 4 files changed, 61 insertions(+), 74 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index b011c8a7d2..d027087fa3 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -65,29 +65,29 @@ jobs: strategy: fail-fast: false matrix: - include: - # Always run: Latest versions (fast feedback on PRs) - - ruby-version: '3.4' - dependency-level: 'latest' - # Master and workflow_dispatch: Minimum supported versions (full coverage) - - ruby-version: '3.2' - dependency-level: 'minimum' - exclude: - # Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label) - - ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '3.2' || '' }} - dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && 'minimum' || '' }} + dependency-level: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && ['minimum'] || ['latest', 'minimum']}} env: SKIP_YARN_COREPACK_CHECK: 0 BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }} runs-on: ubuntu-22.04 steps: + - name: Translate matrix for Ruby and Node versions + id: translate-matrix + run: | + if [ "${{ matrix.dependency-level }}" == "latest" ]; then + echo "ruby-version=3.4" >> "$GITHUB_OUTPUT" + echo "node-version=22" >> "$GITHUB_OUTPUT" + else + echo "ruby-version=3.2" >> "$GITHUB_OUTPUT" + echo "node-version=20" >> "$GITHUB_OUTPUT" + fi - uses: actions/checkout@v4 with: persist-credentials: false - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby-version }} + ruby-version: ${{ steps.translate-matrix.outputs.ruby-version }} bundler: 2.5.9 - name: Setup Node uses: actions/setup-node@v4 @@ -113,7 +113,7 @@ jobs: uses: actions/cache@v4 with: path: vendor/bundle - key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} - id: get-sha run: echo "sha=\"$(git rev-parse HEAD)\"" >> "$GITHUB_OUTPUT" - name: Install Node modules with Yarn for renderer package @@ -150,5 +150,5 @@ jobs: - name: Store test results uses: actions/upload-artifact@v4 with: - name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} path: ~/rspec diff --git a/.github/workflows/gem-tests.yml b/.github/workflows/gem-tests.yml index 62773d5bf2..1998e40036 100644 --- a/.github/workflows/gem-tests.yml +++ b/.github/workflows/gem-tests.yml @@ -69,17 +69,7 @@ jobs: strategy: fail-fast: false matrix: - include: - # Always run: Latest versions (fast feedback on PRs) - - ruby-version: '3.4' - dependency-level: 'latest' - # Master and full-ci label: Minimum supported versions (full coverage) - - ruby-version: '3.2' - dependency-level: 'minimum' - exclude: - # Skip minimum dependency matrix on regular PRs (run only on master or with full-ci label) - - ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && needs.detect-changes.outputs.has_full_ci_label != 'true' && '3.2' || '' }} - dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && needs.detect-changes.outputs.has_full_ci_label != 'true' && 'minimum' || '' }} + dependency-level: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && ['minimum'] || ['latest', 'minimum']}} env: BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }} runs-on: ubuntu-22.04 @@ -90,7 +80,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby-version }} + ruby-version: ${{ steps.translate-matrix.outputs.ruby-version }} bundler: 2.5.9 - name: Print system information run: | @@ -108,7 +98,7 @@ jobs: uses: actions/cache@v4 with: path: vendor/bundle - key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} - name: Install Ruby Gems for package run: bundle check --path=vendor/bundle || bundle _2.5.9_ install --path=vendor/bundle --jobs=4 --retry=3 - name: Git Stuff @@ -125,10 +115,10 @@ jobs: - name: Store test results uses: actions/upload-artifact@v4 with: - name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} path: ~/rspec - name: Store artifacts uses: actions/upload-artifact@v4 with: - name: main-test-log-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + name: main-test-log-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} path: log/test.log diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index caf3f7e0ea..3420477a5b 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -64,24 +64,28 @@ jobs: if: | github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_dummy_tests == 'true' strategy: + fail-fast: false matrix: - ruby-version: ['3.4'] - node-version: ['22'] - dependency-level: ['latest'] - include: - # Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label) - - ruby-version: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && '3.2'}} - node-version: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && '20'}} - dependency-level: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && 'minimum'}} + dependency-level: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && ['minimum'] || ['latest', 'minimum']}} runs-on: ubuntu-22.04 steps: + - name: Translate matrix for Ruby and Node versions + id: translate-matrix + run: | + if [ "${{ matrix.dependency-level }}" == "latest" ]; then + echo "ruby-version=3.4" >> "$GITHUB_OUTPUT" + echo "node-version=22" >> "$GITHUB_OUTPUT" + else + echo "ruby-version=3.2" >> "$GITHUB_OUTPUT" + echo "node-version=20" >> "$GITHUB_OUTPUT" + fi - uses: actions/checkout@v4 with: persist-credentials: false - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby-version }} + ruby-version: ${{ steps.translate-matrix.outputs.ruby-version }} bundler: 2.5.9 # libyaml-dev is needed for psych v5 # this gem depends on sdoc which depends on rdoc which depends on psych @@ -90,10 +94,10 @@ jobs: - name: Setup Node uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ steps.translate-matrix.outputs.node-version }} # Disable cache for Node 22 due to V8 bug in 22.21.0 # https://github.com/nodejs/node/issues/56010 - cache: ${{ matrix.node-version != '22' && 'yarn' || '' }} + cache: yarn cache-dependency-path: '**/yarn.lock' - name: Print system information run: | @@ -121,7 +125,7 @@ jobs: uses: actions/cache@v4 with: path: spec/dummy/vendor/bundle - key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} - name: Install Ruby Gems for dummy app run: | cd spec/dummy @@ -139,7 +143,7 @@ jobs: uses: actions/cache/save@v4 with: path: spec/dummy/public/webpack - key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} spec-dummy-integration-tests: needs: [detect-changes, build-dummy-app-webpack-test-bundles] @@ -147,37 +151,36 @@ jobs: if: | github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_dummy_tests == 'true' strategy: + fail-fast: false matrix: - ruby-version: ['3.4'] - node-version: ['22'] - dependency-level: ['latest'] - include: - # Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label) - - ruby-version: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && '3.2'}} - node-version: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && '20'}} - dependency-level: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && 'minimum'}} - exclude: - # Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label) - - ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '3.2' || '' }} - node-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '20' || '' }} - dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && 'minimum' || '' }} + dependency-level: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && ['minimum'] || ['latest', 'minimum']}} runs-on: ubuntu-22.04 steps: + - name: Translate matrix for Ruby and Node versions + id: translate-matrix + run: | + if [ "${{ matrix.dependency-level }}" == "latest" ]; then + echo "ruby-version=3.4" >> "$GITHUB_OUTPUT" + echo "node-version=22" >> "$GITHUB_OUTPUT" + else + echo "ruby-version=3.2" >> "$GITHUB_OUTPUT" + echo "node-version=20" >> "$GITHUB_OUTPUT" + fi - uses: actions/checkout@v4 with: persist-credentials: false - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby-version }} + ruby-version: ${{ steps.translate-matrix.outputs.ruby-version }} bundler: 2.5.9 - name: Setup Node uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ steps.translate-matrix.outputs.node-version }} # Disable cache for Node 22 due to V8 bug in 22.21.0 # https://github.com/nodejs/node/issues/56010 - cache: ${{ matrix.node-version != '22' && 'yarn' || '' }} + cache: yarn cache-dependency-path: '**/yarn.lock' - name: Print system information run: | @@ -195,19 +198,19 @@ jobs: uses: actions/cache@v4 with: path: vendor/bundle - key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} - name: Save dummy app ruby gems to cache uses: actions/cache@v4 with: path: spec/dummy/vendor/bundle - key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} - id: get-sha run: echo "sha=\"$(git rev-parse HEAD)\"" >> "$GITHUB_OUTPUT" - name: Save test Webpack bundles to cache (for build number checksum used by RSpec job) uses: actions/cache@v4 with: path: spec/dummy/public/webpack - key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} - name: Install Node modules with Yarn run: | yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }} @@ -260,26 +263,26 @@ jobs: - run: cd spec/dummy && bundle info shakapacker - name: Set packer version environment variable run: | - echo "CI_DEPENDENCY_LEVEL=ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}" >> $GITHUB_ENV + echo "CI_DEPENDENCY_LEVEL=ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }}" >> $GITHUB_ENV - name: Main CI run: bundle exec rake run_rspec:all_dummy - name: Store test results uses: actions/upload-artifact@v4 with: - name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} path: ~/rspec - name: Store artifacts uses: actions/upload-artifact@v4 with: - name: dummy-app-capybara-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + name: dummy-app-capybara-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} path: spec/dummy/tmp/capybara - name: Store artifacts uses: actions/upload-artifact@v4 with: - name: dummy-app-test-log-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + name: dummy-app-test-log-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} path: spec/dummy/log/test.log - name: Store artifacts uses: actions/upload-artifact@v4 with: - name: dummy-app-yarn-log-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + name: dummy-app-yarn-log-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} path: spec/dummy/yarn-error.log diff --git a/.github/workflows/package-js-tests.yml b/.github/workflows/package-js-tests.yml index f1cafd0893..fb547431a1 100644 --- a/.github/workflows/package-js-tests.yml +++ b/.github/workflows/package-js-tests.yml @@ -69,15 +69,9 @@ jobs: if: | (github.ref == 'refs/heads/master' || needs.detect-changes.outputs.run_js_tests == 'true') strategy: + fail-fast: false matrix: - include: - # Always run: Latest Node version (fast feedback on PRs) - - node-version: '22' - # Master and full-ci label: Minimum supported Node version (full coverage) - - node-version: '20' - exclude: - # Skip minimum dependency matrix on regular PRs (run only on master or with full-ci label) - - node-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && needs.detect-changes.outputs.has_full_ci_label != 'true' && '20' || '' }} + node-version: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && ['20'] || ['22', '20']}} runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 From b34c1de9a42fc3a45a1ce1a9a18d186837abb6dc Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Sun, 16 Nov 2025 16:05:32 -0600 Subject: [PATCH 06/14] try a json conversion --- .github/workflows/examples.yml | 2 +- .github/workflows/gem-tests.yml | 2 +- .github/workflows/integration-tests.yml | 4 ++-- .github/workflows/package-js-tests.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index d027087fa3..d141f66a74 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -65,7 +65,7 @@ jobs: strategy: fail-fast: false matrix: - dependency-level: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && ['minimum'] || ['latest', 'minimum']}} + dependency-level: ${{ fromJSON((github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && toJSON(['minimum']) || toJSON(['latest', 'minimum'])) }} env: SKIP_YARN_COREPACK_CHECK: 0 BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }} diff --git a/.github/workflows/gem-tests.yml b/.github/workflows/gem-tests.yml index 1998e40036..3ae412cbf4 100644 --- a/.github/workflows/gem-tests.yml +++ b/.github/workflows/gem-tests.yml @@ -69,7 +69,7 @@ jobs: strategy: fail-fast: false matrix: - dependency-level: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && ['minimum'] || ['latest', 'minimum']}} + dependency-level: ${{ fromJSON((github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && toJSON(['minimum']) || toJSON(['latest', 'minimum'])) }} env: BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }} runs-on: ubuntu-22.04 diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 3420477a5b..ca17cb04dd 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -66,7 +66,7 @@ jobs: strategy: fail-fast: false matrix: - dependency-level: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && ['minimum'] || ['latest', 'minimum']}} + dependency-level: ${{ fromJSON((github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && toJSON(['minimum']) || toJSON(['latest', 'minimum'])) }} runs-on: ubuntu-22.04 steps: - name: Translate matrix for Ruby and Node versions @@ -153,7 +153,7 @@ jobs: strategy: fail-fast: false matrix: - dependency-level: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && ['minimum'] || ['latest', 'minimum']}} + dependency-level: ${{ fromJSON((github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && toJSON(['minimum']) || toJSON(['latest', 'minimum'])) }} runs-on: ubuntu-22.04 steps: - name: Translate matrix for Ruby and Node versions diff --git a/.github/workflows/package-js-tests.yml b/.github/workflows/package-js-tests.yml index fb547431a1..880570daca 100644 --- a/.github/workflows/package-js-tests.yml +++ b/.github/workflows/package-js-tests.yml @@ -71,7 +71,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && ['20'] || ['22', '20']}} + node-version: ${{ fromJSON((github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && toJSON(['20']) || toJSON(['22', '20'])) }} runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 From 239048a80d93d4f20114bd4da2c41dcdc160096b Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Sun, 16 Nov 2025 16:34:25 -0600 Subject: [PATCH 07/14] try processing the conditional logic in another job --- .github/workflows/examples.yml | 11 ++++++++++- .github/workflows/gem-tests.yml | 11 ++++++++++- .github/workflows/integration-tests.yml | 13 +++++++++++-- .github/workflows/package-js-tests.yml | 11 ++++++++++- 4 files changed, 41 insertions(+), 5 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index d141f66a74..f6e66ee8a2 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -30,6 +30,7 @@ jobs: run_dummy_tests: ${{ steps.detect.outputs.run_dummy_tests }} run_generators: ${{ steps.detect.outputs.run_generators }} has_full_ci_label: ${{ steps.check-label.outputs.result }} + matrix_array: ${{ steps.determine-matrix.outputs.result }} steps: - uses: actions/checkout@v4 with: @@ -39,6 +40,14 @@ jobs: - name: Check for full-ci label id: check-label uses: ./.github/actions/check-full-ci-label + - name: Determine matrix strategy + id: determine-matrix + run: | + if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then + echo 'result=["latest"]' | jq -c . >> "$GITHUB_OUTPUT" + else + echo 'result=["latest","minimum"]' | jq -c . >> "$GITHUB_OUTPUT" + fi - name: Detect relevant changes id: detect run: | @@ -65,7 +74,7 @@ jobs: strategy: fail-fast: false matrix: - dependency-level: ${{ fromJSON((github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && toJSON(['minimum']) || toJSON(['latest', 'minimum'])) }} + dependency-level: ${{ fromJson(needs.detect-changes.outputs.matrix_array) }} env: SKIP_YARN_COREPACK_CHECK: 0 BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }} diff --git a/.github/workflows/gem-tests.yml b/.github/workflows/gem-tests.yml index 3ae412cbf4..2fc7fa4660 100644 --- a/.github/workflows/gem-tests.yml +++ b/.github/workflows/gem-tests.yml @@ -34,6 +34,7 @@ jobs: run_dummy_tests: ${{ steps.detect.outputs.run_dummy_tests }} run_generators: ${{ steps.detect.outputs.run_generators }} has_full_ci_label: ${{ steps.check-label.outputs.result }} + matrix_array: ${{ steps.determine-matrix.outputs.result }} steps: - uses: actions/checkout@v4 with: @@ -43,6 +44,14 @@ jobs: - name: Check for full-ci label id: check-label uses: ./.github/actions/check-full-ci-label + - name: Determine matrix strategy + id: determine-matrix + run: | + if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then + echo 'result=["latest"]' | jq -c . >> "$GITHUB_OUTPUT" + else + echo 'result=["latest","minimum"]' | jq -c . >> "$GITHUB_OUTPUT" + fi - name: Detect relevant changes id: detect run: | @@ -69,7 +78,7 @@ jobs: strategy: fail-fast: false matrix: - dependency-level: ${{ fromJSON((github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && toJSON(['minimum']) || toJSON(['latest', 'minimum'])) }} + dependency-level: ${{ fromJson(needs.detect-changes.outputs.matrix_array) }} env: BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }} runs-on: ubuntu-22.04 diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index ca17cb04dd..eb3d438017 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -32,6 +32,7 @@ jobs: run_dummy_tests: ${{ steps.detect.outputs.run_dummy_tests }} run_generators: ${{ steps.detect.outputs.run_generators }} has_full_ci_label: ${{ steps.check-label.outputs.result }} + matrix_array: ${{ steps.determine-matrix.outputs.result }} steps: - uses: actions/checkout@v4 with: @@ -41,6 +42,14 @@ jobs: - name: Check for full-ci label id: check-label uses: ./.github/actions/check-full-ci-label + - name: Determine matrix strategy + id: determine-matrix + run: | + if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then + echo 'result=["latest"]' | jq -c . >> "$GITHUB_OUTPUT" + else + echo 'result=["latest","minimum"]' | jq -c . >> "$GITHUB_OUTPUT" + fi - name: Detect relevant changes id: detect run: | @@ -66,7 +75,7 @@ jobs: strategy: fail-fast: false matrix: - dependency-level: ${{ fromJSON((github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && toJSON(['minimum']) || toJSON(['latest', 'minimum'])) }} + dependency-level: ${{ fromJson(needs.detect-changes.outputs.matrix_array) }} runs-on: ubuntu-22.04 steps: - name: Translate matrix for Ruby and Node versions @@ -153,7 +162,7 @@ jobs: strategy: fail-fast: false matrix: - dependency-level: ${{ fromJSON((github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && toJSON(['minimum']) || toJSON(['latest', 'minimum'])) }} + dependency-level: ${{ fromJson(needs.detect-changes.outputs.matrix_array) }} runs-on: ubuntu-22.04 steps: - name: Translate matrix for Ruby and Node versions diff --git a/.github/workflows/package-js-tests.yml b/.github/workflows/package-js-tests.yml index 880570daca..6ea1d958db 100644 --- a/.github/workflows/package-js-tests.yml +++ b/.github/workflows/package-js-tests.yml @@ -36,6 +36,7 @@ jobs: run_dummy_tests: ${{ steps.detect.outputs.run_dummy_tests }} run_generators: ${{ steps.detect.outputs.run_generators }} has_full_ci_label: ${{ steps.check-label.outputs.result }} + matrix_array: ${{ steps.determine-matrix.outputs.result }} steps: - uses: actions/checkout@v4 with: @@ -45,6 +46,14 @@ jobs: - name: Check for full-ci label id: check-label uses: ./.github/actions/check-full-ci-label + - name: Determine matrix strategy + id: determine-matrix + run: | + if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then + echo 'result=["22"]' | jq -c . >> "$GITHUB_OUTPUT" + else + echo 'result=["22","20"]' | jq -c . >> "$GITHUB_OUTPUT" + fi - name: Detect relevant changes id: detect run: | @@ -71,7 +80,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: ${{ fromJSON((github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && toJSON(['20']) || toJSON(['22', '20'])) }} + node-version: ${{ fromJson(needs.detect-changes.outputs.matrix_array) }} runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 From 5ad8d842f3923ddbbf43f1931bc14e9789dcdacf Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Sun, 16 Nov 2025 16:40:29 -0600 Subject: [PATCH 08/14] fix step output --- .github/workflows/examples.yml | 4 ++-- .github/workflows/gem-tests.yml | 4 ++-- .github/workflows/integration-tests.yml | 4 ++-- .github/workflows/package-js-tests.yml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index f6e66ee8a2..3641754871 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -44,9 +44,9 @@ jobs: id: determine-matrix run: | if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then - echo 'result=["latest"]' | jq -c . >> "$GITHUB_OUTPUT" + echo "result=[\"latest\"]" >> "$GITHUB_OUTPUT" else - echo 'result=["latest","minimum"]' | jq -c . >> "$GITHUB_OUTPUT" + echo "result=[\"latest\",\"minimum\"]" >> "$GITHUB_OUTPUT" fi - name: Detect relevant changes id: detect diff --git a/.github/workflows/gem-tests.yml b/.github/workflows/gem-tests.yml index 2fc7fa4660..28bb0d1623 100644 --- a/.github/workflows/gem-tests.yml +++ b/.github/workflows/gem-tests.yml @@ -48,9 +48,9 @@ jobs: id: determine-matrix run: | if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then - echo 'result=["latest"]' | jq -c . >> "$GITHUB_OUTPUT" + echo "result=[\"latest\"]" >> "$GITHUB_OUTPUT" else - echo 'result=["latest","minimum"]' | jq -c . >> "$GITHUB_OUTPUT" + echo "result=[\"latest\",\"minimum\"]" >> "$GITHUB_OUTPUT" fi - name: Detect relevant changes id: detect diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index eb3d438017..41dd284089 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -46,9 +46,9 @@ jobs: id: determine-matrix run: | if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then - echo 'result=["latest"]' | jq -c . >> "$GITHUB_OUTPUT" + echo "result=[\"latest\"]" >> "$GITHUB_OUTPUT" else - echo 'result=["latest","minimum"]' | jq -c . >> "$GITHUB_OUTPUT" + echo "result=[\"latest\",\"minimum\"]" >> "$GITHUB_OUTPUT" fi - name: Detect relevant changes id: detect diff --git a/.github/workflows/package-js-tests.yml b/.github/workflows/package-js-tests.yml index 6ea1d958db..b8d6ad0311 100644 --- a/.github/workflows/package-js-tests.yml +++ b/.github/workflows/package-js-tests.yml @@ -50,9 +50,9 @@ jobs: id: determine-matrix run: | if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then - echo 'result=["22"]' | jq -c . >> "$GITHUB_OUTPUT" + echo "result=[\"22\"]" >> "$GITHUB_OUTPUT" else - echo 'result=["22","20"]' | jq -c . >> "$GITHUB_OUTPUT" + echo "result=[\"22\",\"20\"]" >> "$GITHUB_OUTPUT" fi - name: Detect relevant changes id: detect From 1155e30d0a66ee20d04f2c148a567fd89c179ba9 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Sun, 16 Nov 2025 17:07:18 -0600 Subject: [PATCH 09/14] CI fixes --- .github/workflows/gem-tests.yml | 10 +++++++++- rakelib/shakapacker_examples.rake | 6 +++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gem-tests.yml b/.github/workflows/gem-tests.yml index 28bb0d1623..886f2a43c2 100644 --- a/.github/workflows/gem-tests.yml +++ b/.github/workflows/gem-tests.yml @@ -70,7 +70,7 @@ jobs: script/ci-changes-detector "$BASE_REF" shell: bash - rspec-package-tests: + basic-gem-tests: needs: detect-changes # Run on master OR when Ruby tests needed on PR if: | @@ -83,6 +83,14 @@ jobs: BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }} runs-on: ubuntu-22.04 steps: + - name: Translate matrix for Ruby and Node versions + id: translate-matrix + run: | + if [ "${{ matrix.dependency-level }}" == "latest" ]; then + echo "ruby-version=3.4" >> "$GITHUB_OUTPUT" + else + echo "ruby-version=3.2" >> "$GITHUB_OUTPUT" + fi - uses: actions/checkout@v4 with: persist-credentials: false diff --git a/rakelib/shakapacker_examples.rake b/rakelib/shakapacker_examples.rake index 165bbfc0d2..acffc4a6ea 100644 --- a/rakelib/shakapacker_examples.rake +++ b/rakelib/shakapacker_examples.rake @@ -36,7 +36,11 @@ namespace :shakapacker_examples do # rubocop:disable Metrics/BlockLength sh_in_dir(example_type.dir, "echo \"gem 'shakapacker', '>= 8.2.0'\" >> #{example_type.gemfile}") bundle_install_in(example_type.dir) sh_in_dir(example_type.dir, "rake shakapacker:install") - sh_in_dir(example_type.dir, example_type.generator_shell_commands) + # TODO: Remove REACT_ON_RAILS_SKIP_VALIDATION after generators start using next release + generator_commands = example_type.generator_shell_commands.map do |cmd| + "REACT_ON_RAILS_SKIP_VALIDATION=true #{cmd}" + end + sh_in_dir(example_type.dir, generator_commands) sh_in_dir(example_type.dir, "npm install") end end From 961d778835385e831f002701958e8defb81b71f5 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Sun, 16 Nov 2025 19:26:06 -0600 Subject: [PATCH 10/14] re-enable build_test_command since generators configure TestHelper --- .../base/base/config/initializers/react_on_rails.rb.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt b/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt index 8015f38971..d77e1702c2 100644 --- a/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt +++ b/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt @@ -26,7 +26,7 @@ ReactOnRails.configure do |config| # - Requires adding ReactOnRails::TestHelper to spec/rails_helper.rb # - See: https://github.com/shakacode/react_on_rails/blob/master/docs/guides/testing-configuration.md # - # config.build_test_command = "RAILS_ENV=test bin/shakapacker" + config.build_test_command = "RAILS_ENV=test bin/shakapacker" ################################################################################ # Advanced Configuration From 209d3e28089e659ba8cf78bf0f4d32ee931e36be Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Sun, 16 Nov 2025 20:17:11 -0600 Subject: [PATCH 11/14] make sure generate_packs runs --- rakelib/shakapacker_examples.rake | 1 + 1 file changed, 1 insertion(+) diff --git a/rakelib/shakapacker_examples.rake b/rakelib/shakapacker_examples.rake index acffc4a6ea..6b2e30b011 100644 --- a/rakelib/shakapacker_examples.rake +++ b/rakelib/shakapacker_examples.rake @@ -42,6 +42,7 @@ namespace :shakapacker_examples do # rubocop:disable Metrics/BlockLength end sh_in_dir(example_type.dir, generator_commands) sh_in_dir(example_type.dir, "npm install") + sh_in_dir(example_type.dir, "bin/rake react_on_rails:generate_packs") end end From 25c43da4c60af15eb27eeaa2b017d26a8168a382 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Sun, 16 Nov 2025 21:03:39 -0600 Subject: [PATCH 12/14] add yarn prefix --- lib/generators/react_on_rails/dev_tests_generator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/generators/react_on_rails/dev_tests_generator.rb b/lib/generators/react_on_rails/dev_tests_generator.rb index 253a2e2476..43b1471566 100644 --- a/lib/generators/react_on_rails/dev_tests_generator.rb +++ b/lib/generators/react_on_rails/dev_tests_generator.rb @@ -50,7 +50,7 @@ def add_yarn_relative_install_script_in_package_json package_json = File.join(destination_root, "package.json") contents = JSON.parse(File.read(package_json)) contents["scripts"] ||= {} - contents["scripts"]["postinstall"] = "yalc link react-on-rails" + contents["scripts"]["postinstall"] = "yarn yalc link react-on-rails" File.open(package_json, "w+") { |f| f.puts JSON.pretty_generate(contents) } end end From eb3f4be6238f269563921f5c247e3a4a26d0d159 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Sun, 16 Nov 2025 21:09:20 -0600 Subject: [PATCH 13/14] add yarn prefix to publish, not link --- .github/workflows/examples.yml | 2 +- lib/generators/react_on_rails/dev_tests_generator.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 3641754871..84e2c7cac3 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -130,7 +130,7 @@ jobs: yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }} sudo yarn global add yalc - name: yalc publish for react-on-rails - run: yalc publish + run: yarn yalc publish - name: Install Ruby Gems for package run: | bundle lock --add-platform 'x86_64-linux' diff --git a/lib/generators/react_on_rails/dev_tests_generator.rb b/lib/generators/react_on_rails/dev_tests_generator.rb index 43b1471566..253a2e2476 100644 --- a/lib/generators/react_on_rails/dev_tests_generator.rb +++ b/lib/generators/react_on_rails/dev_tests_generator.rb @@ -50,7 +50,7 @@ def add_yarn_relative_install_script_in_package_json package_json = File.join(destination_root, "package.json") contents = JSON.parse(File.read(package_json)) contents["scripts"] ||= {} - contents["scripts"]["postinstall"] = "yarn yalc link react-on-rails" + contents["scripts"]["postinstall"] = "yalc link react-on-rails" File.open(package_json, "w+") { |f| f.puts JSON.pretty_generate(contents) } end end From bcf31562fa8d623433d18f50c38b76390041a3a3 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Sun, 16 Nov 2025 21:32:53 -0600 Subject: [PATCH 14/14] reenable auto_load_bundle for generator --- .../base/base/config/initializers/react_on_rails.rb.tt | 2 ++ rakelib/shakapacker_examples.rake | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt b/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt index d77e1702c2..e063171d21 100644 --- a/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt +++ b/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt @@ -28,6 +28,8 @@ ReactOnRails.configure do |config| # config.build_test_command = "RAILS_ENV=test bin/shakapacker" + config.auto_load_bundle = true + config.components_subdirectory = "ror_components" ################################################################################ # Advanced Configuration ################################################################################ diff --git a/rakelib/shakapacker_examples.rake b/rakelib/shakapacker_examples.rake index 6b2e30b011..f43ef45260 100644 --- a/rakelib/shakapacker_examples.rake +++ b/rakelib/shakapacker_examples.rake @@ -42,7 +42,7 @@ namespace :shakapacker_examples do # rubocop:disable Metrics/BlockLength end sh_in_dir(example_type.dir, generator_commands) sh_in_dir(example_type.dir, "npm install") - sh_in_dir(example_type.dir, "bin/rake react_on_rails:generate_packs") + sh_in_dir(example_type.dir, "bundle exec rake react_on_rails:generate_packs") end end