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 ...@@ -16,7 +16,7 @@ module EE
%r{ %r{
/clusters /clusters
/(?<cluster_id>\d+) /(?<cluster_id>\d+)
[/]? /?
}x }x
) )
end end
......
...@@ -8,6 +8,10 @@ module Gitlab ...@@ -8,6 +8,10 @@ module Gitlab
class << self class << self
include Gitlab::Utils::StrongMemoize 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 # Matches urls for a metrics dashboard. This could be
# either the /metrics endpoint or the /metrics_dashboard # either the /metrics endpoint or the /metrics_dashboard
# endpoint. # endpoint.
...@@ -63,10 +67,10 @@ module Gitlab ...@@ -63,10 +67,10 @@ module Gitlab
(?<url> (?<url>
#{gitlab_host_pattern} #{gitlab_host_pattern}
#{project_path_pattern} #{project_path_pattern}
(?:/-)? #{OPTIONAL_DASH_PATTERN}
#{path_suffix_pattern} #{path_suffix_pattern}
#{query_pattern} #{QUERY_PATTERN}
#{anchor_pattern} #{ANCHOR_PATTERN}
) )
}x }x
end end
...@@ -78,14 +82,6 @@ module Gitlab ...@@ -78,14 +82,6 @@ module Gitlab
def project_path_pattern def project_path_pattern
"\/#{Project.reference_pattern}" "\/#{Project.reference_pattern}"
end 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 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