Commit 22212e9c authored by Michael Kozono's avatar Michael Kozono

Merge branch 'composer-pull-package-event' into 'master'

Add composer pull_package event

See merge request gitlab-org/gitlab!58701
parents e751e767 a9b74d54
...@@ -161,6 +161,8 @@ module API ...@@ -161,6 +161,8 @@ module API
not_found! unless metadata not_found! unless metadata
track_package_event('pull_package', :composer)
send_git_archive unauthorized_user_project.repository, ref: metadata.target_sha, format: 'zip', append_sha: true send_git_archive unauthorized_user_project.repository, ref: metadata.target_sha, format: 'zip', append_sha: true
end end
end end
......
...@@ -434,6 +434,7 @@ RSpec.describe API::ComposerPackages do ...@@ -434,6 +434,7 @@ RSpec.describe API::ComposerPackages do
end end
it_behaves_like 'process Composer api request', params[:user_role], params[:expected_status], params[:member] it_behaves_like 'process Composer api request', params[:user_role], params[:expected_status], params[:member]
it_behaves_like 'a package tracking event', described_class.name, 'pull_package'
end end
end end
end end
......
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