Skip to content

Fix 500 errors in Projects::AutocompleteSourcesController

Stan Hu requested to merge sh-fix-error-500-autocomplete-sources into master

What does this MR do and why?

This commit fixes 500 errors when:

  1. No type parameter specified for commands, members, or labels. Now we return 400 Bad Request.
  2. 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.

Edited by Phil Calder

Merge request reports

Loading