Release 0.6.0: drop Rails 5.2 + Phase 2a housekeeping rollup#10
Merged
Conversation
…to v5 Two small cleanups: 1. Both gemspecs had `metadata["source_code_uri"] = spec.homepage` alongside `metadata["homepage_uri"] = spec.homepage` — same value. RubyGems emitted a warning on every build: "You have specified the uri: ... for all of the following keys: homepage_uri source_code_uri. Only the first one will be shown on rubygems.org." Dropped the duplicate source_code_uri line from both gemspecs. homepage_uri stays; changelog_uri stays. 2. `actions/checkout@v4` bumped to `@v5` in both ci.yml and publish.yml. GitHub deprecates Node 20 on 2026-06-02 and will force actions onto Node 24; v5 is Node-24-native. Every CI run currently emits a deprecation warning for each job in the matrix. No behavior change, no version bump, no release needed.
Task 12's code review flagged a coverage gap: the fixture had 3 default columns + 2 masked columns, so every visible column was also in default_columns — the `default: false` branch of `defaults.empty? || defaults.include?(col.name)` was never exercised. Adds a 6th column `updated_at` to the fixture (visible, not masked, not in default_columns) and a new example asserting it comes back with `default: false`. Pins the `!defaults.empty? && !defaults.include?` path so a future refactor can't silently regress it. 8 examples, 0 failures (was 7).
Task 7's code review flagged the repetitive pattern
`instance_double("ActiveRecord::Result", columns: [], rows: [], to_a: [])`
across multiple request specs. Extracts a `fake_result(columns:, rows:, to_a:)`
helper into FakeConnectionHelper alongside fake_column, with a smart
to_a default that builds a hash-per-row from the columns metadata.
Four call sites refactored to use the helper:
- spec/support/fake_connection.rb — the internal empty_result fallback
- spec/requests/mysql_genius/analysis_spec.rb — 8-line stub → 1-line call
- spec/requests/mysql_genius/query_execution_spec.rb — two literals collapsed
- spec/requests/mysql_genius/ai_features_spec.rb — empty_result literal,
keeps the extra `.each` stub that root_cause action requires
76 examples, 0 failures, rubocop clean.
Before this commit there were 9 inline sites in concerns and 2 separate
private helpers (one in QueriesController, one in AiFeatures) all doing
MysqlGenius::Core::Connection::ActiveRecordAdapter.new(ActiveRecord::Base.connection)
After: one private method on BaseController. All concerns that delegate
to Core::* services now call `rails_connection` directly. Ruby method
lookup handles it because the concerns are included into QueriesController
which inherits from BaseController — the private helper on the parent
class is accessible from any method on the instance, regardless of
which concern module the method is defined in.
Net effect: ~25 lines deleted across 4 files, one helper to maintain.
Call sites updated:
- QueryExecution#execute, #explain (2 sites) — dropped `connection = ...`
local binding, pass `rails_connection` directly to QueryRunner.new
- DatabaseAnalysis: 5 action sites all refactored
- AiFeatures#suggest, #optimize (2 sites) — dropped `connection = ...`
local binding. The 4 Phase 2a-delegated actions (schema_review,
rewrite_query, index_advisor, migration_risk) were already using
rails_connection — no change there, just the helper definition moved.
Both private helper definitions deleted:
- QueriesController#rails_connection (added in Task 19)
- AiFeatures#rails_connection (added in Task 20)
76 examples, 0 failures. Rubocop clean.
Task 20 left ai_domain_context as a thin shim returning
ai_system_context with a "Domain context:" prefix. It was only called
from the 2 remaining Rails-side AI actions (anomaly_detection and
root_cause — both keep Redis dependencies). Inlining it removes the
indirection.
Each of the two actions now computes a local `domain_ctx` string
just before building its messages array:
domain_ctx = mysql_genius_config.ai_system_context.present? ? "\nDomain context:\n#{mysql_genius_config.ai_system_context}" : ""
and interpolates `#{domain_ctx}` in the system prompt heredoc.
Behavior is identical.
ai_domain_context private helper deleted. 76 examples, 0 failures.
Rubocop clean.
- mysql_genius-core: 0.5.0 -> 0.6.0 (no functional changes) - mysql_genius: 0.5.0 -> 0.6.0 - mysql_genius.gemspec activerecord/railties floor: ">= 5.2" -> ">= 6.0" - mysql_genius.gemspec mysql_genius-core dep: "~> 0.5.0" -> "~> 0.6.0" - .github/workflows/ci.yml: Rails 5.2 matrix row removed entirely (plus its 5 exclude entries). Matrix shrinks from 31 to 23 cells. - README compatibility table: Rails 5.2 row dropped; note updated to point at 0.5.0 as the pin target for users who can't upgrade yet. - CHANGELOG.md: new ## 0.6.0 section rolling up the Rails 5.2 drop plus the 8 post-0.5.0 commits (logger require, matrix Ruby 3.0 x Rails 5.2 exclude, README compat note, 6 housekeeping cleanups). - gems/mysql_genius-core/CHANGELOG.md: new ## 0.6.0 section noting the lockstep bump with no functional changes. Rails 5.2 has been EOL since June 2022. Rails 5.2's bit-rot against modern Rack (ActionDispatch::Static#initialize arity mismatch, MiddlewareStack#operations removal) started surfacing as CI failures once Phase 2a's integration specs booted Rails in test. Users on Rails 5.2 can pin `gem "mysql_genius", "~> 0.5.0"` if they can't upgrade Rails yet. The next commit tags v0.6.0 and kicks off the publish workflow, which will push mysql_genius-core 0.6.0 first and then mysql_genius 0.6.0 to rubygems.
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.
Summary
Paired release of
mysql_genius-core 0.6.0+mysql_genius 0.6.0. Drops Rails 5.2 support from the Rails adapter and rolls up the 8 post-0.5.0 commits sitting on main (3 CI fixes + 6 housekeeping cleanups).Headline change: Rails 5.2 dropped
mysql_genius.gemspec:activerecord/railtiesfloor raised from">= 5.2"to">= 6.0".github/workflows/ci.yml: Rails 5.2 row removed from the matrix entirely (plus its 5excludeentries since they no longer apply). Matrix shrinks from 31 → 23 cells.0.5.0as the pin targetgem "mysql_genius", "~> 0.5.0"Why now: Rails 5.2 has been EOL since June 2022. Its bit-rot against modern Rack (
ActionDispatch::Static#initializearity mismatch,MiddlewareStack#operationsremoval) started surfacing as CI failures once Phase 2a's integration specs booted Rails in test. The combination of EOL upstream + CI friction + no practical users on that combination justifies raising the floor.Rollup of post-0.5.0 work
CI fixes (3 commits):
require "logger"beforerequire "rails"in rails_helper + dummy app — works around Ruby 3.x + older ActiveSupport incompatibility (LoggerThreadSafeLevelreferences Logger without requiring it)Housekeeping cleanups (6 commits):
source_code_urimetadata dropped from both gemspecsactions/checkout@v4→@v5in both CI and publish workflowsdefault: falsecoverage gap closed inCore::Analysis::Columnsspec (+1 example)fake_result(columns:, rows:, to_a:)test helper extracted, 4 duplicatedinstance_double("ActiveRecord::Result", ...)call sites refactoredrails_connectionconsolidated intoBaseController— 9 inlineActiveRecordAdapter.new(...)call sites + 2 private helpers collapse to 1ai_domain_contexthelper inlined into its 2 callers (anomaly_detection,root_cause) and deletedTest plan
bundle exec rspec— adapter 76/0(cd gems/mysql_genius-core && bundle exec rspec)— core 194/0bundle exec rubocop— 98 files clean(cd gems/mysql_genius-core && bundle exec rubocop)— 60 files cleanbundle installresolvesmysql_genius-core 0.6.0+mysql_genius 0.6.0epitome): boot on branch, exercise every tab, confirm no regressions. Should be a no-op since this is almost entirely doc/gemspec/CHANGELOG/test-helper work — the only adapter code change is therails_connectionconsolidation which is pure refactor with no behavior change.v0.6.0, verify publish workflow pushes both gemsbundle installagainstgem "mysql_genius", "0.6.0"resolvesmysql_genius-core 0.6.0transitivelyBreaking change
Rails 5.2 users:
bundle update mysql_geniuswill fail to resolve on Rails 5.2. Pingem "mysql_genius", "~> 0.5.0"to stay on a Rails 5.2-compatible version.All Rails 6.0+ users: zero observable change. The internal refactors (
rails_connection,ai_domain_context,fake_result) are pure code-organization cleanups.What's next
gems/mysql_genius-desktop/Sinatra sidecar (fresh brainstorming session, multi-task effort)