Skip to content

Refactor `projects_grade` to unify logic to fetch the `projects`

What does this MR do and why?

We have a bug where archived projects are showing up in the security dashboard. That dashboard should only show stats from un-archived projects.

To fix that bug, I need to exclude archived projects in the query to fetch products in the model.

While looking into that, I noticed the "fetch projects to operate on" logic was spread across the class and instance methods

This refactor uses a lambda to share the logic, so that I can fix the bug in one place in this followup MR

I also added some specs to explicitly document some of the current behavior

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  • ci passes

Related to #11478 (closed)

Edited by Michael Becker

Merge request reports

Loading