1. 26 Oct, 2021 10 commits
    • Dylan Griffith's avatar
      Ignore FactoryBot #create for cross-database modification detection · efbb0d41
      Dylan Griffith authored
      This was causing too many false positives which are not representative
      of code that is actually running in production. It is very common in
      tests to build a tree of related objects in FactoryBot and save them all
      in one go with `save!` (this is the default behaviour in FactoryBot for
      association building). When this is done it creates an outer transaction
      and saves all the models within the context of this transaction. If 2 of
      the models belong in a different `gitlab_schema` (database) then this
      triggers our cross-database modification detection logic. While there is
      a chance that this could be indicative of problems in our model code
      (eg. `before_save` and so on) it is more often than not just a problem
      with how our factories are building a relation tree.
      
      A simple example is included as an RSpec test here where we create a
      `ci_runner` and `project` (which in turn creates a `user`) all in one
      go. This is convenient in tests but it is never going to happen in real
      production code as there is no way to create a project at the same time
      as creating a runner (let alone user). You would always have a project
      and a user and then later create the runner for that project.
      
      Our PreventCrossDatabaseModification detection logic is designed to find
      places in our code where we are writing to 2 different databases in the
      context of a transaction of one of those databases. This was introduced
      because we are decomposing our database into separate databases.
      Specifically we are moving all CI tables to a separate CI database. It's
      important that we find and fix any places in our code where we are
      opening a transaction and expecting all transaction semantics (ie.
      rollbacks) to apply to all database queries within that context. When
      you have 2 databases there may be places where we are only rolling back
      some of the queries in that transaction which could lead to data
      inconsistency bugs. As such we need to detect and restructure such
      transactions so that each case is properly handled.
      efbb0d41
    • Luke Duncalfe's avatar
      Merge branch 'revert-6665b71e' into 'master' · d95a43df
      Luke Duncalfe authored
      Revert "Merge branch 'yorick/clean-up-merge-request-diff-commits-migration' into 'master'"
      
      See merge request gitlab-org/gitlab!73035
      d95a43df
    • Evan Read's avatar
      Merge branch 'selhorn-artifacts-alphabetize' into 'master' · 6da91042
      Evan Read authored
      Alphabetized artifacts reports keywords
      
      See merge request gitlab-org/gitlab!73022
      6da91042
    • Evan Read's avatar
      Merge branch 'docs-spt-242861' into 'master' · b32663dd
      Evan Read authored
      Add a list of how account creation
      
      See merge request gitlab-org/gitlab!73014
      b32663dd
    • Mark Lapierre's avatar
      Merge branch '343639-fix-qa-failure' into 'master' · 86544f72
      Mark Lapierre authored
      Fix `online_garbage_collection_spec.rb` QA failure
      
      See merge request gitlab-org/gitlab!72888
      86544f72
    • Coung Ngo's avatar
      e62beab7
    • Dylan Griffith's avatar
      Merge branch 'shrink_cross_join6' into 'master' · 398ede31
      Dylan Griffith authored
      Shrink cross-db spec allowlist
      
      See merge request gitlab-org/gitlab!73031
      398ede31
    • Evan Read's avatar
      Merge branch 'mvanremmerden-master-patch-42136' into 'master' · 4cb55fcb
      Evan Read authored
      Add mocha to javascript examples
      
      See merge request gitlab-org/gitlab!72963
      4cb55fcb
    • Marcel van Remmerden's avatar
      Add mocha to javascript examples · d8f7ddde
      Marcel van Remmerden authored
      d8f7ddde
    • Luke Duncalfe's avatar
      Revert "Merge branch 'yorick/clean-up-merge-request-diff-commits-migration' into 'master'" · 0f5133b2
      Luke Duncalfe authored
      This reverts merge request !72219
      0f5133b2
  2. 25 Oct, 2021 30 commits