Fix 500 errors in Projects::AutocompleteSourcesController
What does this MR do and why?
This commit fixes 500 errors when:
- No
type
parameter specified for commands, members, or labels. Now we return 400 Bad Request. - When an anonymous user attempts to load the list of commands for a public project. Previously this would error out while checking for permissions; now the endpoint returns an empty array.
Relates to gitlab-com/gl-infra/production#7820 (closed) #376088 (closed)
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Phil Calder