Loading
Show upstream lock state on files inside locked directories
What does this MR do and why?
When a directory is locked, files inside it showed a Lock button that did nothing when clicked, and users without unlock permission saw no lock indicator at all. This MR makes files inside a locked directory show the Locked disclosure for all users, with an alert explaining the parent directory lock and a View lock link to the locked directory. It reuses the slot-based treatment the directory lock button already uses; an exact file lock still takes precedence.
The change is behind the default-off repository_lock_information feature flag.
References
- Bug report: #545279 (comment 3693646082)
- Originating review thread: !249473 (comment 3693644321)
Related to #545279 (closed)
Screenshots or screen recordings
Videos of the previous behavior are in the bug report note linked above.
How to set up and validate locally
- Enable the feature flag in the rails console:
Feature.enable(:repository_lock_information). - Make sure your instance has an EE license that includes file locks.
- Lock a directory, either from the directory page lock button or in the rails console with
PathLocks::LockService. - Visit a file inside that directory as a user with push access: the
Lockeddisclosure appears with the parent directory alert and aView locklink, and noUnlock fileaction. - Visit the same file as a user without push access (for example a Reporter): the same
Lockeddisclosure appears instead of nothing. - Visit a file outside the locked directory: the plain
Lockbutton still appears for users who can lock.


