Improve error messages and user feedback for MR title validation
Summary
Improve the user experience when a merge request title doesn't match the configured regex pattern. Currently, validation happens at merge-time with a TITLE_NOT_MATCHING status, but users need clearer guidance.
Problem to Solve
When MR title validation fails:
- Users don't see the configured description explaining the required format
- Error appears only at merge-time, not during creation/editing
- No inline feedback to help users fix the title
Proposal
1. Merge-time Error Display
When MR is blocked due to TITLE_NOT_MATCHING:
- Show the configured
mergeRequestTitleRegexDescriptionprominently - Provide example of valid title format
- Link to project settings (for maintainers)
2. Inline Validation (Optional for v1)
- Show validation status while editing MR title
- Real-time feedback: ✓ or ✗ next to title field
- Display description text below title input
3. Creation-time Warning
- When creating MR with invalid title, show warning banner
- Allow creation but indicate merge will be blocked
- Suggest fixing title before requesting review
Implementation Notes
Existing Status:
- Backend returns
TITLE_NOT_MATCHINGin detailed merge status -
mergeRequestTitleRegexDescriptionfield available via GraphQL
UI Locations to Update:
- MR creation form
- MR edit title modal
- MR widget (merge blocked state)
- MR overview page
Acceptance Criteria
-
Merge widget shows clear error when title doesn't match regex -
Error message includes the configured description text -
Users can see validation status before attempting to merge -
Error message is actionable (tells users how to fix) -
Draft/WIP status is handled appropriately in validation
UX Considerations
-
How to handle Draft MRs (validate with or without "Draft:" prefix?) -
Should validation be real-time or on-save? -
What happens if regex is changed after MR creation?
Related Issues
- Parent: gitlab-org#20108 (Epic)
- Related: #25689 (original feature request)