Project autocomplete members/commands NoMethodError

Summary

In production incident gitlab-com/gl-infra/production#7820 (closed), canary environment triggered an alert for elevated error ratio.

This was generated by calls to /-/autocomplete_sources/members and /-/autocomplete_sources/commands which resulted in 500 errors.

Impact

Elevated number of 500 errors, resulting in monitoring alerts.

Recommendation

Investigate calls to the followings methods:

Projects::AutocompleteSourcesController#commands
Projects::AutocompleteSourcesController#members

The endpoint shouldn't return 500 errors on missing attributes or lack of session.

Verification

Edited by Filipe Santos