Commit 53dde967 authored by Peter Leitzen's avatar Peter Leitzen

Merge branch...

Merge branch '205187-follow-up-from-add-clusters-regex-for-new-banzai-cluster-metric-embed-filter' into 'master'

Follow-up from Clusters Regex MR

See merge request gitlab-org/gitlab!25203
parents 11df36dd 125f9dc7
......@@ -16,7 +16,7 @@ module EE
%r{
/clusters
/(?<cluster_id>\d+)
[/]?
/?
}x
)
end
......
......@@ -8,6 +8,10 @@ module Gitlab
class << self
include Gitlab::Utils::StrongMemoize
QUERY_PATTERN = '(?<query>\?[a-zA-Z0-9%.()+_=-]+(&[a-zA-Z0-9%.()+_=-]+)*)?'
ANCHOR_PATTERN = '(?<anchor>\#[a-z0-9_-]+)?'
OPTIONAL_DASH_PATTERN = '(?:/-)?'
# Matches urls for a metrics dashboard. This could be
# either the /metrics endpoint or the /metrics_dashboard
# endpoint.
......@@ -63,10 +67,10 @@ module Gitlab
(?<url>
#{gitlab_host_pattern}
#{project_path_pattern}
(?:/-)?
#{OPTIONAL_DASH_PATTERN}
#{path_suffix_pattern}
#{query_pattern}
#{anchor_pattern}
#{QUERY_PATTERN}
#{ANCHOR_PATTERN}
)
}x
end
......@@ -78,14 +82,6 @@ module Gitlab
def project_path_pattern
"\/#{Project.reference_pattern}"
end
def query_pattern
'(?<query>\?[a-zA-Z0-9%.()+_=-]+(&[a-zA-Z0-9%.()+_=-]+)*)?'
end
def anchor_pattern
'(?<anchor>\#[a-z0-9_-]+)?'
end
end
end
end
......
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