Cells: Fix cross joins related to projects applicable_approval_rules_for_user
Fix the cross joins in these files:
- ee/app/models/ee/project.rb:707: in
applicable_approval_rules_for_user
method
Refer to the epic for more information about this. Feel free to:
Copy the epic description to this issue to helper the reviewers understand the problem.Split this issue into different issues in case it was so much effort to- Ask for help and hints on #g_tenant-scale on how to fix cross joins
users
and namespaces
?
Why cross joins are not allowed between The table users
is planned to be moved to the gitlab_main_clusterwide
database. Which means that it wont reside on the same database where namespaces
table is going to be.
Why do we have this epic?
As part of the MR: !124319 (merged), we identified all the cross joins between the tables users
and namespaces
, and marked all the associations or code blocks to temporarily allow those violations with issues to fix them.
How to approach each one of the issues in this epic?
- Remove the
allow_cross_joins_across_databases
that are referenced in each issue, and see which tests are failing. - Refer to this documentation on how to resolve the cross joins https://docs.gitlab.com/ee/development/database/multiple_databases.html#removing-joins-between-ci-and-non-ci-tables
- Remove the allowed cross joins, and make sure the pipeline is still green
Availability and Testing
Regression testing, ensure associated MR is labelled with pipeline:run-all-e2e and the e2e:package-and-test
job is passing.
Edited by Jay McCure