Commit fbf5a17b authored by Terri Chu's avatar Terri Chu

Merge branch 'dz-et-collector-change-status-code' into 'master'

Change error tracking collector status code

See merge request gitlab-org/gitlab!72807
parents b1aef29e 5a908ac3
...@@ -96,7 +96,10 @@ module API ...@@ -96,7 +96,10 @@ module API
# Collector should never return any information back. # Collector should never return any information back.
# Because DSN and public key are designed for public use, # Because DSN and public key are designed for public use,
# it is safe only for submission of new events. # it is safe only for submission of new events.
no_content! #
# Some clients sdk require status 200 OK to work correctly.
# See https://gitlab.com/gitlab-org/gitlab/-/issues/343531.
status 200
end end
desc 'Submit error tracking event to the project' do desc 'Submit error tracking event to the project' do
...@@ -129,7 +132,10 @@ module API ...@@ -129,7 +132,10 @@ module API
# Collector should never return any information back. # Collector should never return any information back.
# Because DSN and public key are designed for public use, # Because DSN and public key are designed for public use,
# it is safe only for submission of new events. # it is safe only for submission of new events.
no_content! #
# Some clients sdk require status 200 OK to work correctly.
# See https://gitlab.com/gitlab-org/gitlab/-/issues/343531.
status 200
end end
end end
end end
...@@ -24,10 +24,10 @@ RSpec.describe API::ErrorTracking::Collector do ...@@ -24,10 +24,10 @@ RSpec.describe API::ErrorTracking::Collector do
end end
RSpec.shared_examples 'successful request' do RSpec.shared_examples 'successful request' do
it 'writes to the database and returns no content' do it 'writes to the database and returns OK' do
expect { subject }.to change { ErrorTracking::ErrorEvent.count }.by(1) expect { subject }.to change { ErrorTracking::ErrorEvent.count }.by(1)
expect(response).to have_gitlab_http_status(:no_content) expect(response).to have_gitlab_http_status(:ok)
end end
end end
...@@ -89,10 +89,10 @@ RSpec.describe API::ErrorTracking::Collector do ...@@ -89,10 +89,10 @@ RSpec.describe API::ErrorTracking::Collector do
context 'transaction request type' do context 'transaction request type' do
let(:params) { fixture_file('error_tracking/transaction.txt') } let(:params) { fixture_file('error_tracking/transaction.txt') }
it 'does nothing and returns no content' do it 'does nothing and returns ok' do
expect { subject }.not_to change { ErrorTracking::ErrorEvent.count } expect { subject }.not_to change { ErrorTracking::ErrorEvent.count }
expect(response).to have_gitlab_http_status(:no_content) expect(response).to have_gitlab_http_status(:ok)
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