Investigate to what capacity we can improve duo for db reviews

We want to improve duo chat for db reviews. A few suggestions:

  • Identify that a query has been added and flagging that it needs database review, especially outside of finders (already identified by danger) - the big place here is models and graphql queries
  • Look at and analyze query plans for some common pitfalls (needs to be in the description of the MR)
  • Look at the data we provide in the migration testing comment and see if anything looks bad (needs to be in the description MR)
  • Check if all of the likely added queries have associated plans. (needs to in the description of the MR)
  • Check if db requirements have been met before asking for a review

Could be a perfect use case for: DCR Custom Instructions

But we'd need to make sure we're very specific and explicit with what we want it to do. And this would require moving all of these to the description of the MR for Duo to access it.

An idea is to flag and say something like "please ask a db reviewer"

See current duo instructions for db reviews: https://gitlab.com/gitlab-org/gitlab/blob/fd578c5538675806e9785f3b5e27e765c8b697a7/.gitlab/duo/mr-review-instructions.yaml#L27-27

See thread/update issue as it's on-going: internal only

Edited by Irina Bronipolsky