Commit 3f4e4be8 authored by Igor Drozdov's avatar Igor Drozdov

Merge branch '217392-code-intelligence-references-ff' into 'master'

Add code_navigation_references feature flag

See merge request gitlab-org/gitlab!35626
parents 877f5d1a 827d7495
...@@ -22,7 +22,11 @@ module Ci ...@@ -22,7 +22,11 @@ module Ci
return result unless result[:status] == :success return result unless result[:status] == :success
headers = JobArtifactUploader.workhorse_authorize(has_length: false, maximum_size: max_size(artifact_type)) headers = JobArtifactUploader.workhorse_authorize(has_length: false, maximum_size: max_size(artifact_type))
headers[:ProcessLsif] = true if lsif?(artifact_type)
if lsif?(artifact_type)
headers[:ProcessLsif] = true
headers[:ProcessLsifReferences] = Feature.enabled?(:code_navigation_references, project, default_enabled: false)
end
success(headers: headers) success(headers: headers)
end end
......
...@@ -1823,13 +1823,36 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state do ...@@ -1823,13 +1823,36 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state do
expect(json_response['ProcessLsif']).to be_truthy expect(json_response['ProcessLsif']).to be_truthy
end end
it 'adds ProcessLsifReferences header' do
authorize_artifacts_with_token_in_headers(artifact_type: :lsif)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['ProcessLsifReferences']).to be_truthy
end
context 'code_navigation feature flag is disabled' do context 'code_navigation feature flag is disabled' do
it 'does not add ProcessLsif header' do it 'responds with a forbidden error' do
stub_feature_flags(code_navigation: false) stub_feature_flags(code_navigation: false)
authorize_artifacts_with_token_in_headers(artifact_type: :lsif) authorize_artifacts_with_token_in_headers(artifact_type: :lsif)
aggregate_failures do
expect(response).to have_gitlab_http_status(:forbidden) expect(response).to have_gitlab_http_status(:forbidden)
expect(json_response['ProcessLsif']).to be_falsy
expect(json_response['ProcessLsifReferences']).to be_falsy
end
end
end
context 'code_navigation_references feature flag is disabled' do
it 'sets ProcessLsifReferences header to false' do
stub_feature_flags(code_navigation_references: false)
authorize_artifacts_with_token_in_headers(artifact_type: :lsif)
aggregate_failures do
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['ProcessLsif']).to be_truthy
expect(json_response['ProcessLsifReferences']).to be_falsy
end
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