Skip to content

Commit

Permalink
fenix: limit the maximum number of digits for issue patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
hadfl committed May 31, 2024
1 parent 49b843c commit e10f662
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/Fenix/Model/Handler/Issue/Gerrit.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sub issues($self, $msg) {
my $urlre = qr!\b\Q$baseurl\E/c/illumos-gate/\+/(\d+)\b!;
for ($msg) {
return ([ /$urlre/g ], { url => 1 }) if /$urlre/;
return [ /\b(\d{2,})\b/g ] if /\bcode\b/i;
return [ /\b(\d{2,5})\b/g ] if /\bcode\b/i;
}

return [];
Expand Down
2 changes: 1 addition & 1 deletion lib/Fenix/Model/Handler/Issue/IPD.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sub issues($self, $msg) {
my $urlre = qr!\b\Q$baseurl\E/illumos/ipd/\S+/ipd/0+(\d+)/README\.md\b!i;
for ($msg) {
return ([ /$urlre/g ], { url => 1 }) if /$urlre/;
return [ /\bIPD[-\s]*(\d+)\b/ig ];
return [ /\bIPD[-\s]*(\d{1,3})\b/ig ];
}
return [];
Expand Down
4 changes: 2 additions & 2 deletions lib/Fenix/Model/Handler/Issue/Illumos.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ sub issues($self, $msg) {
my $urlre = qr!\b\Q$baseurl\E/issues/(\d+)\b!;
for ($msg) {
return ([ /$urlre/g ], { url => 1 }) if /$urlre/;
return [ /\b(\d{3,})\b/g ] if /\b(?:illumos|issue)\b/i;
return [ /#(\d{3,})\b/g ];
return [ /\b(\d{3,5})\b/g ] if /\b(?:illumos|issue)\b/i;
return [ /#(\d{3,5})\b/g ];
}

return [];
Expand Down
2 changes: 1 addition & 1 deletion lib/Fenix/Model/Handler/Issue/SmartOS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sub issues($self, $msg) {
my $urlre = qr!\b\Q$baseurl\E/bugview/([A-Z]+-\d+)\b!;
for ($msg) {
return ([ /$urlre/g ], { url => 1 }) if /$urlre/;
return [ /\b([A-Z]+-\d+)\b/g ];
return [ /\b([A-Z]+-\d{1,5})\b/g ];
}

return [];
Expand Down

0 comments on commit e10f662

Please sign in to comment.