Skip to content

Activate GitlabSchemaValidateConnection for all tests

Omar Qunsul requested to merge gitlab-schemas-validate-connection-tests into master

What does this MR do and why?

After the Database Decomposition Project has been finished, we want to make sure that future features always access the right database for each table. That's why we are adding this feature to both development and test environments, to help the developers early on detect any possible issues. FYI, on Staging and Production we raise errors if you try to write to the wrong database.

In order to achieve this, as part of this MR we are enabling the Query Analyzer GitlabSchemasValidateConnection in Rspecs, to make sure that we are not reading/writing to the wrong database.

We are also suppressing this analyzer using the taint :suppress_gitlab_schemas_validate_connection on any old database migrations that happened to be writing to the CI tables on the Main database.

Issue: #365761 (closed)

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 Omar Qunsul

Merge request reports