Skip to content

Update BG migration cop to match removed methods

Patrick Bair requested to merge 343055-fix-cop-for-removed-methods into master

What does this MR do and why?

Related to #343055 (closed)

In !73306 (merged) we removed some unused migration helpers, migrate_async, bulk_migrate_async and bulk_migrate_in that were either unused or we don't want to recommend using anymore.

This MR changes a cop that recommends usage of those methods over calling their counterparts on the worker, like perform_async, etc.

I also removed the autocorrect functionality from this cop, since I don't think it makes sense to have this anymore without the 1:1 mapping of migration helpers to worker methods. For example if somewhere were to write a migration using:

BackgroundMigrationWorker.perform_async

it wouldn't make sense to autocorrect to

BackgroundMigrationWorker.migrate_in

as that changes the behavior of how the job is enqueued.

We also have some documentation changes related to changing advice on using these methods, but that's updated in !77308 (merged).

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 Patrick Bair

Merge request reports