Skip to content

Geo: Fix MR diffs pending verification query

Gabriel Mazetto requested to merge 330023-fix-verification-pending-query into master

What does this MR do?

Fixes the pending verification query, to include records without a MergeRequestDiffDetail association.

To database reviewer:

We are changing the query from:

SELECT "merge_request_diffs".*
FROM "merge_request_diffs"
         INNER JOIN "merge_request_diff_details"
                    ON "merge_request_diff_details"."merge_request_diff_id" = "merge_request_diffs"."id"
WHERE ("merge_request_diffs"."state" NOT IN ('without_files', 'empty'))
  AND "merge_request_diffs"."stored_externally" = TRUE
  AND "merge_request_diffs"."external_diff_store" = 1
  AND "merge_request_diff_details"."verification_state" = 0

To:

SELECT "merge_request_diffs".*
FROM "merge_request_diffs"
         LEFT OUTER JOIN "merge_request_diff_details"
                      ON "merge_request_diff_details"."merge_request_diff_id" = "merge_request_diffs"."id"
WHERE ("merge_request_diffs"."state" NOT IN ('without_files', 'empty'))
  AND "merge_request_diffs"."stored_externally" = TRUE
  AND "merge_request_diffs"."external_diff_store" = 1
  AND ("merge_request_diff_details"."verification_state" = 0 OR "merge_request_diff_details" IS NULL)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #330023 (closed)

Edited by Gabriel Mazetto

Merge request reports

Loading