Skip to content

Adding Caps A-F in GIT_BODY_MESSAGE_REGEXP for allowing the caps code 001E

  • Please check this box if this contribution uses AI-generated content as outlined in the GitLab DCO & CLA

What does this MR do and why?

backend

GitLab import repository feature is validating the remote git url. The check is performed on the initial file chunk received on the external git url and it is checked against the regular expression /^[0-9a-f]{4}#{GIT_EXPECTED_FIRST_PACKET_LINE}/

Now this regular expression is valid for most of the git server but some of the git server like Bonobo returns the value in capital letter in response like github returns code 001e# while Bonobo git server returns the code 001E#. Due to this regex, Bonobo import was failing and was not able to validate the git repo URL of Bonobo server.

I have added the Caps A-F in regex to allow this. Which is now /^[0-9a-fA-F]{4}#{GIT_EXPECTED_FIRST_PACKET_LINE}/

The reason for doing this Git Bash command line is easily recognizing the git repo with code 001E# (with Caps) but Gitlab import doesn't. And as per the community research, many users are facing this issue for migrating from Bonobo to Gitlap and importing hundreds of repos from there.

This minor change will facilitate the Bonobo users to easily migrate to GitLab.

Screenshots or screen recordings

Here is the response from Bonobo repository url

Screenshot 2024-04-17 183807.png

Here is the response from GitHub repository url

Screenshot_2024-04-17_184259

How to set up and validate locally

  1. To test this feature, please use any Bonobo repository URL and try to import using Repository URL while creating the new project in GitLab. When you test on current release, it will give the validation error of not a valid Git repository.
  2. After applying this changes, repeat the steps again to import and it should successfully import the Bonobo Git repository to GitLab.
Edited by 🤖 GitLab Bot 🤖

Merge request reports