From 91219b14fa1d704af479b0b72df3a76cce22ad9d Mon Sep 17 00:00:00 2001 From: Eoin Kelly Date: Fri, 22 Nov 2024 10:30:12 +1300 Subject: [PATCH 01/12] WIP --- README.md | 6 +- target_versions.yml | 4 +- template.rb | 5 + variants/backend-base/Gemfile.tt | 20 ++- .../config/environments/production.rb | 126 ++++++++---------- variants/bullet/template.rb | 2 +- 6 files changed, 88 insertions(+), 75 deletions(-) diff --git a/README.md b/README.md index a4267a35..16d99b43 100644 --- a/README.md +++ b/README.md @@ -193,7 +193,7 @@ $ wget https://raw.githubusercontent.com/ackama/rails-template/main/ackama_rails # Create a new app using the template. Template options will be taken from # ./ackama_rails_template.config.yml -$ rails new my_app --no-rc --database=postgresql --skip-javascript --skip-docker --template=https://raw.githubusercontent.com/ackama/rails-template/main/template.rb +$ rails new my_app --no-rc --database=postgresql --skip-javascript --skip-docker --skip-kamal --skip-solid --template=https://raw.githubusercontent.com/ackama/rails-template/main/template.rb # Example 2 # ######### @@ -201,7 +201,7 @@ $ rails new my_app --no-rc --database=postgresql --skip-javascript --skip-docker # Create a custom config YAML file, saving as ./my_custom_config.yml # Template options will be taken from ../my_custom_config.yml (relative to the new app directory) -$ CONFIG_PATH=../my_custom_config.yml rails new my_app --no-rc --database=postgresql --skip-javascript --skip-docker --template=https://raw.githubusercontent.com/ackama/rails-template/main/template.rb +$ CONFIG_PATH=../my_custom_config.yml rails new my_app --no-rc --database=postgresql --skip-javascript --skip-docker --skip-kamal --skip-solid --template=https://raw.githubusercontent.com/ackama/rails-template/main/template.rb ``` Here are some additional options you can add to this command. We don't @@ -230,6 +230,8 @@ To make this the default Rails application template on your system, create a -d postgresql --skip-javascript --skip-docker +--skip-kamal +--skip-solid -m https://raw.githubusercontent.com/ackama/rails-template/main/template.rb ``` diff --git a/target_versions.yml b/target_versions.yml index eadfffcc..8191b681 100644 --- a/target_versions.yml +++ b/target_versions.yml @@ -2,7 +2,7 @@ # # This is stored in a separate file so we can share it between the template and # our CI configuration. -target_rails_major_minor: '7.2' # specify as major.minor +target_rails_major_minor: '8.0' # specify as major.minor # Set this to the minimum version of Ruby that the chosen Rails version supports. -minimum_ruby_major_minor: '3.1' +minimum_ruby_major_minor: '3.2' diff --git a/template.rb b/template.rb index 9092c0a7..d33dc310 100644 --- a/template.rb +++ b/template.rb @@ -147,6 +147,8 @@ def apply_template! # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Met # but also after `shakapacker:install` and after Rails has initialized the git # repo after_bundle do # rubocop:disable Metrics/BlockLength + TERMINAL.puts_header "START after_bundle block" + require_package_json_gem apply "variants/backend-base/lib/template.rb" @@ -157,6 +159,7 @@ def apply_template! # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Met # its own `spec/` directory remove_dir "test" + TERMINAL.puts_header "START bin/setup" run_with_clean_bundler_env "bin/setup" apply "variants/frontend-base/template.rb" @@ -249,6 +252,8 @@ def apply_template! # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Met # Run prettier one last time to ensure that everything is formatted apply_prettier_all_over + + TERMINAL.puts_header "END after_bundle block" end end diff --git a/variants/backend-base/Gemfile.tt b/variants/backend-base/Gemfile.tt index c8069048..3aabc4b2 100644 --- a/variants/backend-base/Gemfile.tt +++ b/variants/backend-base/Gemfile.tt @@ -6,7 +6,7 @@ ruby File.read(".ruby-version") gem "rails", "<%= Rails.version %>" gem "puma" gem "pg" -gem 'dotenv-rails', require: "dotenv/load" +gem "dotenv-rails", require: "dotenv/load" gem "bootsnap", require: false gem "shakapacker" @@ -15,10 +15,21 @@ gem "okcomputer" gem "sentry-ruby" gem "sentry-rails" +# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] +# gem "bcrypt", "~> 3.1.7" + +# Use the database-backed adapters for Rails.cache, Active Job, and Action Cable +# gem "solid_cache" +# gem "solid_queue" +# gem "solid_cable" + +# Deploy this application anywhere as a Docker container [https://kamal-deploy.org] +gem "kamal", require: false + gem "rack-canonical-host" -# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] -gem "sprockets-rails" +# The modern asset pipeline for Rails [https://github.com/rails/propshaft] +gem "propshaft" # Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev] gem "turbo-rails" @@ -32,6 +43,9 @@ gem "stimulus-rails" # Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] # gem "kredis" +# Add HTTP asset caching/compression and X-Sendfile acceleration to Puma [https://github.com/basecamp/thruster/] +# gem "thruster", require: false + # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] # gem "image_processing", "~> 1.2" diff --git a/variants/backend-base/config/environments/production.rb b/variants/backend-base/config/environments/production.rb index 159c9fc8..884913fd 100644 --- a/variants/backend-base/config/environments/production.rb +++ b/variants/backend-base/config/environments/production.rb @@ -1,13 +1,3 @@ -insert_into_file! "config/environments/production.rb", - after: /# config\.assets\.css_compressor = :sass\n/ do - <<-RUBY - - # Disable minification since it adds a *huge* amount of time to precompile. - # Anyway, gzip alone gets us about 70% of the benefits of minify+gzip. - config.assets.css_compressor = false - RUBY -end - gsub_file! "config/environments/production.rb", "config.force_ssl = true", <<~RUBY @@ -46,64 +36,66 @@ 'ENV.fetch("RAILS_LOG_LEVEL", "info")', 'ENV.fetch("RAILS_LOG_LEVEL", ENV.fetch("LOG_LEVEL", "info"))' -gsub_file! "config/environments/production.rb", - "ActiveSupport::Logger.new(STDOUT)", - "ActiveSupport::Logger.new($stdout)" +# insert_into_file "config/environments/production.rb", +# after: /.*config\.public_file_server\.enabled.*\n/ do +# <<~'RUBY' -insert_into_file! "config/environments/production.rb", - after: /.*config\.public_file_server\.enabled.*\n/ do - <<~'RUBY' +# # Ensure that Rails sets appropriate caching headers on static assets if +# # Rails is serving static assets in production e.g. on Heroku +# # +# # Overview of Cache-control values: +# # +# # max-age= +# # The maximum amount of time a resource is considered fresh. +# # +# # s-maxage= +# # Overrides max-age or the Expires header, but only for shared +# # caches (e.g., proxies). Ignored by private caches. +# # +# # More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control +# # +# # Our Cache-Control header: +# # +# # * It tells all caches (both proxies like Cloudflare and the users web +# # browser) that the asset can be cached. +# # * It tells shared caches (e.g. Cloudflare) that they can cache it for 365 days +# # * It tells browsers that they should cache for 365 days +# # +# # Cloudflare will respect s-maxage if it is set so change that value if you +# # want Cloudflare to cache differently than then browser. +# # +# config.public_file_server.headers = { +# "Cache-Control" => "public, s-maxage=#{365.days.seconds}, max-age=#{365.days.seconds}" +# } - # Ensure that Rails sets appropriate caching headers on static assets if - # Rails is serving static assets in production e.g. on Heroku - # - # Overview of Cache-control values: - # - # max-age= - # The maximum amount of time a resource is considered fresh. - # - # s-maxage= - # Overrides max-age or the Expires header, but only for shared - # caches (e.g., proxies). Ignored by private caches. - # - # More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control - # - # Our Cache-Control header: - # - # * It tells all caches (both proxies like Cloudflare and the users web - # browser) that the asset can be cached. - # * It tells shared caches (e.g. Cloudflare) that they can cache it for 365 days - # * It tells browsers that they should cache for 365 days - # - # Cloudflare will respect s-maxage if it is set so change that value if you - # want Cloudflare to cache differently than then browser. - # - config.public_file_server.headers = { - "Cache-Control" => "public, s-maxage=#{365.days.seconds}, max-age=#{365.days.seconds}" - } +# ######################### - RUBY -end +# # Rails 8 default: +# # config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" } -insert_into_file! "config/environments/production.rb", - after: /.*config.cache_store = :mem_cache_store\n/ do - <<~RUBY - if ENV.fetch("RAILS_CACHE_REDIS_URL", nil) - config.cache_store = :redis_cache_store, { - url: ENV.fetch("RAILS_CACHE_REDIS_URL"), - ## - # Configuring a connection pool for Redis as Rails cache is documented in: - # - # * https://edgeguides.rubyonrails.org/caching_with_rails.html#connection-pool-options - # - # but some more details are available in: - # - # * https://github.com/rails/rails/blob/a5d1628c79ab89dfae57ec1e1aeca467e29de188/activesupport/lib/active_support/cache.rb#L168-L173 - # * https://github.com/rails/rails/blob/9b4aef4be3dc58eb08f694387857b52be8050954/activesupport/lib/active_support/cache/redis_cache_store.rb#L185-L192 - # - pool_size: Integer(ENV.fetch("RAILS_MAX_THREADS", 5)), # number of connections **per puma process** - pool_timeout: 5 # num seconds to wait for a connection - } - end - RUBY -end +# RUBY +# end + +# TODO: this won't match anything because 8 uses solid_cache +# insert_into_file! "config/environments/production.rb", + # after: /.*config.cache_store = :mem_cache_store\n/ do +# <<~RUBY +# if ENV.fetch("RAILS_CACHE_REDIS_URL", nil) +# config.cache_store = :redis_cache_store, { +# url: ENV.fetch("RAILS_CACHE_REDIS_URL"), +# ## +# # Configuring a connection pool for Redis as Rails cache is documented in: +# # +# # * https://edgeguides.rubyonrails.org/caching_with_rails.html#connection-pool-options +# # +# # but some more details are available in: +# # +# # * https://github.com/rails/rails/blob/a5d1628c79ab89dfae57ec1e1aeca467e29de188/activesupport/lib/active_support/cache.rb#L168-L173 +# # * https://github.com/rails/rails/blob/9b4aef4be3dc58eb08f694387857b52be8050954/activesupport/lib/active_support/cache/redis_cache_store.rb#L185-L192 +# # +# pool_size: Integer(ENV.fetch("RAILS_MAX_THREADS", 5)), # number of connections **per puma process** +# pool_timeout: 5 # num seconds to wait for a connection +# } +# end +# RUBY +# end diff --git a/variants/bullet/template.rb b/variants/bullet/template.rb index a65ee32d..30830bf1 100644 --- a/variants/bullet/template.rb +++ b/variants/bullet/template.rb @@ -1,6 +1,6 @@ insert_into_file! "Gemfile", after: /^group :development, :test do\n/ do <<~GEMS - gem "bullet" + gem "bullet", ">= 8.0" # Rails 8+ requires Bullet 8+ GEMS end From 112df5775a4773fca171f46fda6fa77dcba22b63 Mon Sep 17 00:00:00 2001 From: Eoin Kelly Date: Fri, 22 Nov 2024 10:37:09 +1300 Subject: [PATCH 02/12] Add new skip flags to CI --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d59a0e1..1974c8e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -203,7 +203,8 @@ jobs: # "react", "sidekiq" etc. APP_NAME: ${{ matrix.variant.name }}-demo CONFIG_PATH: ${{ matrix.variant.config_path }} - SKIPS: '--skip-javascript --skip-docker ${{ matrix.variant.skips }}' + # prettier-ignore + SKIPS: '--skip-javascript --skip-docker --skip-kamal --skip-solid ${{ matrix.variant.skips }}' PGUSER: postgres PGPASSWORD: postgres PGHOST: localhost From 3e1f2eac98c40698c7cb2bfef259f8c4aae062e3 Mon Sep 17 00:00:00 2001 From: Eoin Kelly Date: Fri, 22 Nov 2024 16:36:30 +1300 Subject: [PATCH 03/12] Tidy up --- variants/backend-base/Gemfile.tt | 11 -- .../config/environments/production.rb | 116 +++++++++--------- 2 files changed, 55 insertions(+), 72 deletions(-) diff --git a/variants/backend-base/Gemfile.tt b/variants/backend-base/Gemfile.tt index 3aabc4b2..5c0a2dd0 100644 --- a/variants/backend-base/Gemfile.tt +++ b/variants/backend-base/Gemfile.tt @@ -18,14 +18,6 @@ gem "sentry-rails" # Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] # gem "bcrypt", "~> 3.1.7" -# Use the database-backed adapters for Rails.cache, Active Job, and Action Cable -# gem "solid_cache" -# gem "solid_queue" -# gem "solid_cable" - -# Deploy this application anywhere as a Docker container [https://kamal-deploy.org] -gem "kamal", require: false - gem "rack-canonical-host" # The modern asset pipeline for Rails [https://github.com/rails/propshaft] @@ -43,9 +35,6 @@ gem "stimulus-rails" # Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] # gem "kredis" -# Add HTTP asset caching/compression and X-Sendfile acceleration to Puma [https://github.com/basecamp/thruster/] -# gem "thruster", require: false - # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] # gem "image_processing", "~> 1.2" diff --git a/variants/backend-base/config/environments/production.rb b/variants/backend-base/config/environments/production.rb index 884913fd..883b2491 100644 --- a/variants/backend-base/config/environments/production.rb +++ b/variants/backend-base/config/environments/production.rb @@ -36,66 +36,60 @@ 'ENV.fetch("RAILS_LOG_LEVEL", "info")', 'ENV.fetch("RAILS_LOG_LEVEL", ENV.fetch("LOG_LEVEL", "info"))' -# insert_into_file "config/environments/production.rb", -# after: /.*config\.public_file_server\.enabled.*\n/ do -# <<~'RUBY' +# TODO: https://github.com/ackama/rails-template/issues/569 +insert_into_file "config/environments/production.rb", + after: /.*config\.public_file_server\.enabled.*\n/ do + <<~'RUBY' -# # Ensure that Rails sets appropriate caching headers on static assets if -# # Rails is serving static assets in production e.g. on Heroku -# # -# # Overview of Cache-control values: -# # -# # max-age= -# # The maximum amount of time a resource is considered fresh. -# # -# # s-maxage= -# # Overrides max-age or the Expires header, but only for shared -# # caches (e.g., proxies). Ignored by private caches. -# # -# # More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control -# # -# # Our Cache-Control header: -# # -# # * It tells all caches (both proxies like Cloudflare and the users web -# # browser) that the asset can be cached. -# # * It tells shared caches (e.g. Cloudflare) that they can cache it for 365 days -# # * It tells browsers that they should cache for 365 days -# # -# # Cloudflare will respect s-maxage if it is set so change that value if you -# # want Cloudflare to cache differently than then browser. -# # -# config.public_file_server.headers = { -# "Cache-Control" => "public, s-maxage=#{365.days.seconds}, max-age=#{365.days.seconds}" -# } - -# ######################### - -# # Rails 8 default: -# # config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" } - -# RUBY -# end + # Ensure that Rails sets appropriate caching headers on static assets if + # Rails is serving static assets in production e.g. on Heroku + # + # Overview of Cache-control values: + # + # max-age= + # The maximum amount of time a resource is considered fresh. + # + # s-maxage= + # Overrides max-age or the Expires header, but only for shared + # caches (e.g., proxies). Ignored by private caches. + # + # More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control + # + # Our Cache-Control header: + # + # * It tells all caches (both proxies like Cloudflare and the users web + # browser) that the asset can be cached. + # * It tells shared caches (e.g. Cloudflare) that they can cache it for 365 days + # * It tells browsers that they should cache for 365 days + # + # Cloudflare will respect s-maxage if it is set so change that value if you + # want Cloudflare to cache differently than then browser. + # + config.public_file_server.headers = { + "Cache-Control" => "public, s-maxage=#{365.days.seconds}, max-age=#{365.days.seconds}" + } + RUBY +end -# TODO: this won't match anything because 8 uses solid_cache -# insert_into_file! "config/environments/production.rb", - # after: /.*config.cache_store = :mem_cache_store\n/ do -# <<~RUBY -# if ENV.fetch("RAILS_CACHE_REDIS_URL", nil) -# config.cache_store = :redis_cache_store, { -# url: ENV.fetch("RAILS_CACHE_REDIS_URL"), -# ## -# # Configuring a connection pool for Redis as Rails cache is documented in: -# # -# # * https://edgeguides.rubyonrails.org/caching_with_rails.html#connection-pool-options -# # -# # but some more details are available in: -# # -# # * https://github.com/rails/rails/blob/a5d1628c79ab89dfae57ec1e1aeca467e29de188/activesupport/lib/active_support/cache.rb#L168-L173 -# # * https://github.com/rails/rails/blob/9b4aef4be3dc58eb08f694387857b52be8050954/activesupport/lib/active_support/cache/redis_cache_store.rb#L185-L192 -# # -# pool_size: Integer(ENV.fetch("RAILS_MAX_THREADS", 5)), # number of connections **per puma process** -# pool_timeout: 5 # num seconds to wait for a connection -# } -# end -# RUBY -# end +insert_into_file! "config/environments/production.rb", + after: /.*config.cache_store = :mem_cache_store\n/ do + <<~RUBY + if ENV.fetch("RAILS_CACHE_REDIS_URL", nil) + config.cache_store = :redis_cache_store, { + url: ENV.fetch("RAILS_CACHE_REDIS_URL"), + ## + # Configuring a connection pool for Redis as Rails cache is documented in: + # + # * https://edgeguides.rubyonrails.org/caching_with_rails.html#connection-pool-options + # + # but some more details are available in: + # + # * https://github.com/rails/rails/blob/a5d1628c79ab89dfae57ec1e1aeca467e29de188/activesupport/lib/active_support/cache.rb#L168-L173 + # * https://github.com/rails/rails/blob/9b4aef4be3dc58eb08f694387857b52be8050954/activesupport/lib/active_support/cache/redis_cache_store.rb#L185-L192 + # + pool_size: Integer(ENV.fetch("RAILS_MAX_THREADS", 5)), # number of connections **per puma process** + pool_timeout: 5 # num seconds to wait for a connection + } + end + RUBY +end From 8a291fd27d0a3ff9a1890d6093f88707ab08968c Mon Sep 17 00:00:00 2001 From: Eoin Kelly Date: Fri, 22 Nov 2024 16:44:12 +1300 Subject: [PATCH 04/12] Make CI easier to read --- .github/workflows/ci.yml | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1974c8e5..bff4ac18 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: - name: Run Rubocop run: bundle exec rubocop - test_generated_apps: + apps: # GitHub UI truncates job names so keep this short permissions: contents: read runs-on: ubuntu-latest @@ -82,21 +82,22 @@ jobs: js_package_manager: - name: npm installer: npm - - name: yarn_berry - installer: yarn - linker: pnp - - name: yarn_berry - installer: yarn - linker: node-modules - - name: yarn_berry - installer: yarn - linker: pnpm - - name: yarn_classic - installer: yarn - - name: pnpm - installer: pnpm - - name: bun - installer: bun + # TODO: temp disable to make CI easier to grok + # - name: yarn_berry + # installer: yarn + # linker: pnp + # - name: yarn_berry + # installer: yarn + # linker: node-modules + # - name: yarn_berry + # installer: yarn + # linker: pnpm + # - name: yarn_classic + # installer: yarn + # - name: pnpm + # installer: pnpm + # - name: bun + # installer: bun variant: - name: defaults config_path: 'ackama_rails_template.config.yml' From e069bdc23abbd423a750fd63876b2475e5976108 Mon Sep 17 00:00:00 2001 From: Eoin Kelly Date: Fri, 22 Nov 2024 16:48:44 +1300 Subject: [PATCH 05/12] Add header to improve debugging of output --- variants/accessibility/Gemfile.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/variants/accessibility/Gemfile.rb b/variants/accessibility/Gemfile.rb index b8f10567..9f049c22 100644 --- a/variants/accessibility/Gemfile.rb +++ b/variants/accessibility/Gemfile.rb @@ -1,3 +1,5 @@ +TERMINAL.puts_header "Installing accessibility checking gems" + insert_into_file! "Gemfile", after: /gem "selenium-webdriver"\n/ do <<~GEMS From a7d49661d45287db042b1ea73fc5cd8865253433 Mon Sep 17 00:00:00 2001 From: Eoin Kelly Date: Fri, 22 Nov 2024 16:59:14 +1300 Subject: [PATCH 06/12] See if disabling bundler cache fixes odd errors in CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bff4ac18..3309806f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -184,7 +184,7 @@ jobs: - name: Install Ruby and Bundler uses: ruby/setup-ruby@v1 with: - bundler-cache: true + bundler-cache: false ruby-version: 'ruby' - name: Setup git for committing From ac02e651174fc19596890dc9a044aff0e83f3fde Mon Sep 17 00:00:00 2001 From: Eoin Kelly Date: Fri, 22 Nov 2024 17:02:08 +1300 Subject: [PATCH 07/12] Attempt to fix CI issue --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3309806f..ec795b99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -184,8 +184,8 @@ jobs: - name: Install Ruby and Bundler uses: ruby/setup-ruby@v1 with: - bundler-cache: false - ruby-version: 'ruby' + bundler-cache: true + ruby-version: 3.3.4 # 'ruby' - name: Setup git for committing run: | From af43abdd2d5c4a19653b0ddda1648ba1211bda89 Mon Sep 17 00:00:00 2001 From: Eoin Kelly Date: Fri, 22 Nov 2024 17:07:01 +1300 Subject: [PATCH 08/12] Try using latest ruby again in CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec795b99..bff4ac18 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -185,7 +185,7 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: true - ruby-version: 3.3.4 # 'ruby' + ruby-version: 'ruby' - name: Setup git for committing run: | From c43ffdddcac426a9c6305cd9a3c706983343e029 Mon Sep 17 00:00:00 2001 From: Eoin Kelly Date: Fri, 22 Nov 2024 17:10:27 +1300 Subject: [PATCH 09/12] Try ruby 3.3.5 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bff4ac18..47160660 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -185,7 +185,7 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: true - ruby-version: 'ruby' + ruby-version: 3.3.5 # 'ruby' - name: Setup git for committing run: | From c0da0e3774ccd0463d35c79d78d1814939bbc1b4 Mon Sep 17 00:00:00 2001 From: Eoin Kelly Date: Fri, 22 Nov 2024 17:13:36 +1300 Subject: [PATCH 10/12] Try 3.3.4 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47160660..ec795b99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -185,7 +185,7 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: true - ruby-version: 3.3.5 # 'ruby' + ruby-version: 3.3.4 # 'ruby' - name: Setup git for committing run: | From 824c24965efa7807c38886ab49cb2362e79e35c6 Mon Sep 17 00:00:00 2001 From: Eoin Kelly Date: Fri, 22 Nov 2024 17:25:30 +1300 Subject: [PATCH 11/12] Go back to latest ruby --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec795b99..bff4ac18 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -185,7 +185,7 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: true - ruby-version: 3.3.4 # 'ruby' + ruby-version: 'ruby' - name: Setup git for committing run: | From 7d4d7b5b51cc3938343a891c5b51f6f4a467e4ad Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Fri, 21 Mar 2025 10:28:53 +1300 Subject: [PATCH 12/12] refactor: use bang versions --- variants/backend-base/config/environments/production.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/variants/backend-base/config/environments/production.rb b/variants/backend-base/config/environments/production.rb index 883b2491..492db083 100644 --- a/variants/backend-base/config/environments/production.rb +++ b/variants/backend-base/config/environments/production.rb @@ -37,8 +37,8 @@ 'ENV.fetch("RAILS_LOG_LEVEL", ENV.fetch("LOG_LEVEL", "info"))' # TODO: https://github.com/ackama/rails-template/issues/569 -insert_into_file "config/environments/production.rb", - after: /.*config\.public_file_server\.enabled.*\n/ do +insert_into_file! "config/environments/production.rb", + after: /.*config\.public_file_server\.enabled.*\n/ do <<~'RUBY' # Ensure that Rails sets appropriate caching headers on static assets if