Backport of 'Speed up assignee and reviewer pickers for Duo service accounts'

What does this MR do and why?

This is a backport of !258214 (merged) to 19.3. The change is already merged to master and deployed to GitLab.com, where we verified it in production. It fixes a severity 1, customer-impacting issue.

The assignee and reviewer pickers (the GraphQL autocomplete users search) became very slow when Duo flow service accounts were in the results. For every service account returned, we loaded its flow triggers for all projects, then kept only the ones for the current project in Ruby. This backport has the same change as master:

  • Load the flow triggers in one batched query that is limited to the current project (or the projects of the current group).
  • Stop preloading every trigger in the autocomplete users finder.

On GitLab.com, a search for "duo" took 8 to 10 seconds and about 400 MiB of memory before. After the change it takes about 0.45 seconds and about 20 MiB.

The change is adapted for 19.3 because inherited group triggers do not exist on this version. That code is not part of this backport. The finder spec, the request spec for query counts, and the type spec (project, group, no parent, and batching) are updated.

References

MR acceptance checklist

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

  • This MR is backporting a bug fix, documentation update, or spec fix, previously merged in the default branch.
  • The MR that fixed the bug on the default branch has been deployed to GitLab.com (not applicable for documentation or spec changes).
  • The MR title is descriptive (e.g. "Backport of 'title of default branch MR'"). This is important, since the title will be copied to the patch blog post.
  • Required labels have been applied to this merge request
  • This MR has been approved by a maintainer (only one approval is required).
  • Ensure the E2E Omnibus GitLab EE pipeline (triggered by thee2e:test-on-omnibus-ee job) has succeeded. If it has failed (or shows warnings), investigate the failures. If you determine the failures are unrelated, you may proceed. If you need assistance investigating, request help in the #s_developer_experience Slack channel to confirm the failures are unrelated to the merge request.

Note to the merge request author and maintainer

If you have questions about the patch release process, please:

Edited by Jaydip Pansuriya

Merge request reports

Loading
Loading