File Lock (EE option)
Description
It's not possible (in most cases) to merge a binary file (a non-text file). This causes issue when you make changes to one, but someone pushes a change to the same file before you were able to push your changes. You end up with an unmergeable situation.
To prevent this, we propose to implement file locking. File locking allows you to prevent other people from modifying one of multiple files, while still allowing you to push changes. This prevents situations where files become unmergeable.
Use cases
Anyone using binary files in their repository can use this. For instance, game developers are likely to have many unmergeable files in their repositories like PSD's, images, 3d models, etc. They would greatly benefit from this feature.
As the use of LFS increases, people are more likely to have binary files in their repositories, increasing the odds someone will use this feature.
Implementation
If we add the project.path_locked?(path)
check into Gitlab::GitAccess
, it will automatically apply to web edits, git pushes and LFS pushes.
So this feature entails:
- Adding model for locked files or directories
- Adding "Lock"/"Unlock" button in UI. A locked file or directory can only be unlocked by the lock user or a project master
- Disable edit, replace, delete, new file buttons with a tooltip as appropriate
- Show lock icon by any locked file/dir with a tooltip on that lock icon with text like "Locked by Douwe Maan 5 minutes ago"
- Add page to list all locked files/dirs to get overview in case people forget to unlock
- Add
path_locked?
check en error message inGitlab::GitAccess
References
Todo
This feature needs to be build, put on the website, added to sales software, taught to sales. It will require more than release to do that, I expect.
-
build feature as EE option -
make sure we can generate licenses for this -
sync with sales and marketing on release, pricing, etc https://gitlab.com/gitlab-org/gitlab-ee/issues/498