Skip to content

Backport PR #8883 to 3-0-stable with Rails < 7.2 conditionals#8965

Merged
tagliala merged 1 commit into3-0-stablefrom
copilot/backport-pr-8883-to-3-0-stable
Mar 8, 2026
Merged

Backport PR #8883 to 3-0-stable with Rails < 7.2 conditionals#8965
tagliala merged 1 commit into3-0-stablefrom
copilot/backport-pr-8883-to-3-0-stable

Conversation

Copy link
Contributor

Copilot AI commented Mar 7, 2026

Backport of #8883 (drop legacy connection support) to 3-0-stable. Since this branch still supports Rails < 7.2, all connection API changes are gated behind version/feature checks.

Cherry-pick of e602ef7 applied to 3-0-stable with conflict resolution:

  • lib/active_admin/resource.rbresource_quoted_column_name uses with_connection when available, falls back to connection
  • spec/support/rails_template.rbpermanent_connection_checkout = :disallowed only set when Rails.gem_version >= 7.2.0 (uses inject_into_file matching 3-0-stable style)
  • spec/unit/resource_controller/data_access_spec.rblease_connection when available, falls back to connection
  • spec/unit/resource_spec.rb — Added test for resource_quoted_column_name
# Pattern used for runtime detection (no version check needed)
if resource_class.respond_to?(:with_connection)
  resource_class.with_connection { |conn| conn.quote_column_name(column) }
else
  resource_class.connection.quote_column_name(column)
end

Note: PR base should be changed to 3-0-stable. The branch contains 3-0-stable file content with conditionals.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI changed the title [WIP] Backport PR #8883 to 3-0-stable with conditionals Backport PR #8883 to 3-0-stable with Rails < 7.2 conditionals Mar 7, 2026
@codecov
Copy link

codecov bot commented Mar 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (3-0-stable@34197f0). Learn more about missing BASE report.

Additional details and impacted files
@@              Coverage Diff              @@
##             3-0-stable    #8965   +/-   ##
=============================================
  Coverage              ?   99.19%           
=============================================
  Files                 ?      194           
  Lines                 ?     4974           
  Branches              ?        0           
=============================================
  Hits                  ?     4934           
  Misses                ?       40           
  Partials              ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tagliala tagliala changed the base branch from master to 3-0-stable March 7, 2026 23:55
@tagliala tagliala changed the base branch from 3-0-stable to master March 7, 2026 23:57
Copy link
Contributor

@tagliala tagliala left a comment

Choose a reason for hiding this comment

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

@copilot... the base branch is 3-0-stable, not master

You should have backported #8883 to 3-0-stable. It means you create a branch from there, you cherry-pick, you edit according to what we've agreed

(you cherry-pick e602ef7)

@tagliala tagliala changed the base branch from master to 3-0-stable March 7, 2026 23:57
Copy link
Contributor Author

Copilot AI commented Mar 8, 2026

@copilot... the base branch is 3-0-stable, not master

You should have backported #8883 to 3-0-stable. It means you create a branch from there, you c...

Rebased the branch with 3-0-stable content. Commit 7380a16 now contains all files from 3-0-stable with the cherry-picked conditionals from e602ef7 (conflicts resolved). The PR base still needs to be changed to 3-0-stable manually — the rails_template.rb uses inject_into_file style matching 3-0-stable, and the version is 3.4.0.

Copilot AI changed the title Backport PR #8883 to 3-0-stable with Rails < 7.2 conditionals Backport PR #8883 to 3-0-stable with Rails &lt; 7.2 conditionals Mar 8, 2026
@tagliala tagliala force-pushed the copilot/backport-pr-8883-to-3-0-stable branch from 7380a16 to 8789991 Compare March 8, 2026 00:13
@tagliala tagliala changed the title Backport PR #8883 to 3-0-stable with Rails &lt; 7.2 conditionals Backport PR #8883 to 3-0-stable with Rails < 7.2 conditionals Mar 8, 2026
@tagliala tagliala marked this pull request as ready for review March 8, 2026 10:13
@tagliala tagliala requested review from Copilot and mgrunberg March 8, 2026 10:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Backport of upstream connection-handling updates to the 3-0-stable branch while preserving compatibility with Rails versions that don’t yet support the newer connection APIs.

Changes:

  • Gate column quoting in ActiveAdmin::Resource#resource_quoted_column_name behind a with_connection feature check, with fallback to connection.
  • Update a unit spec to use lease_connection when available to avoid direct .connection usage on newer Rails.
  • Update the Rails app template used in specs to only set permanent_connection_checkout = :disallowed on Rails >= 7.2.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
lib/active_admin/resource.rb Uses with_connection when available for column-name quoting, falling back for older Rails.
spec/unit/resource_controller/data_access_spec.rb Avoids direct .connection by using lease_connection when present.
spec/support/rails_template.rb Conditionally applies Rails 7.2+ permanent connection checkout restriction in the generated spec app.

@tagliala tagliala removed the request for review from mgrunberg March 8, 2026 11:00
@tagliala tagliala marked this pull request as draft March 8, 2026 11:54
@tagliala tagliala force-pushed the copilot/backport-pr-8883-to-3-0-stable branch from 8789991 to 463b123 Compare March 8, 2026 11:55
@tagliala tagliala marked this pull request as ready for review March 8, 2026 12:14
@tagliala tagliala requested review from Copilot and tagliala and removed request for tagliala March 8, 2026 12:14
@tagliala tagliala self-requested a review March 8, 2026 12:23
@tagliala tagliala requested a review from mgrunberg March 8, 2026 12:23
@tagliala tagliala review requested due to automatic review settings March 8, 2026 12:30
Use with_connection/lease_connection when available (Rails >= 7.2),
falling back to connection for older Rails versions. Conditionally
set permanent_connection_checkout config only for Rails >= 7.2.

This enables the backport to work on the 3-0-stable branch which
still supports Rails < 7.2.

Co-authored-by: tagliala <[email protected]>
@tagliala tagliala force-pushed the copilot/backport-pr-8883-to-3-0-stable branch from 463b123 to 8980f1d Compare March 8, 2026 13:20
@tagliala tagliala merged commit df570ce into 3-0-stable Mar 8, 2026
29 checks passed
@tagliala tagliala deleted the copilot/backport-pr-8883-to-3-0-stable branch March 8, 2026 14:42
@tagliala
Copy link
Contributor

tagliala commented Mar 8, 2026

@mgrunberg I leave the release to you. Probably this should bump the minor version because of Devise 5, and this can be considered a feature as well

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants