Commit 4ffe3ee7 authored by Tim Rizzi's avatar Tim Rizzi Committed by Dylan Griffith

Add tracking for additional NuGet events

parent 5ff4d045
...@@ -102,6 +102,8 @@ module API ...@@ -102,6 +102,8 @@ module API
get 'index', format: :json do get 'index', format: :json do
authorize_read_package!(authorized_user_project) authorize_read_package!(authorized_user_project)
track_event('nuget_service_index')
present ::Packages::Nuget::ServiceIndexPresenter.new(authorized_user_project), present ::Packages::Nuget::ServiceIndexPresenter.new(authorized_user_project),
with: EE::API::Entities::Nuget::ServiceIndex with: EE::API::Entities::Nuget::ServiceIndex
end end
...@@ -201,6 +203,8 @@ module API ...@@ -201,6 +203,8 @@ module API
not_found!('Package') unless package_file not_found!('Package') unless package_file
track_event('pull_package')
# nuget and dotnet don't support 302 Moved status codes, supports_direct_download has to be set to false # nuget and dotnet don't support 302 Moved status codes, supports_direct_download has to be set to false
present_carrierwave_file!(package_file.file, supports_direct_download: false) present_carrierwave_file!(package_file.file, supports_direct_download: false)
end end
...@@ -231,6 +235,8 @@ module API ...@@ -231,6 +235,8 @@ module API
.new(authorized_user_project, params[:q], search_options) .new(authorized_user_project, params[:q], search_options)
.execute .execute
track_event('search_package')
present ::Packages::Nuget::SearchResultsPresenter.new(search), present ::Packages::Nuget::SearchResultsPresenter.new(search),
with: EE::API::Entities::Nuget::SearchResults with: EE::API::Entities::Nuget::SearchResults
end end
......
...@@ -36,6 +36,8 @@ RSpec.shared_examples 'process nuget service index request' do |user_type, statu ...@@ -36,6 +36,8 @@ RSpec.shared_examples 'process nuget service index request' do |user_type, statu
it_behaves_like 'returning response status', status it_behaves_like 'returning response status', status
it_behaves_like 'a gitlab tracking event', described_class.name, 'nuget_service_index'
it 'returns a valid json response' do it 'returns a valid json response' do
subject subject
...@@ -280,6 +282,8 @@ RSpec.shared_examples 'process nuget download content request' do |user_type, st ...@@ -280,6 +282,8 @@ RSpec.shared_examples 'process nuget download content request' do |user_type, st
it_behaves_like 'returning response status', status it_behaves_like 'returning response status', status
it_behaves_like 'a gitlab tracking event', described_class.name, 'pull_package'
it 'returns a valid package archive' do it 'returns a valid package archive' do
subject subject
...@@ -328,6 +332,8 @@ RSpec.shared_examples 'process nuget search request' do |user_type, status, add_ ...@@ -328,6 +332,8 @@ RSpec.shared_examples 'process nuget search request' do |user_type, status, add_
it_behaves_like 'returns a valid json search response', status, 4, [1, 5, 5, 1] it_behaves_like 'returns a valid json search response', status, 4, [1, 5, 5, 1]
it_behaves_like 'a gitlab tracking event', described_class.name, 'search_package'
context 'with skip set to 2' do context 'with skip set to 2' do
let(:skip) { 2 } let(:skip) { 2 }
......
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