Changing a group with the API reverts the visibility to private

Summary

When editing a group with the api (PUT) the visibility reverts to private.

Steps to reproduce

$ curl -H 'Content-Type: application/json' -H  'PRIVATE-TOKEN: ACCTEST' http://127.0.0.1:8080/api/v4/groups -X POST  -d '{"name": "test", "path": "test", "visibility": "public"}'
{"id":89,"name":"test","path":"test","description":"","visibility":"public","lfs_enabled":true,"avatar_url":null,"web_url":"http://6ca948c93689/groups/test","request_access_enabled":false,"full_name":"test","full_path":"test","parent_id":null,"projects":[],"shared_projects":[]}
$ curl -H 'Content-Type: application/json' --insecure -H  'PRIVATE-TOKEN: ACCTEST' http://127.0.0.1:8080/api/v4/groups/89 -X PUT  -d '{"path": "newtest"}'
{"id":89,"name":"test","path":"newtest","description":"","visibility":"private","lfs_enabled":true,"avatar_url":null,"web_url":"http://6ca948c93689/groups/newtest","request_access_enabled":false,"full_name":"test","full_path":"newtest","parent_id":null,"projects":[],"shared_projects":[]}

If not explitely set in the PUT request, visibility switched back to private.

What is the current bug behavior?

Changes to fields not related to visibility changes visibility

What is the expected correct behavior?

Visibility is changed only when explicitely set in the PUT request.

Output of checks

(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)

Results of GitLab environment info

Expand for output related to GitLab environment info

[33mSystem information[0m System: Current User: git Using RVM: no Ruby Version: 2.3.5p376 Gem Version: 2.6.13 Bundler Version:1.13.7 Rake Version: 12.0.0 Redis Version: 3.2.5 Git Version: 2.13.5 Sidekiq Version:5.0.4 Go Version: [31munknown[0m

[33mGitLab information[0m Version: 10.0.0 Revision: bbf5c73 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: http://6ca948c93689 HTTP Clone URL: http://6ca948c93689/some-group/some-project.git SSH Clone URL: git@6ca948c93689:some-group/some-project.git Using LDAP: no Using Omniauth: no

[33mGitLab Shell[0m Version: 5.9.0 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check
Checking [33mGitLab Shell[0m ...

GitLab Shell version >= 5.9.0 ? ... [32mOK (5.9.0)[0m Repo base directory exists? default... [32myes[0m Repo storage directories are symlinks? default... [32mno[0m Repo paths owned by git:root, or git:git? default... [32myes[0m Repo paths access is drwxrws---? default... [32myes[0m hooks directories in repos are links: ... [33m47[0m/[33m51[0m ... [35mrepository is empty[0m [33m1[0m/[33m57[0m ... [35mrepository is empty[0m Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK

Access to /var/opt/gitlab/.ssh/authorized_keys: OK [32mgitlab-shell self-check successful[0m

Checking [33mGitLab Shell[0m ... [32mFinished[0m

Checking [33mSidekiq[0m ...

Running? ... [32myes[0m Number of Sidekiq processes ... [32m1[0m

Checking [33mSidekiq[0m ... [32mFinished[0m

Reply by email is disabled in config/gitlab.yml Checking [33mLDAP[0m ...

LDAP is disabled in config/gitlab.yml

Checking [33mLDAP[0m ... [32mFinished[0m

Checking [33mGitLab[0m ...

Git configured correctly? ... [32myes[0m Database config exists? ... [32myes[0m All migrations up? ... [32myes[0m Database contains orphaned GroupMembers? ... [32mno[0m GitLab config exists? ... [32myes[0m GitLab config up to date? ... [32myes[0m Log directory writable? ... [32myes[0m Tmp directory writable? ... [32myes[0m Uploads directory exists? ... [32myes[0m Uploads directory has correct permissions? ... [32myes[0m Uploads directory tmp has correct permissions? ... [35mskipped (no tmp uploads folder yet)[0m Init script exists? ... [35mskipped (omnibus-gitlab has no init script)[0m Init script up-to-date? ... [35mskipped (omnibus-gitlab has no init script)[0m Projects have namespace: ... [33m47[0m/[33m51[0m ... [32myes[0m [33m1[0m/[33m57[0m ... [32myes[0m Redis version >= 2.8.0? ... [32myes[0m Ruby version >= 2.3.3 ? ... [31mException: undefined method run_command' for SystemCheck::App::RubyVersionCheck:Class Did you mean? run_commands[0m Git version >= 2.7.3 ? ... [31mException: undefined method run_command' for SystemCheck::App::GitVersionCheck:Class Did you mean? run_commands[0m Git user has default SSH configuration? ... [31mno[0m [34m Try fixing it:[0m mkdir ~/gitlab-check-backup-1506523271 sudo mv /var/opt/gitlab/.ssh/authorized_keys.lock ~/gitlab-check-backup-1506523271 [34m For more information see:[0m doc/ssh/README.md in section "SSH on the GitLab server" [31m Please fix the error above and rerun the checks.[0m Active users: ... [32m1[0m

Checking [33mGitLab[0m ... [32mFinished[0m

Assignee Loading
Time tracking Loading