Skip to content

Resolve N+1 query issue for scanners in StoreSecurityReportsWorker [RUN ALL RSPEC] [RUN AS-IF-FOSS]

Saikat Sarkar requested to merge resolve_n+1 into master

What does this MR do?

This MR is related to this issue.

Database

INSERT INTO "vulnerability_scanners" ("project_id",
                                      "external_id",
                                      "name",
                                      "vendor",
                                      "created_at",
                                      "updated_at")
VALUES (66, 'find_sec_bugs', 'Find Security Bugs', 'GitLab', '2021-04-02 09:14:56.601705', '2021-04-02 09:14:56.601763'),
       (66, 'bandit', 'Bandit', 'GitLab', '2021-04-02 09:14:56.601853', '2021-04-02 09:14:56.601898'),
       (66, 'flawfinder', 'Flawfinder', 'GitLab', '2021-04-02 09:14:56.601981', '2021-04-02 09:14:56.602026') ON CONFLICT ("id") DO
UPDATE
SET "project_id"=excluded."project_id",
    "external_id"=excluded."external_id",
    "name"=excluded."name",
    "vendor"=excluded."vendor",
    "created_at"=excluded."created_at",
    "updated_at"=excluded."updated_at" RETURNING "id";

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • 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
Edited by Toon Claes

Merge request reports