Add UI to configure merge request title validation regex in project settings
Summary
Add user interface to Project Settings > Merge Requests to configure the merge request title validation regex. The backend infrastructure already exists (GraphQL fields: mergeRequestTitleRegex, mergeRequestTitleRegexDescription), but there's no UI to configure it.
Problem to Solve
Customers cannot access the MR title validation feature because it's only available via API/GraphQL. This blocks adoption of a highly-requested feature (133+ upvotes on #25689).
Proposal
Add a new section to Settings > Merge requests with:
- Merge request title validation section
- Text input for regex pattern (e.g.,
^(feat|fix|docs|chore): .+) - Text area for description/help text shown to users when validation fails
- Checkbox to enable/disable validation
- Preview/test functionality (optional for v1)
UI Mockup Needed
-
UX review for placement and layout -
Error state design when regex is invalid -
Help text explaining regex syntax
Implementation Notes
GraphQL Fields (already exist):
-
mergeRequestTitleRegex(String) -
mergeRequestTitleRegexDescription(String)
API Endpoints:
- Use existing project update mutation
- Validate regex pattern on save
Validation:
- Ensure regex is valid before saving
- Show preview of what titles would/wouldn't match (nice-to-have)
Acceptance Criteria
-
Settings UI appears in Project Settings > Merge Requests -
Maintainers can set a regex pattern for MR titles -
Maintainers can set a description explaining the pattern -
Invalid regex patterns show clear error messages -
Settings persist correctly via GraphQL mutation -
UI shows current values when editing -
Help text explains the feature and provides examples
Related Issues
- Parent: gitlab-org#20108 (Epic)
- Related: #25689 (original feature request)
- Related: #16080 (customize default MR title)
Documentation
-
Update project settings documentation -
Add examples for common patterns (Jira, conventional commits)