LFS settings not visible in project settings page
Summary
It seems like there was some discontinuity in the implementation of git-lfs support. The Docs don't explicitly state that git-lfs settings in the project settings page is only visibile to admins, and it's not clear if that's the way that setting was meant to be implemented.
There is indication (see this comment) from an issue created to discuss implementing git-lfs administration. However, the user docs instruct users to review their project's git-lfs settings if they receive a 501
error after setting up git-lfs on a repository.
In our current version (9.13-ee
), any non-admin that visits a project's settings page can not view/change the git-lfs enable settings for their project.
Steps to reproduce
- set up a GitLab sandbox
- create an admin user and a non-admin user
- have the non-admin user create a project
- view the project's settings page after project creation (as the non-admin user and project owner)
- observe that there is no git-lfs setting on the page
- log in as admin user
- go to the new project's settings page
- observe that there is the option to enable/disable git-lfs
Note: we have several thousand projects that were created prior to git-lfs support being introduced to gitlab. The affect on the enabled/disabled state of various projects seems inconsistent but is difficult to research or provide exact reproduction steps without the assistance of a gitlab engineer helping with some rake commands or queries.
We have worked with @xyzzy and @jwoods06 to create the repro scenario above in a GitLab sandbox to verify the common behavior pattern with new projects.
Example Project
N/A due to requirements of Global Admin privileges
What is the current bug behavior?
- project owners can not see or enable git-lfs on their projects
What is the expected correct behavior?
- project owners should be able to see and enable (or disable) git-lfs in their projects (as documented)
Output of checks
Expand for output related to GitLab environment info
System information System: RedHatEnterpriseServer 7.3 Proxy: no 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 Redis Version: 3.2.5 Git Version: 2.11.1 Sidekiq Version:4.2.7
GitLab information Version: 9.1.3-ee Revision: e28218c Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql DB Version: 9.2.18 URL: https://some.url HTTP Clone URL: https://some.url/some-group/some-project.git SSH Clone URL: git@some.url:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: yes Using Omniauth: no
GitLab Shell Version: 5.0.2 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 GitLab application check
Checking GitLab Shell ...GitLab Shell version >= 5.0.2 ? ... OK (5.0.2) 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: ... <projects redacted due to length, all came back as OK or empty> 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.11.1) active users:
Possible fixes
- unsure if this is intended behavior or a documentation incongruity
- clarify in documentation what settings are only visible to global admins in a project's settings page
(If you can, link to the line of code that might be responsible for the problem)