Commit b9136f1f authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'pl-fix-warning-regexp-duplicate-range' into 'master'

Fix warning: character class has duplicated range

See merge request gitlab-org/gitlab!23165
parents d9b69798 b8fdeaf0
......@@ -5,7 +5,7 @@ module SidekiqHelper
(?<pid>\d+)\s+
(?<cpu>[\d\.,]+)\s+
(?<mem>[\d\.,]+)\s+
(?<state>[DIEKNRSTVWXZNLpsl\+<>/\d]+)\s+
(?<state>[DIEKNRSTVWXZLpsl\+<>/\d]+)\s+
(?<start>.+?)\s+
(?<command>(?:ruby\d+:\s+)?sidekiq.*\].*)
\z}x.freeze
......
......@@ -100,6 +100,6 @@ class PipelinesEmailService < Service
end
def retrieve_recipients(data)
recipients.to_s.split(/[,(?:\r?\n) ]+/).reject(&:empty?)
recipients.to_s.split(/[,\r\n ]+/).reject(&:empty?)
end
end
......@@ -5,6 +5,9 @@ module Gitlab
extend self
def project_name_regex
# The character range \p{Alnum} overlaps with \u{00A9}-\u{1f9ff}
# hence the Ruby warning.
# https://gitlab.com/gitlab-org/gitlab/merge_requests/23165#not-easy-fixable
@project_name_regex ||= /\A[\p{Alnum}\u{00A9}-\u{1f9ff}_][\p{Alnum}\p{Pd}\u{00A9}-\u{1f9ff}_\. ]*\z/.freeze
end
......
......@@ -305,8 +305,8 @@ describe PipelinesEmailService, :mailer do
end
context 'with recipients list separating with newlines' do
let(:recipients) { "\ntest@gitlab.com, \r\nexample@gitlab.com" }
let(:receivers) { %w[test@gitlab.com example@gitlab.com] }
let(:recipients) { "\ntest@gitlab.com, \r\nexample@gitlab.com\rother@gitlab.com" }
let(:receivers) { %w[test@gitlab.com example@gitlab.com other@gitlab.com] }
context 'with failed pipeline' do
before do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment