Skip to content

OCTO-893: Deprecate Migrator.ignore_tables/ignore_models in favor of DeclareSchema.ignore_tables/ignore_models#188

Merged
ColinDKelley merged 8 commits into
masterfrom
OCTO-893/deprecate-migrator-ignore-tables
Jul 8, 2026
Merged

OCTO-893: Deprecate Migrator.ignore_tables/ignore_models in favor of DeclareSchema.ignore_tables/ignore_models#188
ColinDKelley merged 8 commits into
masterfrom
OCTO-893/deprecate-migrator-ignore-tables

Conversation

@ColinDKelley

@ColinDKelley ColinDKelley commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds ::DeclareSchema.ignore_tables and ::DeclareSchema.ignore_models as the new public settings for ignoring tables/models during migration generation
  • Deprecates Generators::DeclareSchema::Migration::Migrator.ignore_tables/.ignore_models (kept working via delegate, emits an ActiveSupport::Deprecation warning) using the same pattern already established for default_charset/default_collation
  • Documents both settings in the README
  • Bumps version to 4.1.0 (minor - new backward-compatible API, non-breaking deprecation, nothing removed)

Fixes OCTO-893

Test plan

  • Added #ignore_tables/#ignore_models specs to migrator_spec.rb covering delegation and deprecation warnings (mirrors existing #default_charset/#default_collation specs)
  • Updated the one pre-existing spec that used the now-deprecated setter to avoid deprecation noise
  • Full suite passes: bundle exec rspec (276 examples, 0 failures)
  • No new Rubocop offenses introduced

Made with Cursor

ColinDKelley and others added 5 commits July 3, 2026 13:08
…ls deprecation

Documents the plan to move the ignore_tables and ignore_models settings
from the internal Migrator class to the public DeclareSchema module,
deprecating the old settings in place (no removal, no major version bump).

Co-authored-by: Cursor <cursoragent@cursor.com>
…recation

Co-authored-by: Cursor <cursoragent@cursor.com>
Move ignore_tables and ignore_models to ::DeclareSchema, following the
same delegate+deprecate pattern already used for default_charset and
default_collation. The Migrator accessors keep working but emit an
ActiveSupport deprecation warning; nothing is removed.

Co-authored-by: Cursor <cursoragent@cursor.com>
Update the README Ignored Tables section to point at the new public
DeclareSchema.ignore_tables setting, and add a new Ignored Models
section documenting DeclareSchema.ignore_models. Both note that the
old Migrator-based settings are deprecated aliases.

Co-authored-by: Cursor <cursoragent@cursor.com>
Adds DeclareSchema.ignore_tables/ignore_models (OCTO-893), deprecating
the old Migrator-based settings without removing them.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ColinDKelley
ColinDKelley requested a review from a team as a code owner July 3, 2026 20:48
@ColinDKelley
ColinDKelley requested review from Copilot and dcaddell July 3, 2026 20:48
@ColinDKelley
ColinDKelley requested review from jebentier and removed request for dcaddell July 3, 2026 20:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR moves the ignore_tables / ignore_models configuration from the internal Generators::DeclareSchema::Migration::Migrator class onto the public ::DeclareSchema module, while keeping the old migrator accessors working via delegation and emitting deprecation warnings.

Changes:

  • Added ::DeclareSchema.ignore_tables and ::DeclareSchema.ignore_models as new public configuration settings (defaulting to []).
  • Deprecated Generators::DeclareSchema::Migration::Migrator.ignore_tables / .ignore_models (delegated to ::DeclareSchema and wrapped with ActiveSupport::Deprecation), and updated internal generator code paths to use ::DeclareSchema directly to avoid warning spam.
  • Updated specs + README, and bumped version to 4.1.0 with a matching CHANGELOG entry.

Reviewed changes

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

Show a summary per file
File Description
spec/lib/generators/declare_schema/migration/migrator_spec.rb Adds specs verifying delegation + deprecation warnings for the old Migrator accessors.
spec/lib/declare_schema/migration_generator_spec.rb Updates integration spec to use the new public ::DeclareSchema.ignore_tables API.
README.md Documents DeclareSchema.ignore_tables and adds documentation for DeclareSchema.ignore_models, with deprecation notes for old Migrator APIs.
lib/generators/declare_schema/migration/migrator.rb Delegates + deprecates ignore_tables / ignore_models on Migrator; updates internal callers to ::DeclareSchema.* to avoid warning spam.
lib/declare_schema/version.rb Bumps gem version to 4.1.0.
lib/declare_schema.rb Introduces the new ::DeclareSchema.ignore_tables / ignore_models settings and defaults.
Gemfile.lock Updates local gem version entry to 4.1.0.
docs/superpowers/specs/2026-07-03-ignore-tables-deprecation-design.md Adds design documentation for the deprecation/migration approach.
docs/superpowers/plans/2026-07-03-ignore-tables-ignore-models-deprecation.md Adds an implementation plan documenting steps and rationale.
CHANGELOG.md Adds a 4.1.0 entry documenting the addition + deprecation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/declare_schema.rb
Comment thread spec/lib/declare_schema/migration_generator_spec.rb
The shared deprecator used by default_charset/default_collation and
the new ignore_tables/ignore_models had a stale '1.0' horizon (already
long past the current 4.1.0). Bump it to 5.0, and update the README to
state explicitly that the deprecated Migrator settings will be removed
in that version.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread lib/declare_schema.rb
Comment thread spec/lib/declare_schema/migration_generator_spec.rb
Validate DeclareSchema.ignore_tables=/ignore_models= inputs (Array or
nil, with nil normalized to []) so a bad value raises a clear
ArgumentError instead of crashing later on .map, matching the
existing validation pattern for other DeclareSchema settings.

Also reset DeclareSchema.ignore_tables after the migration generator
spec that sets it, so the global setting does not leak into later
examples.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ColinDKelley
ColinDKelley requested a review from jebentier July 7, 2026 20:50
Co-authored-by: Cursor <cursoragent@cursor.com>
@ColinDKelley
ColinDKelley requested review from jebentier and removed request for jebentier July 8, 2026 15:44
@ColinDKelley
ColinDKelley merged commit 1c2c1b5 into master Jul 8, 2026
47 checks passed
@ColinDKelley
ColinDKelley deleted the OCTO-893/deprecate-migrator-ignore-tables branch July 8, 2026 16:20
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