See if exemption in `self.in_factory_bot_create?` is still needed

The following discussion from !130277 (merged) should be addressed:

  • @DylanGriffith started a discussion: (+1 comment)

    With the changes in spec/support/factory_bot.rb can that delete this whole method? Now we're explicitly allowlisting all models built by factory bot I think this caller_locations hack may not be necessary anymore?

    If you'd rather us verify this assumption in a followup MR I'm totally fine with that considering it might take a few pipeline runs and minor tweaks to get the pipeline passing.

Implementation guide

  1. Remove the in_factory_bot_create? method in https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/database/query_analyzers/prevent_cross_database_modification.rb. Make the pipeline green
Edited by Thong Kuah