Skip to content

Update issue closing pattern to be more forgiving

What does this MR do?

  1. Allows oxford commas (comma before and) when closing multiple issues in an MR (#17500 (closed))
  2. Allows spaces before commas when closing multiple issues in an MR - I thought it would be a good idea to make it a bit more forgiving (without allowing false positives naturally)

Are there points in the code the reviewer needs to double check?

Well, this is my first MR to Gitlab, so... 😅

I tried to extract the spaces-before-comma part out, so %{issue_ref} *(?:(?:,? +and +|, *)?) instead of %{issue_ref}(?:(?: *,? +and +| *, *)?), but it seems to confuse the regex engine. Compare on Rubular: this works, this doesn't.

Why was this MR needed?

To make closing issue extraction align more with what humans expect.

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #17500 (closed)

Edited by Vicky Chijwani

Merge request reports