target / captains-log

A continuous integration plugin that helps organize release information in slack
https://target.github.io/captains-log/
Other
31 stars 4 forks source link

refactor: enhance github url regex #88

Closed AndersDJohnson closed 3 years ago

AndersDJohnson commented 3 years ago

Description

Enhances the GitHub URL regex to only match issue URLs rather than any GitHub URL with digits in the path, to support multiple subdomains for some companies, to not limit supported domain and owner and repo names to basic A-Z character set but to support other ASCII or Unicode characters, etc. - all while retaining the fix from #86, mostly by using a [^\s] pattern to avoid matching whitespace.

Motivation and Context

There were some false positives and some cases where existing regex wouldn't quite work.

How Has This Been Tested?

Existing unit tests pass. Added some more unit tests that fail without the changes but pass with.

Without changes:

Screen Shot 2020-10-26 at 6 46 20 AM

With changes:

Screen Shot 2020-10-26 at 6 49 21 AM

Screenshots (if appropriate):

Types of changes

Checklist: