Fixes target projects endpoint 404 on compare revisions view
What does this MR do and why?
Fixes the target projects endpoint raising a 404 when viewing the compare revisions page when you do not have permission to create a merge request. This was caused by the endpoint being under the merge request creations controller which checks permissions for creating a merge request.
As this endpoint is shared between 2 views this change moves the endpoint to a controller that will render a 404 when the user doesn't have the right create permissions.
References
Screenshots or screen recordings
How to set up and validate locally
- Visit https://gdk.test:3000/gitlab-org/gitlab-test/-/compare?from=master&to=master when not logged in
- No error banner should be visible and the target projects dropdown should load data
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Phil Hughes