Loading
Add merge request buttons to refactored commits page
What does this MR do and why?
This MR adds the MR buttons to the refactored commit list:
- "Create merge request" button when viewing a non-default branch with no open MR (if the user has permission)
- "View open merge request" button when an open MR already exists from that branch to the default branch
This button is in the overflow menu on mobile.
References
Resolves #598206
Screenshots or screen recordings
| Light mode | Dark mode | Mobile | |
|---|---|---|---|
| View open MR | |||
| Create MR |
How to set up and validate locally
- Enable the
project_commits_refactorfeature flag in the Rails console:Feature.enable(:project_commits_refactor) - Visit a project's commits page on a non-default branch as a developer
- Verify the "Create merge request" button appears in the page header
- Create an MR from that branch and revisit the commits page
- Verify the "Create merge request" button changes to "View open merge request"
- Visit the default branch, a tag, or a commit SHA ref
- Verify no merge request button appears on any of these ref types
- Use the ref selector dropdown to switch between branches
- Verify the button updates correctly without a page reload
Edited by Chaoyue Zhao





