Skip to content

Fix project insights with projects.only parameter

What does this MR do?

This change filters out charts where the currently visited project is filtered out via the projects.only parameter. This fixes the missing chart error message.

The MR is also fixing the finder to return always an ActiveRecord::Relation object in order to avoid nil errors when chaining AR scopes.

Screenshots

We have two cases:

  • All items (charts) have projects.only filters not containing the currently visited project.

insights_without_charts

  • Some items have projects.only filters where the currently visited project is not included.

filtered_insights

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

Closes #212688 (closed)

Edited by Adam Hegyi

Merge request reports