-
Notifications
You must be signed in to change notification settings - Fork 5
doc(redmine6): create v15 page with redmine 6 upgrade notes #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,176 @@ | ||
| # Version 15 | ||
|
|
||
| ## Most impactful changes | ||
|
|
||
| - 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) | ||
|
|
||
| ---- | ||
|
|
||
| ## 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.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"` | ||
|
|
||
| ### 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 :data, 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 | ||
|
|
||
| #### 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. | ||
|
|
||
| #### 1. Enum Declaration Changes | ||
|
|
||
| **Before:** | ||
|
|
||
| ```ruby | ||
| enum state: %i[pending active], _prefix: true | ||
| enum status: { running: 0, archived: 1 }, _default: :running | ||
| ``` | ||
|
|
||
| **After:** | ||
|
|
||
| ```ruby | ||
| 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 from some `enum` options (`prefix:`, `suffix:`, `default:` instead of `_prefix:`, `_suffix:`, | ||
| `_default:`) | ||
|
|
||
| ### 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 | ||
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.