From 2ea925316576c87224213f84215be7c283eb068c Mon Sep 17 00:00:00 2001 From: Gareth Jones <3151613+G-Rath@users.noreply.github.com> Date: Fri, 5 Dec 2025 16:10:51 +1300 Subject: [PATCH 1/6] feat: upgrade to Rails 8.1 --- target_versions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target_versions.yml b/target_versions.yml index 8191b681..92a08e11 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: '8.0' # specify as major.minor +target_rails_major_minor: '8.1' # specify as major.minor # Set this to the minimum version of Ruby that the chosen Rails version supports. minimum_ruby_major_minor: '3.2' From cef8408ae55104f2812095d6d68c35c57e908bb6 Mon Sep 17 00:00:00 2001 From: Gareth Jones <3151613+G-Rath@users.noreply.github.com> Date: Sat, 6 Dec 2025 11:04:48 +1300 Subject: [PATCH 2/6] fix: update matcher --- variants/backend-base/config/environments/production.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/backend-base/config/environments/production.rb b/variants/backend-base/config/environments/production.rb index d4823864..dd08f7c5 100644 --- a/variants/backend-base/config/environments/production.rb +++ b/variants/backend-base/config/environments/production.rb @@ -32,7 +32,7 @@ RUBY gsub_file! "config/environments/production.rb", <<-RUBY, - # Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit. + # Specify outgoing SMTP server. Remember to add smtp/* credentials via bin/rails credentials:edit. # config.action_mailer.smtp_settings = { # user_name: Rails.application.credentials.dig(:smtp, :user_name), # password: Rails.application.credentials.dig(:smtp, :password), From d8539ceb6d00af665e85698b8386ede354d696c7 Mon Sep 17 00:00:00 2001 From: Gareth Jones <3151613+G-Rath@users.noreply.github.com> Date: Sat, 6 Dec 2025 11:17:37 +1300 Subject: [PATCH 3/6] feat: remove some files we don't need --- variants/backend-base/bin/template.rb | 2 ++ variants/backend-base/config/template.rb | 3 +++ 2 files changed, 5 insertions(+) diff --git a/variants/backend-base/bin/template.rb b/variants/backend-base/bin/template.rb index b2952b48..4578078e 100644 --- a/variants/backend-base/bin/template.rb +++ b/variants/backend-base/bin/template.rb @@ -2,3 +2,5 @@ copy_file "variants/backend-base/bin/#{bin}", "bin/#{bin}", force: true chmod "bin/#{bin}", "+x" end + +remove_file "bin/ci" diff --git a/variants/backend-base/config/template.rb b/variants/backend-base/config/template.rb index 5cb2bcf1..ad86dc56 100644 --- a/variants/backend-base/config/template.rb +++ b/variants/backend-base/config/template.rb @@ -6,6 +6,9 @@ remove_file "config/master.key" remove_file "config/credentials.yml.enc" +remove_file "config/ci" +remove_file "config/bundler-audit.yml" + copy_file "variants/backend-base/config/puma.rb", "config/puma.rb", force: true copy_file "variants/backend-base/config/initializers/generators.rb", "config/initializers/generators.rb" From 5d126a860b6f9751e2ddf89e4bc8f9d186b72141 Mon Sep 17 00:00:00 2001 From: Gareth Jones <3151613+G-Rath@users.noreply.github.com> Date: Sat, 6 Dec 2025 11:18:12 +1300 Subject: [PATCH 4/6] fix: remove stray newline --- variants/backend-base/config/environments/staging.rb.tt | 1 - 1 file changed, 1 deletion(-) diff --git a/variants/backend-base/config/environments/staging.rb.tt b/variants/backend-base/config/environments/staging.rb.tt index 3fa96ba0..f6399a32 100644 --- a/variants/backend-base/config/environments/staging.rb.tt +++ b/variants/backend-base/config/environments/staging.rb.tt @@ -4,7 +4,6 @@ require_relative "production" Rails.application.configure do - config.action_mailer.default_url_options = { host: "<%= TEMPLATE_CONFIG.staging_hostname %>", protocol: "https" From 90f6856695b194eee4863db1d1703cb7d689c2d5 Mon Sep 17 00:00:00 2001 From: Gareth Jones <3151613+G-Rath@users.noreply.github.com> Date: Sat, 6 Dec 2025 11:18:33 +1300 Subject: [PATCH 5/6] fix: assume that `config/storage.yml` always exists --- variants/backend-base/config/template.rb | 36 +++++++++++------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/variants/backend-base/config/template.rb b/variants/backend-base/config/template.rb index ad86dc56..2ca886d8 100644 --- a/variants/backend-base/config/template.rb +++ b/variants/backend-base/config/template.rb @@ -60,23 +60,21 @@ root "home#index" EO_ROUTES -if File.exist? "config/storage.yml" - gsub_file! "config/storage.yml", /# service: S3/ do - <<~YAML - # service: S3 - # upload: - # # TEAM DECISION REQUIRED: The correct caching duration for files - # # stored by Active Storage is project dependent so you should discuss - # # this with you team if you don't feel able to make the decision solo. - # # - # # These options are are not well documented in ActiveStorage. They - # # are passed directly to the S3 SDK. Details: - # # https://github.com/rails/rails/blob/master/activestorage/lib/active_storage/service/s3_service.rb - # # - # # * private: the browser should cache but intermediate proxies (e.g. CDNs) should not - # # * max-age: the number of seconds to cache the file for - # # - # cache_control: 'private, max-age=<%= 365.days.seconds %>' - YAML - end +gsub_file! "config/storage.yml", /# service: S3/ do + <<~YAML + # service: S3 + # upload: + # # TEAM DECISION REQUIRED: The correct caching duration for files + # # stored by Active Storage is project dependent so you should discuss + # # this with you team if you don't feel able to make the decision solo. + # # + # # These options are are not well documented in ActiveStorage. They + # # are passed directly to the S3 SDK. Details: + # # https://github.com/rails/rails/blob/master/activestorage/lib/active_storage/service/s3_service.rb + # # + # # * private: the browser should cache but intermediate proxies (e.g. CDNs) should not + # # * max-age: the number of seconds to cache the file for + # # + # cache_control: 'private, max-age=<%= 365.days.seconds %>' + YAML end From 80ce8482e28f399f8e1c4a8efce93cc8e6a02f85 Mon Sep 17 00:00:00 2001 From: Gareth Jones <3151613+G-Rath@users.noreply.github.com> Date: Sat, 6 Dec 2025 11:19:03 +1300 Subject: [PATCH 6/6] refactor: move removing of bin files to `bin/template.rb` --- variants/backend-base/app/template.rb | 2 -- variants/backend-base/bin/template.rb | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/variants/backend-base/app/template.rb b/variants/backend-base/app/template.rb index f5a38d8b..5d7560cc 100644 --- a/variants/backend-base/app/template.rb +++ b/variants/backend-base/app/template.rb @@ -35,5 +35,3 @@ remove_dir ".github/" remove_dir "app/views/pwa" -remove_file "bin/dev" -remove_file "bin/thrust" diff --git a/variants/backend-base/bin/template.rb b/variants/backend-base/bin/template.rb index 4578078e..4c6cdfdc 100644 --- a/variants/backend-base/bin/template.rb +++ b/variants/backend-base/bin/template.rb @@ -4,3 +4,5 @@ end remove_file "bin/ci" +remove_file "bin/dev" +remove_file "bin/thrust"