Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
6be045ed
Commit
6be045ed
authored
Mar 11, 2021
by
Piotr Skorupa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add skip_validation for metric definition lookup
parent
88de9ff0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
lib/generators/gitlab/usage_metric_definition_generator.rb
lib/generators/gitlab/usage_metric_definition_generator.rb
+1
-1
lib/gitlab/usage/metric_definition.rb
lib/gitlab/usage/metric_definition.rb
+3
-2
No files found.
lib/generators/gitlab/usage_metric_definition_generator.rb
View file @
6be045ed
...
@@ -101,7 +101,7 @@ module Gitlab
...
@@ -101,7 +101,7 @@ module Gitlab
end
end
def
metric_definitions
def
metric_definitions
@definitions
||=
Gitlab
::
Usage
::
MetricDefinition
.
definitions
@definitions
||=
Gitlab
::
Usage
::
MetricDefinition
.
definitions
(
skip_validation:
true
)
end
end
def
metric_definition_exists?
def
metric_definition_exists?
...
...
lib/gitlab/usage/metric_definition.rb
View file @
6be045ed
...
@@ -41,7 +41,8 @@ module Gitlab
...
@@ -41,7 +41,8 @@ module Gitlab
@paths
||=
[
Rails
.
root
.
join
(
'config'
,
'metrics'
,
'**'
,
'*.yml'
)]
@paths
||=
[
Rails
.
root
.
join
(
'config'
,
'metrics'
,
'**'
,
'*.yml'
)]
end
end
def
definitions
def
definitions
(
skip_validation:
false
)
@@skip_validation
=
skip_validation
@definitions
||=
load_all!
@definitions
||=
load_all!
end
end
...
@@ -87,7 +88,7 @@ module Gitlab
...
@@ -87,7 +88,7 @@ module Gitlab
end
end
def
skip_validation?
def
skip_validation?
!!
attributes
[
:skip_validation
]
!!
attributes
[
:skip_validation
]
||
@@skip_validation
end
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment