Skip to content

Fix preloading of project dashboard access levels

What does this MR do and why?

The #load_max_project_member_accesses helper was preloading into the wrong request store. This changes it to use the recently added Preloaders::UsersMaxAccessLevelInProjectsPreloader class that has more advanced preloading logic.

Part of #214037

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

  1. Change the expected count to 3 in the N+1 test at spec/features/dashboard/projects_spec.rb:255.
  2. Run the N+1 test; observe that it passes.
  3. Revert the helper method to what it was before
  4. Run the N+1 test; observe that it fails with the max access level being offending query

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Hordur Freyr Yngvason

Merge request reports