Skip to content
代码片段 群组 项目
未验证 提交 8cccb412 编辑于 作者: Hordur Freyr Yngvason's avatar Hordur Freyr Yngvason 提交者: GitLab
浏览文件

Merge branch 'delete-ff-usage_data_api' into 'master'

No related branches found
No related tags found
无相关合并请求
---
name: usage_data_api
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/41301
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/267114
milestone: '13.4'
type: ops
group: group::analytics instrumentation
default_enabled: true
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
context 'with authentication' do context 'with authentication' do
before do before do
stub_feature_flags(usage_data_api: true)
stub_application_setting(usage_ping_enabled: true) stub_application_setting(usage_ping_enabled: true)
allow(Gitlab::RequestForgeryProtection).to receive(:verified?).and_return(true) allow(Gitlab::RequestForgeryProtection).to receive(:verified?).and_return(true)
end end
...@@ -25,7 +24,6 @@ ...@@ -25,7 +24,6 @@
before do before do
stub_application_setting(usage_ping_enabled: true) stub_application_setting(usage_ping_enabled: true)
stub_feature_flags(usage_data_api: true)
allow(Gitlab::RequestForgeryProtection).to receive(:verified?).and_return(true) allow(Gitlab::RequestForgeryProtection).to receive(:verified?).and_return(true)
end end
......
...@@ -10,7 +10,6 @@ class UsageData < ::API::Base ...@@ -10,7 +10,6 @@ class UsageData < ::API::Base
namespace 'usage_data' do namespace 'usage_data' do
before do before do
not_found! unless Feature.enabled?(:usage_data_api, type: :ops)
forbidden!('Invalid CSRF token is provided') unless verified_request? forbidden!('Invalid CSRF token is provided') unless verified_request?
end end
......
...@@ -72,7 +72,6 @@ def add_gon_variables ...@@ -72,7 +72,6 @@ def add_gon_variables
# Initialize gon.features with any flags that should be # Initialize gon.features with any flags that should be
# made globally available to the frontend # made globally available to the frontend
push_frontend_feature_flag(:usage_data_api, type: :ops)
push_frontend_feature_flag(:security_auto_fix) push_frontend_feature_flag(:security_auto_fix)
push_frontend_feature_flag(:source_editor_toolbar) push_frontend_feature_flag(:source_editor_toolbar)
push_frontend_feature_flag(:vscode_web_ide, current_user) push_frontend_feature_flag(:vscode_web_ide, current_user)
......
...@@ -8,18 +8,6 @@ ...@@ -8,18 +8,6 @@
describe 'GET /usage_data/service_ping' do describe 'GET /usage_data/service_ping' do
let(:endpoint) { '/usage_data/service_ping' } let(:endpoint) { '/usage_data/service_ping' }
context 'when feature flag is disabled' do
before do
stub_feature_flags(usage_data_api: false)
end
it 'returns not_found' do
get api(endpoint)
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'without authentication' do context 'without authentication' do
it 'returns 401 response' do it 'returns 401 response' do
get api(endpoint) get api(endpoint)
...@@ -77,7 +65,6 @@ ...@@ -77,7 +65,6 @@
context 'without CSRF token' do context 'without CSRF token' do
it 'returns forbidden' do it 'returns forbidden' do
stub_feature_flags(usage_data_api: true)
allow(Gitlab::RequestForgeryProtection).to receive(:verified?).and_return(false) allow(Gitlab::RequestForgeryProtection).to receive(:verified?).and_return(false)
post api(endpoint, user), params: { event: known_event } post api(endpoint, user), params: { event: known_event }
...@@ -86,16 +73,6 @@ ...@@ -86,16 +73,6 @@
end end
end end
context 'usage_data_api feature not enabled' do
it 'returns not_found' do
stub_feature_flags(usage_data_api: false)
post api(endpoint, user), params: { event: known_event }
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'without authentication' do context 'without authentication' do
it 'returns 401 response' do it 'returns 401 response' do
post api(endpoint), params: { event: known_event } post api(endpoint), params: { event: known_event }
...@@ -106,7 +83,6 @@ ...@@ -106,7 +83,6 @@
context 'with authentication' do context 'with authentication' do
before do before do
stub_feature_flags(usage_data_api: true)
stub_application_setting(usage_ping_enabled: true) stub_application_setting(usage_ping_enabled: true)
allow(Gitlab::RequestForgeryProtection).to receive(:verified?).and_return(true) allow(Gitlab::RequestForgeryProtection).to receive(:verified?).and_return(true)
end end
...@@ -122,7 +98,7 @@ ...@@ -122,7 +98,7 @@
context 'with correct params' do context 'with correct params' do
before do before do
stub_application_setting(usage_ping_enabled: true) stub_application_setting(usage_ping_enabled: true)
stub_feature_flags(usage_data_api: true)
allow(Gitlab::RequestForgeryProtection).to receive(:verified?).and_return(true) allow(Gitlab::RequestForgeryProtection).to receive(:verified?).and_return(true)
end end
...@@ -158,7 +134,6 @@ ...@@ -158,7 +134,6 @@
context 'without CSRF token' do context 'without CSRF token' do
it 'returns forbidden' do it 'returns forbidden' do
stub_feature_flags(usage_data_api: true)
allow(Gitlab::RequestForgeryProtection).to receive(:verified?).and_return(false) allow(Gitlab::RequestForgeryProtection).to receive(:verified?).and_return(false)
post api(endpoint, user), params: { event: known_event } post api(endpoint, user), params: { event: known_event }
...@@ -167,16 +142,6 @@ ...@@ -167,16 +142,6 @@
end end
end end
context 'usage_data_api feature not enabled' do
it 'returns not_found' do
stub_feature_flags(usage_data_api: false)
post api(endpoint, user), params: { event: known_event }
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'without authentication' do context 'without authentication' do
it 'returns 401 response' do it 'returns 401 response' do
post api(endpoint), params: { event: known_event } post api(endpoint), params: { event: known_event }
...@@ -187,7 +152,6 @@ ...@@ -187,7 +152,6 @@
context 'with authentication' do context 'with authentication' do
before do before do
stub_feature_flags(usage_data_api: true)
stub_application_setting(usage_ping_enabled: true) stub_application_setting(usage_ping_enabled: true)
allow(Gitlab::RequestForgeryProtection).to receive(:verified?).and_return(true) allow(Gitlab::RequestForgeryProtection).to receive(:verified?).and_return(true)
end end
...@@ -241,16 +205,6 @@ ...@@ -241,16 +205,6 @@
end end
end end
context 'usage_data_api feature not enabled' do
it 'returns not_found' do
stub_feature_flags(usage_data_api: false)
post api(endpoint, user), params: { event: known_event, namespace_id: namespace_id, project_id: project_id }
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'without authentication' do context 'without authentication' do
it 'returns 401 response' do it 'returns 401 response' do
post api(endpoint), params: { event: known_event, namespace_id: namespace_id, project_id: project_id } post api(endpoint), params: { event: known_event, namespace_id: namespace_id, project_id: project_id }
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册