Rebase should use a lock or state machine to indicate a MR is being rebased

Zendesk: https://gitlab.zendesk.com/agent/tickets/73086

merge_request.rebase_in_progress? checks rely on the existence of the rebase directory. In some cases, such as a large repository, the clone make take some time and the directory won't exist until the clone is complete. When this happens the merge request page will likely reload and the rebase button will be available again. Users can mash this button over and over, creating multiple rebase jobs.

It would be safer to implement a state machine or lock file to track rebases in progress. Then we can show the correct state and prevent multiple rebases.

@vsizov Can you take a look, please?

Edited Jun 16, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading