Skip to content

Check ActiveSupport::Concern is used with scope_to

euko requested to merge 376397-add-cop-to-check-missing-active-concern into master

What does this MR do and why?

This MR adds a new Cop to check EE batched background migrations appropriately extend ActiveSupport::Concern when scope_to is used. Resolves #376397 (closed).

When an EE batched background migration uses scope_to helper, the migration must extend ActiveSupport::Concern as documented in https://docs.gitlab.com/ee/development/database/batched_background_migrations.html#additional-filters:

NOTE: For EE migrations that define scope_to, ensure the module extends ActiveSupport::Concern.

Otherwise, records are processed without taking the scope into consideration.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by euko

Merge request reports

Loading