Skip to content

Solving database cross joins on HookData::ProjectBuilder

Omar Qunsul requested to merge 432604-fix-project-builder-cross-joins into master

What does this MR do?

Fixing cross joins on Gitlab::HookData::ProjectBuilder, which are preventing a Project with a README file from being created on a secondary cell. This MR is necessary to unblock upcoming Cells Iteration 3 Demo #420118 (closed)

As part of the Cells project, we are changing many of the queries that are doing cross database joins to querying both databases main and main_clusterwide, while maintaining the current performance of the querying. For more on the topic, you can refer to this documentation.

cross_joins

Addressing part of : #432604 (closed)

Newly introduced database queries

1. When the Project is a Group project

2. When the Project is a Personal Namespace Project

How to set up and validate locally

These tests can be done on a one cell GDK setup

  • Create a project on a personal namespace with a README file, make sure you get no errors and the readme file is visible.
  • Create a project on a group, make sure you get no errors, make sure you get no errors and the readme file is visible.

Optional: If you want to test on another GDK cell

  1. Follow the instructions here to create another GDK cell: https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/cells.md?ref_type=heads
  2. On the 2nd Cell, enable the FF via Rails Console: Feature.enable(:optimize_where_full_path_in)
  3. On the 2nd Cell, we still need a Personal Namespace for the logged in user. Create it via FactoryBot.create(:user_namespace, owner: User.first) (replace the User.first with the user you are using). This is not resolved yet. See #432815 (closed)
  4. Create a Group and a Project with README file on Cell 2

MR acceptance checklist

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

Related to #432604 (closed)

Edited by Omar Qunsul

Merge request reports