Add ability to limit branch name length
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=377956) </details> <!--IssueSummary end--> <!-- This template is a great use for issues that are feature::additions or technical tasks for larger issues.--> ### Proposal User requested the ability to set limit on branch name length https://gitlab.com/gitlab-org/gitlab/-/issues/21243#note_215123061: > It will be nice to customize the length of the branch name. Since [the lenght of the label of a domain](https://stackoverflow.com/questions/32290167/what-is-the-maximum-length-of-a-dns-name/32294443) and the name of a [DB in MySQL](https://dev.mysql.com/doc/refman/8.0/en/identifiers.html) are limited to 63 characters, I'm running into an issue with the name of the branches created from an **Issue** and the **Web IDE**. I need to limit the length of the branch name to `63` characters because I use the branch name to create the domain (i.e `<branch_name>.review.myproject.com`) and DB when creating newly environments for my project. With https://gitlab.com/gitlab-org/gitlab/-/merge_requests/93108 we added the ability to set a template for a branch name created from an issue. This issue is to add on this functionality of the branch name template and add a limit to the length of the name. ## Concept From https://gitlab.com/gitlab-org/gitlab/-/issues/21243#note_1059275777 ![image](/uploads/2d0f81f644620d1fabd6ed9af9b11d93/image.png) <!-- Use this section to explain the feature and how it will work. It can be helpful to add technical details, design proposals, and links to related epics or issues. --> <!-- Consider adding related issues and epics to this issue. You can also reference the Feature Proposal Template (https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/issue_templates/Feature%20proposal%20-%20detailed.md) for additional details to consider adding to this issue. Additionally, as a data oriented organization, when your feature exits planning breakdown, consider adding the `What does success look like, and how can we measure that?` section. --> <!-- Label reminders Use the following resources to find the appropriate labels: - https://gitlab.com/gitlab-org/gitlab/-/labels - https://about.gitlab.com/handbook/product/categories/features/ -->
issue