Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/lsif_data.rb')
-rw-r--r--lib/api/lsif_data.rb40
1 files changed, 0 insertions, 40 deletions
diff --git a/lib/api/lsif_data.rb b/lib/api/lsif_data.rb
deleted file mode 100644
index a673ccb4af0..00000000000
--- a/lib/api/lsif_data.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-# frozen_string_literal: true
-
-module API
- class LsifData < Grape::API
- MAX_FILE_SIZE = 10.megabytes
-
- before do
- not_found! if Feature.disabled?(:code_navigation, user_project)
- end
-
- params do
- requires :id, type: String, desc: 'The ID of a project'
- requires :commit_id, type: String, desc: 'The ID of a commit'
- end
- resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
- segment ':id/commits/:commit_id' do
- params do
- requires :paths, type: Array, desc: 'The paths of the files'
- end
- get 'lsif/info' do
- authorize! :download_code, user_project
-
- artifact =
- Ci::JobArtifact
- .with_file_types(['lsif'])
- .for_sha(params[:commit_id], @project.id)
- .last
-
- not_found! unless artifact
- authorize! :read_pipeline, artifact.job.pipeline
- file_too_large! if artifact.file.cached_size > MAX_FILE_SIZE
-
- service = ::Projects::LsifDataService.new(artifact.file, @project, params[:commit_id])
-
- params[:paths].to_h { |path| [path, service.execute(path)] }
- end
- end
- end
- end
-end