open-build-service icon indicating copy to clipboard operation
open-build-service copied to clipboard

Regexp for Github issue tracker does not work always

Open dgdavid opened this issue 4 years ago • 1 comments

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 avatar Jun 23 '20 12:06 dgdavid

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

dgdavid avatar Jun 23 '20 13:06 dgdavid