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
69bd9501
Commit
69bd9501
authored
Oct 28, 2019
by
allison.browne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change query and add more test examples
parent
d366c192
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
app/models/issue.rb
app/models/issue.rb
+0
-1
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+1
-1
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+8
-3
No files found.
app/models/issue.rb
View file @
69bd9501
...
...
@@ -65,7 +65,6 @@ class Issue < ApplicationRecord
scope
:public_only
,
->
{
where
(
confidential:
false
)
}
scope
:confidential_only
,
->
{
where
(
confidential:
true
)
}
scope
:with_zoom_meetings
,
->
{
joins
(
:zoom_meetings
).
select
(
:issues
).
distinct
}
after_commit
:expire_etag_cache
after_save
:ensure_metrics
,
unless: :imported?
...
...
lib/gitlab/usage_data.rb
View file @
69bd9501
...
...
@@ -79,7 +79,7 @@ module Gitlab
groups:
count
(
Group
),
issues:
count
(
Issue
),
issues_with_associated_zoom_link:
count
(
ZoomMeeting
.
added_to_issue
),
issues_using_zoom_quick_actions:
count
(
Issue
.
with_zoom_meetings
),
issues_using_zoom_quick_actions:
count
(
ZoomMeeting
.
select
(
:issue_id
).
distinct
),
keys:
count
(
Key
),
label_lists:
count
(
List
.
label
),
lfs_objects:
count
(
LfsObject
),
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
69bd9501
...
...
@@ -21,9 +21,14 @@ describe Gitlab::UsageData do
create
(
:project_error_tracking_setting
,
project:
projects
[
1
],
enabled:
false
)
create
(
:issue
,
project:
projects
[
0
])
create
(
:issue
,
project:
projects
[
0
])
create
(
:zoom_meeting
,
project:
projects
[
0
],
issue:
projects
[
0
].
issues
[
0
])
create
(
:issue
,
project:
projects
[
0
])
create
(
:issue
,
project:
projects
[
0
])
create
(
:zoom_meeting
,
project:
projects
[
0
],
issue:
projects
[
0
].
issues
[
0
],
issue_status: :added
)
create
(
:zoom_meeting
,
project:
projects
[
0
],
issue:
projects
[
0
].
issues
[
1
],
issue_status: :removed
)
create
(
:zoom_meeting
,
project:
projects
[
0
],
issue:
projects
[
0
].
issues
[
1
],
issue_status: :removed
)
create
(
:zoom_meeting
,
project:
projects
[
0
],
issue:
projects
[
0
].
issues
[
2
],
issue_status: :added
)
create
(
:zoom_meeting
,
project:
projects
[
0
],
issue:
projects
[
0
].
issues
[
2
],
issue_status: :removed
)
create
(
:zoom_meeting
,
project:
projects
[
0
],
issue:
projects
[
0
].
issues
[
2
],
issue_status: :removed
)
gcp_cluster
=
create
(
:cluster
,
:provided_by_gcp
)
create
(
:cluster
,
:provided_by_user
)
create
(
:cluster
,
:provided_by_user
,
:disabled
)
...
...
@@ -182,8 +187,8 @@ describe Gitlab::UsageData do
expect
(
count_data
[
:projects_slack_slash_active
]).
to
eq
(
1
)
expect
(
count_data
[
:projects_with_repositories_enabled
]).
to
eq
(
3
)
expect
(
count_data
[
:projects_with_error_tracking_enabled
]).
to
eq
(
1
)
expect
(
count_data
[
:issues_with_associated_zoom_link
]).
to
eq
(
1
)
expect
(
count_data
[
:issues_using_zoom_quick_actions
]).
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
[
:clusters_enabled
]).
to
eq
(
7
)
expect
(
count_data
[
:project_clusters_enabled
]).
to
eq
(
6
)
...
...
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