Commit 2aaa8ba8 authored by Igor Drozdov's avatar Igor Drozdov

Scope code-nav artifact authorization to project

If code_navigation feature is enabled for a project but not globally
we still need to authorize the artifact
parent ee8c4dbc
......@@ -36,7 +36,7 @@ module Ci
def code_navigation_enabled?
strong_memoize(:code_navigation_enabled) do
Feature.enabled?(:code_navigation)
Feature.enabled?(:code_navigation, job.project)
end
end
......
......@@ -15,6 +15,10 @@ describe Gitlab::CodeNavigationPath do
subject { described_class.new(project, commit_sha).full_json_path_for(path) }
before do
stub_feature_flags(code_navigation: project)
end
context 'when a pipeline exist for a sha' do
it 'returns path to a file in the artifact' do
expect(subject).to eq("/#{project.full_path}/-/jobs/#{job.id}/artifacts/raw/lsif/#{path}.json?file_type=lsif")
......
......@@ -1635,6 +1635,10 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
end
context 'authorize uploading of an lsif artifact' do
before do
stub_feature_flags(code_navigation: job.project)
end
it 'adds ProcessLsif header' do
authorize_artifacts_with_token_in_headers(artifact_type: :lsif)
......
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