Repository navigation
Upgrade Rails from 7.0.5 to 8.0.5 - #530
mcfiredrill with Copilot wants to merge 4 commits into
Conversation
- Update Gemfile: rails 8.0.5, rspec-rails 7.x, active_model_serializers 0.10.14+, exception_notification 5.0, kt-paperclip 7.x, remove spring/headless - Modernize config files: use require_relative, __dir__ patterns - Update environment configs: cache_classes → enable_reloading, show_exceptions = false → :none - Add config.load_defaults 7.0 and timezone deprecation fix - Convert all enum declarations to new positional argument syntax (Rails 8) - Replace Rails.application.secrets with ENV vars - Fix Devise::TestHelpers → Devise::Test::ControllerHelpers in specs - Update fixture_path to fixture_paths (plural) - Remove bin/spring Agent-Logs-Url: https://github.com/datafruits/streampusher-api/sessions/4c3865e2-e9cd-417d-803f-2a0895191055 Co-authored-by: mcfiredrill <66243+mcfiredrill@users.noreply.github.com>
|
@copilot fix the failing tests |
…ions The original app had no config.load_defaults, so belongs_to associations were never required by default. Adding config.load_defaults 7.0 activated belongs_to_required_by_default=true, causing Radio.find_or_create_by! in db/seeds to fail because default_playlist is created via after_create callback. Instead, explicitly set belongs_to_required_by_default=false to preserve the original behavior. Agent-Logs-Url: https://github.com/datafruits/streampusher-api/sessions/a3a06d8c-9a92-47eb-ba62-c24f5192a459 Co-authored-by: mcfiredrill <66243+mcfiredrill@users.noreply.github.com>
Agent-Logs-Url: https://github.com/datafruits/streampusher-api/sessions/a3a06d8c-9a92-47eb-ba62-c24f5192a459 Co-authored-by: mcfiredrill <66243+mcfiredrill@users.noreply.github.com>
The CI failure was caused by Fixed in Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
tests are still failing @copilot ArgumentError: User model aliases /home/runner/work/streampusher-api/streampusher-api/vendor/bundle/ruby/3.2.0/gems/activerecord-8.0.5/lib/active_record/attribute_methods.rb:91:in `alias_attribute_method_definition' |
…ments Rails 8 validates that alias_attribute targets are real DB attributes. ActiveStorage's has_one_attached creates methods, not DB columns, so alias_attribute fails. Replace with alias_method for: - User: avatar, image (→ as_image), thumb_avatar_url (→ thumb_image_url) - ScheduledShow: image, image= (→ as_image, as_image=) - ShowSeries: image (→ as_image), moved after has_one_attached declaration Agent-Logs-Url: https://github.com/datafruits/streampusher-api/sessions/3e797b92-f1d3-4be1-aa52-18043bf0c94c Co-authored-by: mcfiredrill <66243+mcfiredrill@users.noreply.github.com>
Fixed in Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Upgrades the app to Rails 8.0.5 from 7.0.5, addressing all breaking changes and deprecated APIs.
Gem updates
rails7.0.5 → 8.0.5rspec-rails~3.5 → ~7.0active_model_serializers~0.10.0 → ~0.10.14 (drops< 7.1upper bound)exception_notificationswitched frommcfiredrillfork to official gem 5.0 (supports Rails 7.1–9)kt-paperclip~6.4 → ~7.0spring,headless,selenium-webdriver < 3.0pinRails 8 breaking changes
Rails.application.secrets— replaced 5 usages across 4 files with directENV[]access (secrets.yml was already reading from ENV in production anyway)cache_classes→enable_reloading(inverted) in all environment configsshow_exceptions = false→show_exceptions = :noneDevise::TestHelpers→Devise::Test::ControllerHelpersfixture_path→fixture_pathsalias_attributefor non-DB attributes — Rails 8 now validates thatalias_attributetargets are real DB columns. Replaced withalias_methodfor ActiveStorage attachment aliases (as_image) in User, ScheduledShow, and ShowSeries models.Config modernization
require_relative/__dir__instead ofFile.expand_path(__FILE__)config.active_record.belongs_to_required_by_default = falseto preserve original behavior (the app was built withoutconfig.load_defaults, sobelongs_toassociations were never required by default)config.active_support.to_time_preserves_timezone = :zoneto silence deprecationDeployment notes
config/secrets.ymlis no longer referenced in code;LIQ_SECRETandSTEREO_TOOL_KEYmust be in ENVexception_notificationfork's only delta was a Discord Content-Type header for the Slack notifier — verify Discord error webhooks still work after deploy