Refresh commit list lock labels after lock changes
What does this MR do and why?
Part of #545279 (closed). Stacked on !249473 (merged) (targets its branch); marked as related work in the feature breakdown below.
| Task | MR | |
|---|---|---|
Add createdAt to PathLock GraphQL type |
!249031 (merged) | |
| Add component | !246285 (merged) | |
| Use component to lock file | !246286 (merged) | |
| Use component to lock directories | !249473 (merged) | |
| Refresh commit list lock labels | this MR | |
| Show upstream lock state on files inside locked directories | !250523 (merged) | |
| Update documentation | !250296 (merged) |
The lock labels in the commit list ("Locked by <user>") come from the logs_tree REST endpoint and are cached in the commits service. The legacy directory lock button kept them accurate with a full page reload after every lock change. The new lock button (added in the MRs above) updates through Apollo instead, so the REST-cached labels went stale until the next navigation.
This MR:
- Emits a
lock:updatedevent on the repository event hub after a successful lock/unlock mutation in the lock button. - Adds
reloadCommitsto the commits service, which refetches every already-loaded commit batch. - Subscribes
tree_content.vueto the event and reloads the commit data, so lock labels refresh in place without a page reload.
References
- Issue: #545279 (closed)
Screenshots or screen recordings
How to set up and validate locally
-
Enable the feature flag:
Feature.enable(:repository_lock_information) -
As a maintainer, open a directory in a project repository (
/<group>/<project>/-/tree/master/<some-dir>) on a Premium/Ultimate GDK. -
Lock the directory using the Lock button → after the "The directory is locked." toast, the Lock column entries for the directory's rows update in place (no page reload).
-
Unlock the directory → the lock labels clear, again without a reload.
-
Scroll down first so several commit batches load, then lock → all loaded rows refresh, not only the first batch.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #545279 (closed)