Fix routing for raw snippets with semantic version branch names
What does this MR do and why?
Contributes to #372466 (closed)
Problem
Raw snippet requests fail with 404 errors when the default branch name
contains dots (e.g., "0.0.x"). The routing pattern doesn't properly
handle semantic version branch names, causing URLs like
/-/snippets/71/raw/0.0.x/test to be treated as unmatched routes.
Solution
Update the snippet routing constraints to properly parse branch names containing dots and other semantic version characters.
References
snippits cannot be edited if created when seman... (#372466 - closed)
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
- visit
/admin/application_settings/repository - change the default branch name to
0.0.x - create a snippet with a file
- edit the newly created snippet
- it should load the snippet content and allow to edit it
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 #372466 (closed)
Edited by Vasilii Iakliushin

