Skip to content

Validate that connection accesses valid tables in migrations

Kamil Trzciński requested to merge restrict-gitlab-schema into master

What does this MR do and why?

This validator is very similar to cross-join validator that is part of specs. The purpose here is to ensure that when running migration code we never do not mis-access databases.

  1. This is effectively enabled only when running Migration[2.0]
  2. This effectively allows to discover broken usage of #finalize of background migrations that misuses connections and prevent data corruption

Related work:

  • #358430 (closed) - describes a general rollout process of Migration[2.0]
  • #362268 (closed) - it is effectively part of that, to ensure that if operation misusing connection is run it is discovered and forbid
  • !87412 (merged) - the fix to allow #finalize of BM to work properly

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 Kamil Trzciński

Merge request reports