From 8b32612175438a61aa217183f0fb33621436becb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Buclin?= Date: Mon, 11 Nov 2024 15:59:50 +0100 Subject: Add sysadmin-bugs@ml.mageia.org to the CC list when the validated_backport keyword is set (mga#33741) --- extensions/Mageia/Extension.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'extensions/Mageia/Extension.pm') diff --git a/extensions/Mageia/Extension.pm b/extensions/Mageia/Extension.pm index e419e4882..c2f8466e7 100644 --- a/extensions/Mageia/Extension.pm +++ b/extensions/Mageia/Extension.pm @@ -35,11 +35,11 @@ use constant MGA_SETTINGS => { sub bug_end_of_create_validators { my ($self, $args) = @_; - # If a user enters 'validated_update' as keyword, + # If a user enters 'validated_update' or 'validated_backport' as keyword, # automatically CC sysadmin-bugs@ml.mageia.org. my $keywords = $args->{params}->{keywords}; - if (grep { $_->name eq 'validated_update' } @$keywords) { + if (grep { $_->name =~ /^validated_(?:update|backport)$/ } @$keywords) { my $cc_list = $args->{params}->{cc}; if (!grep { $_ == SYSADMIN_USER_ID } @$cc_list) { push(@$cc_list, SYSADMIN_USER_ID); @@ -60,11 +60,11 @@ sub bug_end_of_update { $new_keywords_str = $args->{changes}->{keywords}->[1]; } - # If a user enters 'validated_update' as keyword, automatically - # CC sysadmin-bugs@ml.mageia.org. + # If a user enters 'validated_update' or 'validated_backport' as keyword, + # automatically CC sysadmin-bugs@ml.mageia.org. if ($new_keywords_str) { my @new_keywords = split(/[,\s]+/, $new_keywords_str); - if (grep { $_ eq 'validated_update' } @new_keywords + if (grep { $_ =~ /^validated_(?:update|backport)$/ } @new_keywords and !grep { $_->id == SYSADMIN_USER_ID } @{$bug->cc_users}) { # Safer to clear the cache and let Bugzilla regenerate them if needed. -- cgit v1.2.1