404 when viewing MR made from fork to upstream repo with MR disabled
Summary
When a merge request is made from a fork back to its upstream repo when the upstream repo has disabled merge requests, GitLab still allows a merge request to be created from the fork to the upstream repo, but when the request is submitted it redirects the user to a 404 page because the destination page for the newly created merge request does not exist or is not visible.
Steps to reproduce
- Create an upstream repo. (In my case, the upstream repo is an internal repo and belongs to the namespace of an internal group.)
- Disable merge requests in the upstream repo.
- Fork the upstream repo. (In my case, the fork repo is private and belongs to the namespace of a member of the group.)
- Enable merge requests in the fork.
- Submit a merge request from a branch of the fork to a branch of the upstream repo.
Expected behavior
Since merge requests are disabled on the upstream repo and consequently cannot be viewed there, the fork should not give the option of requesting a merge into the upstream repo.
Actual behavior
As it stands, the fork relationship allows the merge request to be made to the upstream repo despite the fact that they are not supported.
Results of GitLab application Check
All my test results are pass or skip.
Checking GitLab Shell ...
GitLab Shell version >= 4.1.1 ? ... OK (4.1.1)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ...
2/2 ... ok
1/6 ... ok
3/9 ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: OK
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... yes
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
projects have namespace: ...
2/2 ... yes
1/6 ... yes
3/9 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.3)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.8.4)
Active users: 2
Checking GitLab ... Finished
Results of GitLab environment info
My URL's have been redacted.
System information
System: Ubuntu 16.04
Current User: git
Using RVM: no
Ruby Version: 2.3.3p222
Gem Version: 2.6.6
Bundler Version:1.13.7
Rake Version: 10.5.0
Sidekiq Version:4.2.7
GitLab information
Version: 8.15.3
Revision: 76bd8dd
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: https://redacted.example.org
HTTP Clone URL: https://redacted.example.org/some-group/some-project.git
SSH Clone URL: git@redacted.example.org:some-group/some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 4.1.1
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git: /opt/gitlab/embedded/bin/git