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
ae8dd183
Commit
ae8dd183
authored
Nov 25, 2019
by
allison.browne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up grafana scopes
parent
e9310d3e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
6 deletions
+3
-6
app/models/issue.rb
app/models/issue.rb
+0
-3
app/models/project.rb
app/models/project.rb
+1
-0
lib/banzai/filter/inline_grafana_metrics_filter.rb
lib/banzai/filter/inline_grafana_metrics_filter.rb
+0
-1
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+2
-2
No files found.
app/models/issue.rb
View file @
ae8dd183
...
@@ -62,11 +62,8 @@ class Issue < ApplicationRecord
...
@@ -62,11 +62,8 @@ class Issue < ApplicationRecord
scope
:order_relative_position_asc
,
->
{
reorder
(
::
Gitlab
::
Database
.
nulls_last_order
(
'relative_position'
,
'ASC'
))
}
scope
:order_relative_position_asc
,
->
{
reorder
(
::
Gitlab
::
Database
.
nulls_last_order
(
'relative_position'
,
'ASC'
))
}
scope
:preload_associated_models
,
->
{
preload
(
:labels
,
project: :namespace
)
}
scope
:preload_associated_models
,
->
{
preload
(
:labels
,
project: :namespace
)
}
scope
:with_project_grafana_integration
,
->
{
joins
(
project: :grafana_integration
).
where
(
projects:
{
grafana_integrations:
{
enabled:
true
}
}
)
}
scope
:with_api_entity_associations
,
->
{
preload
(
:timelogs
,
:assignees
,
:author
,
:notes
,
:labels
,
project:
[
:route
,
{
namespace: :route
}]
)
}
scope
:with_api_entity_associations
,
->
{
preload
(
:timelogs
,
:assignees
,
:author
,
:notes
,
:labels
,
project:
[
:route
,
{
namespace: :route
}]
)
}
scope
:grafana_embedded_aprox
,
->
{
where
(
'"issues"."description" ILIKE \'%\' || "grafana_integrations"."grafana_url" || \'%\''
)
}
scope
:public_only
,
->
{
where
(
confidential:
false
)
}
scope
:public_only
,
->
{
where
(
confidential:
false
)
}
scope
:confidential_only
,
->
{
where
(
confidential:
true
)
}
scope
:confidential_only
,
->
{
where
(
confidential:
true
)
}
...
...
app/models/project.rb
View file @
ae8dd183
...
@@ -435,6 +435,7 @@ class Project < ApplicationRecord
...
@@ -435,6 +435,7 @@ class Project < ApplicationRecord
scope
:with_merge_requests_available_for_user
,
->
(
current_user
)
{
with_feature_available_for_user
(
:merge_requests
,
current_user
)
}
scope
:with_merge_requests_available_for_user
,
->
(
current_user
)
{
with_feature_available_for_user
(
:merge_requests
,
current_user
)
}
scope
:with_merge_requests_enabled
,
->
{
with_feature_enabled
(
:merge_requests
)
}
scope
:with_merge_requests_enabled
,
->
{
with_feature_enabled
(
:merge_requests
)
}
scope
:with_remote_mirrors
,
->
{
joins
(
:remote_mirrors
).
where
(
remote_mirrors:
{
enabled:
true
}).
distinct
}
scope
:with_remote_mirrors
,
->
{
joins
(
:remote_mirrors
).
where
(
remote_mirrors:
{
enabled:
true
}).
distinct
}
scope
:with_grafana_integration_enabled
,
->
{
joins
(
:grafana_integration
).
where
(
grafana_integrations:
{
enabled:
true
})
}
scope
:with_group_runners_enabled
,
->
do
scope
:with_group_runners_enabled
,
->
do
joins
(
:ci_cd_settings
)
joins
(
:ci_cd_settings
)
...
...
lib/banzai/filter/inline_grafana_metrics_filter.rb
View file @
ae8dd183
...
@@ -13,7 +13,6 @@ module Banzai
...
@@ -13,7 +13,6 @@ module Banzai
doc
.
document
.
create_element
(
doc
.
document
.
create_element
(
'div'
,
'div'
,
class:
'js-render-metrics'
,
class:
'js-render-metrics'
,
# Grafana usage ping depends on this implementation
'data-dashboard-url'
:
metrics_dashboard_url
(
params
)
'data-dashboard-url'
:
metrics_dashboard_url
(
params
)
)
)
end
end
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
ae8dd183
...
@@ -154,7 +154,7 @@ describe Gitlab::UsageData do
...
@@ -154,7 +154,7 @@ describe Gitlab::UsageData do
issues
issues
issues_with_associated_zoom_link
issues_with_associated_zoom_link
issues_using_zoom_quick_actions
issues_using_zoom_quick_actions
issues_with_embed
ed_grafana_charts_a
prox
issues_with_embed
ded_grafana_charts_ap
prox
keys
keys
label_lists
label_lists
labels
labels
...
@@ -214,7 +214,7 @@ describe Gitlab::UsageData do
...
@@ -214,7 +214,7 @@ describe Gitlab::UsageData do
expect
(
count_data
[
:projects_with_error_tracking_enabled
]).
to
eq
(
1
)
expect
(
count_data
[
:projects_with_error_tracking_enabled
]).
to
eq
(
1
)
expect
(
count_data
[
:issues_with_associated_zoom_link
]).
to
eq
(
2
)
expect
(
count_data
[
:issues_with_associated_zoom_link
]).
to
eq
(
2
)
expect
(
count_data
[
:issues_using_zoom_quick_actions
]).
to
eq
(
3
)
expect
(
count_data
[
:issues_using_zoom_quick_actions
]).
to
eq
(
3
)
expect
(
count_data
[
:issues_with_embed
ed_grafana_charts_a
prox
]).
to
eq
(
2
)
expect
(
count_data
[
:issues_with_embed
ded_grafana_charts_ap
prox
]).
to
eq
(
2
)
expect
(
count_data
[
:clusters_enabled
]).
to
eq
(
4
)
expect
(
count_data
[
:clusters_enabled
]).
to
eq
(
4
)
expect
(
count_data
[
:project_clusters_enabled
]).
to
eq
(
3
)
expect
(
count_data
[
:project_clusters_enabled
]).
to
eq
(
3
)
...
...
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