From 54661f01fecc3056d91076335b0155bc5084fa24 Mon Sep 17 00:00:00 2001 From: dominikp Date: Sat, 10 May 2025 00:46:36 +0200 Subject: [PATCH 1/4] doc(redmine6): create v15 page with redmine 6 upgrade notes --- docs/Major_releases/v15.md | 157 +++++++++++++++++++++++++++++++++++++ toc.json | 9 +++ 2 files changed, 166 insertions(+) create mode 100644 docs/Major_releases/v15.md diff --git a/docs/Major_releases/v15.md b/docs/Major_releases/v15.md new file mode 100644 index 0000000..26cde07 --- /dev/null +++ b/docs/Major_releases/v15.md @@ -0,0 +1,157 @@ +# Version 15 + +## Most impactful changes + +- Redmine upgrade to 6 version +- Hard switch to using Zeitwerk + +---- + +## Redmine 6 Upgrade + +This document outlines the most impactful changes and deprecations introduced in the Redmine 6 upgrade. It is intended +for developers and maintainers who need to understand the implications of these changes on their existing codebases. + +### Major Framework Upgrades + +- ruby `">= 3.3.1"` → `">= 3.3.1", "< 3.4.0"` + - Added upper bound to Ruby version + +- rails `"~> 6.1.7.10"` → `"~> 7.2.2.1"` + - Major framework upgrade +- rack `"~> 2.2.3"` → `"~> 3.1.3"` +- acts-as-taggable-on `"~> 7.0.0"` → `"~> 12.0.0"` + - ActiveRecord dependency +- acts_as_paranoid `"~> 0.7.0"` → `"~> 0.10.3"` + - ActiveSupport dependency + +### Breaking Changes + +#### 1. Aliasing Changes + +**Before:** + +```ruby +alias_attribute :host_name, :host +``` + +**After:** + +```ruby +alias_method :host_name, :host +``` + +- `alias_attribute` is now reserved for actual attributes +- Use `alias_method` for methods or non-attributes + +#### 2. Serialization Changes + +**Before:** + +```ruby +serialize :settings, Hash +serialize :data, Array +``` + +**After:** + +```ruby +serialize :settings, type: Hash +serialize :settings, coder: JSON +``` + +- Use `type:` parameter instead of direct class +- For complex objects, use `coder:` parameter with a serializer class + +#### 3. ActiveSupport Deprecation Warnings + +**Before:** + +```ruby +ActiveSupport::Deprecation.warn("This method is deprecated") +``` + +**After:** + +```ruby +ActiveSupport.deprecator.warn("This method is deprecated") +``` + +- Changed from class method to instance method via the global deprecator + +#### 4. Asset Management + +**Before:** + +```ruby +stylesheet_link_tag 'alerts', plugin: 'easy_alerts' +``` + +**After:** + +```ruby +stylesheet_link_tag 'alerts' +``` + +- Removed plugin specification from asset helpers +- Asset paths must be properly registered in initializers: + +```ruby +Rails.application.configure do + asset_paths = EasyAssets.plugin_asset_paths("plugins/path/to/plugin") + config.assets.paths.concat asset_paths + config.assets.precompile << "your_asset.css" +end +``` + +#### 5. Default Timezone Access + +**Before:** + +```ruby +ActiveRecord::Base.default_timezone == :utc +``` + +**After:** + +```ruby +ActiveRecord.default_timezone == :utc +``` + +- Default timezone now accessed through ActiveRecord instead of the class + +### Warnings / Deprecations + +Deprecated but not yet removed in Rails 7.2. + +#### 1. Enum Declaration Changes + +**Before:** + +```ruby +enum status: [:pending, :active], _prefix: true +``` + +**After:** + +```ruby +enum :status, [:pending, :active], prefix: true +``` + +The enum syntax has changed significantly: + +- First parameter is now a method name (`:status` instead of `status:`) +- Removed underscore prefix for options (`prefix:` instead of `_prefix:`) +- May need to add explicit attribute declaration for migrations + +### Recommendations for Upgrading + +1. **Test thoroughly** - The framework changes are substantial and require extensive testing +2. **Update dependencies** - Update your gem dependencies to match the new requirements +3. **Refactor enums and serializers** - These need immediate attention for compatibility +4. **Check asset loading** - Ensure your assets are properly registered and loaded +5. **Update deprecation warnings** - Replace deprecated calls with new methods +6. **Review database migrations** - Ensure compatibility with the new database handling +7. **Consider Rails 7 compatibility** - + Review [Rails 7 upgrade guide](https://guides.rubyonrails.org/v7.2/upgrading_ruby_on_rails.html) for additional + changes not covered here diff --git a/toc.json b/toc.json index 765efa6..23241be 100644 --- a/toc.json +++ b/toc.json @@ -33,6 +33,15 @@ "title": "Easy Project initialization process with zeitwerk", "uri": "docs/Zeitwerk_support/Easy-Project-Initialization.md" }, + { + "type": "divider", + "title": "Major Releases" + }, + { + "type": "item", + "title": "Version 15", + "uri": "docs/Major_releases/v15.md" + }, { "type": "divider", "title": "Hello RYS" From 6c3cc59412f3944813096b219cc1b4bfd768dc9c Mon Sep 17 00:00:00 2001 From: Dominik Pralovski Date: Mon, 12 May 2025 16:06:05 +0200 Subject: [PATCH 2/4] Update docs/Major_releases/v15.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/Major_releases/v15.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Major_releases/v15.md b/docs/Major_releases/v15.md index 26cde07..38ab0df 100644 --- a/docs/Major_releases/v15.md +++ b/docs/Major_releases/v15.md @@ -57,7 +57,7 @@ serialize :data, Array ```ruby serialize :settings, type: Hash -serialize :settings, coder: JSON +serialize :data, coder: JSON ``` - Use `type:` parameter instead of direct class From 719537082a96776b297d633d08f607d89453e5af Mon Sep 17 00:00:00 2001 From: dominikp Date: Tue, 13 May 2025 00:10:36 +0200 Subject: [PATCH 3/4] doc(redmine6): add date formatting section, small refactor --- docs/Major_releases/v15.md | 39 ++++++++++++++----- ...on.md => File-structure-and-transition.md} | 0 toc.json | 4 +- 3 files changed, 31 insertions(+), 12 deletions(-) rename docs/Zeitwerk_support/{File-structure-and-migration.md => File-structure-and-transition.md} (100%) diff --git a/docs/Major_releases/v15.md b/docs/Major_releases/v15.md index 38ab0df..50977af 100644 --- a/docs/Major_releases/v15.md +++ b/docs/Major_releases/v15.md @@ -4,6 +4,8 @@ - Redmine upgrade to 6 version - Hard switch to using Zeitwerk + - [File structure and Transition](https://easysoftware.stoplight.io/docs/developer-portal-devs/c5d9cf64cd1e2-file-structure-and-transition) + - [Easy Project initialization process](https://easysoftware.stoplight.io/docs/developer-portal-devs/8e822d65a77a2-easy-project-initialization-process) ---- @@ -14,16 +16,11 @@ for developers and maintainers who need to understand the implications of these ### Major Framework Upgrades -- ruby `">= 3.3.1"` → `">= 3.3.1", "< 3.4.0"` +- ruby `">= 3.3.1"` → `">= 3.3.7", "< 3.4.0"` - Added upper bound to Ruby version - - rails `"~> 6.1.7.10"` → `"~> 7.2.2.1"` - Major framework upgrade - rack `"~> 2.2.3"` → `"~> 3.1.3"` -- acts-as-taggable-on `"~> 7.0.0"` → `"~> 12.0.0"` - - ActiveRecord dependency -- acts_as_paranoid `"~> 0.7.0"` → `"~> 0.10.3"` - - ActiveSupport dependency ### Breaking Changes @@ -120,6 +117,26 @@ ActiveRecord.default_timezone == :utc - Default timezone now accessed through ActiveRecord instead of the class +#### 6. Date/Time Formatting Changes + +**Before:** + +```ruby +date_value.to_s(:db) # "2023-01-01" +time_value.to_s(:db) # "2023-01-01 12:34:56" +``` + +**After:** + +```ruby +date_value.to_fs(:db) # "2023-01-01" +time_value.to_fs(:db) # "2023-01-01 12:34:56" +``` + +- Changed from `to_s(:db)` to `to_fs(:db)` for date/time formatting +- This affects all date/time serialization to database format +- Check any code that formats dates for database queries or display + ### Warnings / Deprecations Deprecated but not yet removed in Rails 7.2. @@ -129,20 +146,22 @@ Deprecated but not yet removed in Rails 7.2. **Before:** ```ruby -enum status: [:pending, :active], _prefix: true +enum state: %i[pending active], _prefix: true +enum status: { running: 0, archived: 1 }, _default: :running ``` **After:** ```ruby -enum :status, [:pending, :active], prefix: true +enum :state, %i[pending active], prefix: true +enum :status, { running: 0, archived: 1 }, default: :running ``` The enum syntax has changed significantly: - First parameter is now a method name (`:status` instead of `status:`) -- Removed underscore prefix for options (`prefix:` instead of `_prefix:`) -- May need to add explicit attribute declaration for migrations +- Removed underscore from some `enum` options (`prefix:`, `suffix:`, `default:` instead of `_prefix:`, `_suffix:`, + `_default:`) ### Recommendations for Upgrading diff --git a/docs/Zeitwerk_support/File-structure-and-migration.md b/docs/Zeitwerk_support/File-structure-and-transition.md similarity index 100% rename from docs/Zeitwerk_support/File-structure-and-migration.md rename to docs/Zeitwerk_support/File-structure-and-transition.md diff --git a/toc.json b/toc.json index 23241be..1ddda43 100644 --- a/toc.json +++ b/toc.json @@ -25,8 +25,8 @@ }, { "type": "item", - "title": "File structure and Migration", - "uri": "docs/Zeitwerk_support/File-structure-and-migration.md" + "title": "File structure and Transition", + "uri": "docs/Zeitwerk_support/File-structure-and-transition.md" }, { "type": "item", From fdd3271149eccc1aff6d52f8154e856d3dc7f3da Mon Sep 17 00:00:00 2001 From: Dominik Pralovski Date: Tue, 13 May 2025 22:59:32 +0200 Subject: [PATCH 4/4] Update docs/Major_releases/v15.md --- docs/Major_releases/v15.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Major_releases/v15.md b/docs/Major_releases/v15.md index 50977af..8515639 100644 --- a/docs/Major_releases/v15.md +++ b/docs/Major_releases/v15.md @@ -2,7 +2,7 @@ ## Most impactful changes -- Redmine upgrade to 6 version +- Redmine upgrade to version 6 - Hard switch to using Zeitwerk - [File structure and Transition](https://easysoftware.stoplight.io/docs/developer-portal-devs/c5d9cf64cd1e2-file-structure-and-transition) - [Easy Project initialization process](https://easysoftware.stoplight.io/docs/developer-portal-devs/8e822d65a77a2-easy-project-initialization-process)