Optimization: don't load a User when user_id is missing
What does this MR do and why?
Contributes to #482942 (closed)
Problem
We try to load a user even when ssh_known_hosts_verified_by_id is
missing. It triggers unnecessary requests to the database.
Solution
Verify if the id is set before making a request.
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.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
- Visit http://gdk.test:3000/gitlab-org/gitlab-test/-/settings/repository#js-push-remote-settings
- Check performance bar queries
- Query like
SELECT "users".* FROM "users" WHERE "users"."id" IS NULL LIMIT 1should be missing there.
Numbered steps to set up and validate the change are strongly suggested.
Edited by Vasilii Iakliushin

