Repository navigation
Conversation
- Relax activesupport upper bound to < 8.2 - Drop bundler ~> 2.0 dev dependency, which conflicts with Bundler 4 bundled with Ruby 4.0 - Test Ruby 3.3, 3.4, 4.0 and Rails 7.0 to 8.1 on CI - Remove Code Climate coverage upload, whose API was shut down
Paths, Responses, Callback and SecurityRequirement extend Forwardable, but nothing required it. psych up to 5.1.0 happened to load it, so requiring open_api after yaml (e.g. right after rails) worked on Ruby 3.2. psych 5.1.1+ (bundled with Ruby 3.3+) no longer loads it, which makes require "open_api" raise NameError unless something else loaded it first. The spec runs in a separate process because simplecov, loaded by spec_helper, requires forwardable and hides the problem.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
open_api を (open_api_annotator 経由で) 使っているアプリを Ruby 3.4 / 4.0、Rails 8.1 に上げられるようにするため。現在の 0.6.2 は
activesupport < 7.2なので、Rails 7.2 以降と一緒に入れられない。What
< 8.2に緩める (下限>= 5.0は Bump Ruby and Rails #17 と同じく据え置き)bundler ~> 2.0を削除する。Ruby 4.0 は Bundler 4 を同梱しているため、残すとbundle installが失敗するlib/open_api.rbでforwardableを明示的に require するPaths/Responses/Callback/SecurityRequirementはextend Forwardableしているが、どこでも require していなかった。ほかのライブラリが先に forwardable を読み込んでいないと、require "open_api"はNameError: uninitialized constant OpenApi::Paths::Forwardableになる。require "open_api"だけなら Ruby 3.2 でも同じrequire "rails"を含む) の後なら動いていたrequire "rails"の後でも NameError になるrequire "rails"の直後にrequire "open_api"するので、Ruby 3.3 以降ではこれに当たるaction_controller/railtieが (strong_parameters → rack-test 経由で) 先に forwardable を読み込むので、表に出ていなかったrequire "open_api"だけを読み込めること。spec_helper が先に読む simplecov が forwardable を読み込むので、同じプロセスでは検出できない==が、中身の違うオブジェクトに対して false を返すこと。これまでは==を常に true にしても既存の spec がすべて通っていた。.loadの spec は結果をeq(内部で==を使う) で比べているので、==自体の誤りは検出できないrails-6.1.gemfileを削除し、rails-7.1/rails-7.2/rails-8.0を追加する>= 5.0) は変えていないので、インストール自体はできる.ruby-versionを 3.2.2 から 4.0.9 に上げる確認したこと
require "forwardable"を外すinを Symbol のまま出すto_sを外す==を「常に true」「クラスだけ比べる」「ivar 名だけ比べる」「最初の ivar / 最後の ivar だけ比べる」に変えるRUBYOPT=-W:deprecatedを付けても、lib と spec から警告が出ないバージョンで出力が変わるもの (今回は直していない)
"Y"/"N"を引用符付きで出力する。読み戻したときの値は同じproperties/items以外) に Hash を渡すと、to_sで文字列になる (既存のバグ)。その書式が、Ruby 3.4 の Hash#inspect の変更で変わるformat・config.infoの値がちょうど "Y" / "N" でない限り起きないリリース
bundle exec rake releaseを実行する。version はこの PR で上げてあるので、README の手順にあるbundle exec rake bump:patchは不要