気づき #755
奈良 裕記 さんが4年以上前に更新
PluginのRedmine本体バージョン間設計変更点収集(Redmine4/Rails5)対応分
"Redmine3.x/Rails4分→" #751
Redmineバージョン間の変更により、結果的にPluginに不具合が発生し、運用コストが増える事が良くあります。
(Redmine本体だけでなく、利用しているRuby,Rails,ライブラリ,DBMS側の変更を含む。)
本チケットは、そのようなロスを減らすために対応に必要な情報を収集蓄積するものです。
Rails5/Redmine4用に作成した機能のRails4/Redmine3環境backportも対象
RedmineはOSSですから、利用者は不具合を分析しソースレベルで修正し利用する自由があります。
対応方法が判れば、作者の修正待ちではなく、自分で修正し動かすことも可能。
(可能なら開発元にフィードバック)
記入項目(案)
* 変更があったバージョン:項目名
* Redmine本体側変更内容(RAILS.Ruby変更含)
* Plugin側の変更方法、発生条件
* 対応サンプル
* 補足
---
h1. 関連資料
Rails アップグレードガイド
https://railsguides.jp/upgrading_ruby_on_rails.html
Redmine4時代のプラグイン開発
https://www.slideshare.net/douhashi/redmine4-redminetokyo-13
P55
Rails5で消えるAPI
before_filter after_filter
alias_method_chain
Redmine次期バージョン 4.0・4.1 とその先の未来像
https://www.slideshare.net/g_maeda/redmine-4041/g_maeda/redmine-4041
Redmine本家 Rails5 検索結果
http://www.redmine.org/projects/redmine/search?utf8=%E2%9C%93&q=Rails5&scope=&all_words=&all_words=1&titles_only=&issues=1&news=1&changesets=1&wiki_pages=1&messages=1&redmine_plugins=1&commit=%E9%80%81%E4%BF%A1
Redmine4.0.0 Roadmap
http://www.redmine.org/versions/99
Bitnami Redmine 3.4と4.0のDB変更点
https://qiita.com/8amjp/items/18395e96a5ea7d7ae21d
---
h1. テーブル設計変更内容
h3. Bitnami Redmine 3.4と4.0のDB変更点
https://qiita.com/8amjp/items/18395e96a5ea7d7ae21d
* auth_sourcesテーブルのverify_peerフィールド追加(LDAPS対応)
http://www.redmine.org/issues/29606
* commentsテーブルのcomments→content変更
http://www.redmine.org/projects/redmine/repository/changes/branches/4.0-stable/db/migrate/20170723112801_rename_comments_to_content.rb
* 日付型フィールドで型がdatetimeからtimestampに変更(多数)
Failed to run "rake db:migrate" command against clean database on MySQL 5.7
https://www.redmine.org/issues/27283
---
h1. 対応作業事例
h2. Redmine 4.0(Rails 5.2)に用語集(Glossary)プラグインを対応させる
https://qiita.com/boochnich/items/3f190782f33835d05b2f
上記抜粋(詳細はリンク先参照)
* alias_method_chainの削除 -> prepend
* ActiveRecord::Migration -> Migration[4.2]
* before_filterの削除 -> before_action
* attr_accessibleの削除 -> ストロングパラメーター
* acts_as_listの削除 -> gemで別途インストール
* unable to convert unpermitted parameters to hash -> 明示的にハッシュに変換し、かつpermitを有効に
* ActiveRecordのupdate_allの引数変更対応
* ルーティングに:actionを使わない(Rails 6.0で削除)
|対応項目|対応抜粋|
| alias_method_chainの削除| prependに変更|
| ActiveRecord::Migration | Migration[4.2]|
| before_filterの削除 | before_action|
| attr_accessibleの削除 | ストロングパラメーター|
| acts_as_listの削除 | gemで別途インストール|
| unable to convert unpermitted parameters to hash | 明示的にハッシュに変換し、かつpermitを有効に|
| ActiveRecordのupdate_allの引数変更|引数変更|
| ルーティングに:actionを使わない
(SEC問題,Rails 6.0で削除)|ルーティング設定ではアクションを明示的に指定する。
routes.rbにて、matchではなく、get/post/patch個別に指定。|
---
h2. Redmine4.0:ActionView::Template::Error (super: no superclass method `project_settings_tabs'
h3. 本体側変更:
h3. Plugin側の変更方法、発生条件
lib/Plugin名/projects_helper_patch.rb
From
ProjectsHelper.prepend Plugin名::ProjectsHelperPatch
To
ProjectsController.helper(Plugin名::ProjectsHelperPatch)
h3. 対応サンプル
https://github.com/akiko-pusu/redmine_issue_templates/issues/217
https://github.com/akiko-pusu/redmine_banner/issues/101
https://github.com/akiko-pusu/redmine_banner/pull/103/commits/15cda582f818991685e9e15f592e6b6e60c801da
DMSFでも同様の問題が発生していた模様
[WIP] Issue Template PluginのRails5対応作業追っかけ
https://github.com/akiko-pusu/redmine_issue_templates/pull/147
---
<pre>
h2. jQuery アップデート対応
h3. 本体側変更:
Redmineで利用しているjQueryが古く、SEC面からも問題となっている。
Redmine4.1にて、jQuery 1.11.1→2.2.4 へのアップデート及び jQuery Migrate libraryの追加が行われた。機能変更/削除があり、これらへの対応が必要。
jQuery UI でも同様の変更が必要になる見込み
h3. Plugin側の変更方法、発生条件
Updates jQuery to 2.2.4 and adds jQuery Migrate library
https://www.redmine.org/issues/31196
1.11.1→2.2.4 (4.1対応済)
Update jQuery UI to 1.12.1
https://www.redmine.org/issues/31887
jQuery UI 1.12 Upgrade Guide
https://jqueryui.com/upgrade-guide/1.12/
jQuery UI 1.12 Upgrade Guide
https://jqueryui.com/upgrade-guide/1.12/
h3. 対応サンプル
</pre>
---
Rails5/Redmine4用に作成した機能のRails4/Redmine3環境対応も必要そう。
Redmine4がリリースされても、移行が順調に進むとは思えないので。
Too large avatar breaks gantt when assignee is a group
http://www.redmine.org/issues/28204
>The cause is that the HTML doesn't include "width" and "height" option
Rails 5.0から5.1へアップグレード時
Mysql2::Error: Table 'database.table_name' doesn't exist: SHOW FULL FIELDS FROM `table_name`
http://blog.digital-squad.net/article/450422548.html
>原因としてはRails 5.0から5.1へのアップデートでPrimary Keyカラムがintからbigintに変更されているので、
>5.0で作成したテーブルを参照する外部キーを含むマイグレーションを作成すると、
>もとのテーブルのIDがintであるのに対し、外部キーはbigintでミスマッチになるためエラーになるようだ。
Failed to run “rake db:migrate" command against clean database on MySQL5.7 under Redmine4.0 / Rails5
http://www.redmine.org/issues/27283
原因
Changed the default null value for timestamps to false".
http://guides.rubyonrails.org/5_0_release_notes.html
Rails側では現在対応予定無しの模様
https://github.com/rails/rails/issues/31804
https://github.com/rails/rails/pull/23553
> This change is for dumping native timestamp types correctly which was introduced at #23553.
>
> Historically, TIMESTAMP type has nonstandard behaviors for default values and NULL-value.
> But the nonstandard behaviors are deprecated and will be removed in a future MySQL release.
>
> So please enable explicit_defaults_for_timestamp on your server.
---
テンプレ
<pre>
h2. Redmine4.0:エラーメッセージ概要
h3. 本体側変更:
h3. Plugin側の変更方法、発生条件
h3. 対応サンプル
</pre>
戻る