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
4ffe3ee7
Commit
4ffe3ee7
authored
Apr 01, 2020
by
Tim Rizzi
Committed by
Dylan Griffith
Apr 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tracking for additional NuGet events
parent
5ff4d045
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
ee/lib/api/nuget_packages.rb
ee/lib/api/nuget_packages.rb
+6
-0
ee/spec/support/shared_examples/requests/api/nuget_packages_shared_examples.rb
...d_examples/requests/api/nuget_packages_shared_examples.rb
+6
-0
No files found.
ee/lib/api/nuget_packages.rb
View file @
4ffe3ee7
...
@@ -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
...
...
ee/spec/support/shared_examples/requests/api/nuget_packages_shared_examples.rb
View file @
4ffe3ee7
...
@@ -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
}
...
...
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