openSUSE / open-build-service

Build and distribute Linux packages from sources in an automatic, consistent and reproducible way #obs
https://openbuildservice.org
GNU General Public License v2.0
936 stars 440 forks source link

Regexp for Github issue tracker does not work always #9814

Open dgdavid opened 4 years ago

dgdavid commented 4 years ago

Hi there!

Today, while working on https://github.com/openSUSE/packaging_rake_tasks/pull/54, I realize that the Github regexp does not work for most of the YaST repositories, which contain at least one hyphen.

https://github.com/openSUSE/open-build-service/blob/f362d50232018a81f27af98cd309f16a73332cb7/src/api/db/seeds.rb#L326-L330

After taking a look here and there, I ended fixing it on our side (see https://github.com/openSUSE/packaging_rake_tasks/pull/55) using a slightly complicated regexp.

 /(?:gh|github)#([a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}\/[\w.-]+#\d+)/i

which seems to work :wink:

dgdavid commented 4 years ago

Related to https://github.com/openSUSE/open-build-service/pull/6875