Skip to content

Conversation

Copy link

Copilot AI commented Nov 7, 2025

Fixes Rails 8.1 deprecation warning for router keyword arguments and removes support for EOL Ruby/Rails versions per issue requirements.

Changes

Router keyword args deprecation fix

  • Remove Rails 5.2 version check in lib/apipie/routing.rb, always use keyword arguments:
# Before
Rails.version >= "5.2" ? get(**get_args) : get(get_args)

# After
get(**get_args)

Minimum version constraints

  • Ruby: >= 2.6.0>= 3.1.0
  • Rails (actionpack, activesupport): >= 5.0>= 7.0
  • Remove Ruby 2.7 conditional for rubocop-rspec_rails dependency

Rubocop modernization

  • Use plugins: instead of deprecated require: for extensions
  • Update TargetRubyVersion: 2.63.1
  • Fix deprecated cop: Naming/PredicateNameNaming/PredicatePrefix
  • Regenerate .rubocop_todo.yml

Version bump

  • 1.5.01.6.0 (minor bump for breaking changes)
  • Update CHANGELOG.md with breaking change notice
Original prompt

This section details on the original issue you should resolve

<issue_title>Fix Rails 8.1 router keyword args deprecation warning</issue_title>
<issue_description>@copilot Can you reopen #962 as your own. you can use the branch named ruby8-copilot which is already set to 9283da9 by James Dean Shepherd.

Please check rubocop, why it fails. might need to update rubocop gems and run it with rubocop --regenerate-todo --no-auto-gen-timestamp --exclude-limit 250

remove conditions around Rails 5.x and 6.x.
Update constraint to support only ruby >= 3.1 and rails >= 7.0,
update Changelog and bump to next minor version.

Thank you</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits November 7, 2025 11:44
- Remove Rails 5.2 version check in routing.rb, always use keyword args
- Update gemspec to require Ruby >= 3.1 and Rails >= 7.0
- Update rubocop configuration to use plugins instead of require
- Update TargetRubyVersion to 3.1
- Fix PredicateName -> PredicatePrefix in rubocop config
- Regenerate rubocop_todo.yml
- Bump version to 1.6.0
- Update CHANGELOG.md with breaking changes

Co-authored-by: mathieujobin <[email protected]>
Since we now require Ruby >= 3.1, the conditional for rubocop-rspec_rails is no longer needed.

Co-authored-by: mathieujobin <[email protected]>
Copilot AI changed the title [WIP] Fix Rails 8.1 router keyword args deprecation warning Drop Ruby < 3.1 and Rails < 7.0 support, fix Rails 8.1 router deprecation Nov 7, 2025
Copilot AI requested a review from mathieujobin November 7, 2025 11:55
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Foreman still relies on Ruby 3.0 today and dropping that would severely hinder our ability to upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants