Getting Page Not Found error: when open merge request URL and project visibilty is set to public
Summary
When project visibility is set to Public and user isn't signed in on Gitlab instance. If user tries to open merge request URL which is provided at the time of pushing code on terminal, user will get HTTP 404: Page Not Found error. Whereas, if project visibility is set to Private, user will automatically redirect to the login page.
Steps to reproduce
- Create a new project and
mark tickon Initialize repository with a README (just want at least one commit so that, master branch will be created).
Note: make sure project visibility level is set toPublic. - Clone the repo.
- Now, go to cloned repo, and type following command
$ git checkout -b feature/f1
Switched to a new branch 'feature/f1'
$ touch a.txt
$ git add a.txt
$ git commit -m 'initial commit'
[feature/f1 70f1e90] initial commit
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 a.txt
$ git push
Authenticated to gitlab.com ([35.231.145.151]:22).
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 4 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 268 bytes | 268.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote:
remote: To create a merge request for feature/f1, visit:
remote: https://gitlab.com/finn02/test3/merge_requests/new?merge_request%5Bsource_branch%5D=feature%2Ff1
remote:
To gitlab.com:finn02/test3.git
* [new branch] feature/f1 -> feature/f1
Now, we will get a merge request URL, copy it.
- Before, pasting it in browser, make sure you're not
logged into gitlab account. - Paste URL and go.
We'll get a HTTP 404: Page Not Found, error.
Example Project
Example project: https://gitlab.com/finn02/test3
Merge request URL: https://gitlab.com/finn02/test3/merge_requests/new?merge_request%5Bsource_branch%5D=feature%2Ff1
What is the current bug behavior?
Getting a HTTP 404: Page Not Found, error.
What is the expected correct behavior?
If, user isn't signed in, redirect them to the login page. Just like, when project visibility is set to Private. And, check whether user has correct permission if so, allow them to create merge request.
Output of checks
This bug happens on GitLab.com
