Skip to content

Merge requests for confidential issues no longer works for newly forked projects

According to https://docs.gitlab.com/ee/user/project/issues/confidential_issues.html#merge-requests-for-confidential-issues, we introduced merge requests for confidential issues in GitLab 12.1.

In GitLab 12.6, in !20466 (merged), we changed the behavior to remove a fork from the fork network when the visibility decreased. This breaks merge requests for confidential issues because this feature makes an API call that requests forks that have:

  1. Merge requests enabled
  2. User has an access level of developer
  3. The forked project has to be Private

For example, @clefelhocz1 forked gitlab-com/www/gitlab-com, a public project. Then he changed the visibility to Private so that it would come up in the list of private forks. However, the dropdown for the list of private forks came up empty. We checked that https://gitlab.com/api/v4/projects/gitlab-com%2Fwww-gitlab-com/forks?with_merge_requests_enabled=true&min_access_level=30&visibility=private came up empty. We confirmed that the project is no longer a fork:

[ gprd ] production> proj = Project.find_by_full_path('clefelhocz1/www-gitlab-com')
=> #<Project id:20784253 clefelhocz1/www-gitlab-com>>
[ gprd ] production> proj.forked?
=> nil

However, since I forked this project before this 12.6, I can still create merge requests for confidential issues.

from: @clefelhocz1

Steps to reproduce:

  1. Open a confidential issue
  2. Click Create confidential merge request button
  3. Since you can't select a project click "fork this project"
  4. Select namespace (I chose mine) for forking repo
  5. Once project is created, select settings->General->Visibility and set it to "Private"
  6. Return to confidential issue, reload page and see that the project is still not available to select for a confidential MR.

/cc: @jramsay

Edited by Christopher Lefelhocz