Commit 7a0051b5 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'id-scope-code-nav-to-project' into 'master'

Scope code-nav artifact authorization to project

See merge request gitlab-org/gitlab!32981
parents 12eb6a8f 2aaa8ba8
......@@ -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")
......
......@@ -1694,6 +1694,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