Change the gerrit_patch_id regexp from
r'https://gerrit(?:-test|)\.wikimedia\.org/r/.*(\d+)(?:$|\]\])'
to
r'https://gerrit(?:-test|)\.wikimedia\.org/r/(\d+)(?:$|\]\])'
The .* in the old regexp was collecting most of the digits expected to
be matched by the (\d+). For example if the input was
https://gerrit.wikimedia.org/r/875932, the collected digits would just
be "2".