Resolve vulnerability cross join issues in `ee/app/services/vulnerabilities/findings/find_or_create_from_security_finding_service.rb`

Problem to solve

All cross-joins arising from decomposing gitlab_sec from gitlab_main should be resolved. See parent epic for context.

  1. Remove allowed cross-join for relevant relation using associated documentation for guidance on removing cross-joins or cross-transactions occurrences

Implementation

This service creates findings from security_finding records which requires inserts across half a dozen vulnerability tables. We have introduced nested transactions to insert across gitlab_main and gitlab_sec so we don't need to decompose foreign keys between vulnerability tables. Once all tables are migrated to the gitlab_sec DB we should remove the nested transactions since we can now rely off a single DB and connection to perform the inserts.

Edited by Lucas Charles