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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
0b6d01ed
Commit
0b6d01ed
authored
Nov 22, 2017
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Just define allowed_ids and override it with empty value
if not needed for those sub-classes.
parent
45568bed
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
10 additions
and
16 deletions
+10
-16
lib/gitlab/cycle_analytics/base_event_fetcher.rb
lib/gitlab/cycle_analytics/base_event_fetcher.rb
+0
-4
lib/gitlab/cycle_analytics/code_event_fetcher.rb
lib/gitlab/cycle_analytics/code_event_fetcher.rb
+0
-4
lib/gitlab/cycle_analytics/issue_event_fetcher.rb
lib/gitlab/cycle_analytics/issue_event_fetcher.rb
+0
-4
lib/gitlab/cycle_analytics/plan_event_fetcher.rb
lib/gitlab/cycle_analytics/plan_event_fetcher.rb
+4
-0
lib/gitlab/cycle_analytics/review_event_fetcher.rb
lib/gitlab/cycle_analytics/review_event_fetcher.rb
+0
-4
lib/gitlab/cycle_analytics/staging_event_fetcher.rb
lib/gitlab/cycle_analytics/staging_event_fetcher.rb
+4
-0
spec/lib/gitlab/cycle_analytics/base_event_fetcher_spec.rb
spec/lib/gitlab/cycle_analytics/base_event_fetcher_spec.rb
+2
-0
No files found.
lib/gitlab/cycle_analytics/base_event_fetcher.rb
View file @
0b6d01ed
...
@@ -56,10 +56,6 @@ module Gitlab
...
@@ -56,10 +56,6 @@ module Gitlab
end
end
def
allowed_ids
def
allowed_ids
nil
end
def
load_allowed_ids
allowed_ids_finder_class
allowed_ids_finder_class
.
new
(
@options
[
:current_user
],
project_id:
@project
.
id
)
.
new
(
@options
[
:current_user
],
project_id:
@project
.
id
)
.
execute
.
where
(
id:
event_result_ids
).
pluck
(
:id
)
.
execute
.
where
(
id:
event_result_ids
).
pluck
(
:id
)
...
...
lib/gitlab/cycle_analytics/code_event_fetcher.rb
View file @
0b6d01ed
...
@@ -19,10 +19,6 @@ module Gitlab
...
@@ -19,10 +19,6 @@ module Gitlab
AnalyticsMergeRequestSerializer
.
new
(
project:
@project
).
represent
(
event
)
AnalyticsMergeRequestSerializer
.
new
(
project:
@project
).
represent
(
event
)
end
end
def
allowed_ids
load_allowed_ids
end
def
allowed_ids_finder_class
def
allowed_ids_finder_class
MergeRequestsFinder
MergeRequestsFinder
end
end
...
...
lib/gitlab/cycle_analytics/issue_event_fetcher.rb
View file @
0b6d01ed
...
@@ -17,10 +17,6 @@ module Gitlab
...
@@ -17,10 +17,6 @@ module Gitlab
AnalyticsIssueSerializer
.
new
(
project:
@project
).
represent
(
event
)
AnalyticsIssueSerializer
.
new
(
project:
@project
).
represent
(
event
)
end
end
def
allowed_ids
load_allowed_ids
end
def
allowed_ids_finder_class
def
allowed_ids_finder_class
IssuesFinder
IssuesFinder
end
end
...
...
lib/gitlab/cycle_analytics/plan_event_fetcher.rb
View file @
0b6d01ed
...
@@ -19,6 +19,10 @@ module Gitlab
...
@@ -19,6 +19,10 @@ module Gitlab
private
private
def
allowed_ids
nil
end
def
merge_request_diff_commits
def
merge_request_diff_commits
@merge_request_diff_commits
||=
@merge_request_diff_commits
||=
MergeRequestDiffCommit
MergeRequestDiffCommit
...
...
lib/gitlab/cycle_analytics/review_event_fetcher.rb
View file @
0b6d01ed
...
@@ -18,10 +18,6 @@ module Gitlab
...
@@ -18,10 +18,6 @@ module Gitlab
AnalyticsMergeRequestSerializer
.
new
(
project:
@project
).
represent
(
event
)
AnalyticsMergeRequestSerializer
.
new
(
project:
@project
).
represent
(
event
)
end
end
def
allowed_ids
load_allowed_ids
end
def
allowed_ids_finder_class
def
allowed_ids_finder_class
MergeRequestsFinder
MergeRequestsFinder
end
end
...
...
lib/gitlab/cycle_analytics/staging_event_fetcher.rb
View file @
0b6d01ed
...
@@ -22,6 +22,10 @@ module Gitlab
...
@@ -22,6 +22,10 @@ module Gitlab
private
private
def
allowed_ids
nil
end
def
serialize
(
event
)
def
serialize
(
event
)
AnalyticsBuildSerializer
.
new
.
represent
(
event
[
'build'
])
AnalyticsBuildSerializer
.
new
.
represent
(
event
[
'build'
])
end
end
...
...
spec/lib/gitlab/cycle_analytics/base_event_fetcher_spec.rb
View file @
0b6d01ed
...
@@ -23,6 +23,8 @@ describe Gitlab::CycleAnalytics::BaseEventFetcher do
...
@@ -23,6 +23,8 @@ describe Gitlab::CycleAnalytics::BaseEventFetcher do
allow_any_instance_of
(
described_class
).
to
receive
(
:serialize
)
do
|
event
|
allow_any_instance_of
(
described_class
).
to
receive
(
:serialize
)
do
|
event
|
event
event
end
end
allow_any_instance_of
(
described_class
)
.
to
receive
(
:allowed_ids
).
and_return
(
nil
)
stub_const
(
'Gitlab::CycleAnalytics::BaseEventFetcher::MAX_EVENTS'
,
max_events
)
stub_const
(
'Gitlab::CycleAnalytics::BaseEventFetcher::MAX_EVENTS'
,
max_events
)
...
...
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