Commit b9c4272b authored by Sean Carroll's avatar Sean Carroll

Source code endpoint thresholds

parent f2f2dfc6
...@@ -10,6 +10,7 @@ class Projects::BlameController < Projects::ApplicationController ...@@ -10,6 +10,7 @@ class Projects::BlameController < Projects::ApplicationController
before_action :authorize_download_code! before_action :authorize_download_code!
feature_category :source_code_management feature_category :source_code_management
urgency :low, [:show]
def show def show
@blob = @repository.blob_at(@commit.id, @path) @blob = @repository.blob_at(@commit.id, @path)
......
...@@ -40,6 +40,7 @@ class Projects::BlobController < Projects::ApplicationController ...@@ -40,6 +40,7 @@ class Projects::BlobController < Projects::ApplicationController
track_redis_hll_event :create, :update, name: 'g_edit_by_sfe' track_redis_hll_event :create, :update, name: 'g_edit_by_sfe'
feature_category :source_code_management feature_category :source_code_management
urgency :low, [:create, :show, :edit, :update, :diff]
before_action do before_action do
push_frontend_feature_flag(:refactor_blob_viewer, @project, default_enabled: :yaml) push_frontend_feature_flag(:refactor_blob_viewer, @project, default_enabled: :yaml)
......
...@@ -14,6 +14,7 @@ class Projects::BranchesController < Projects::ApplicationController ...@@ -14,6 +14,7 @@ class Projects::BranchesController < Projects::ApplicationController
before_action :limit_diverging_commit_counts!, only: [:diverging_commit_counts] before_action :limit_diverging_commit_counts!, only: [:diverging_commit_counts]
feature_category :source_code_management feature_category :source_code_management
urgency :low, [:index, :diverging_commit_counts, :create, :destroy]
def index def index
respond_to do |format| respond_to do |format|
......
...@@ -24,6 +24,7 @@ class Projects::CommitController < Projects::ApplicationController ...@@ -24,6 +24,7 @@ class Projects::CommitController < Projects::ApplicationController
COMMIT_DIFFS_PER_PAGE = 20 COMMIT_DIFFS_PER_PAGE = 20
feature_category :source_code_management feature_category :source_code_management
urgency :low, [:pipelines, :merge_requests, :show]
def show def show
apply_diff_view_cookie! apply_diff_view_cookie!
......
...@@ -17,6 +17,7 @@ class Projects::CommitsController < Projects::ApplicationController ...@@ -17,6 +17,7 @@ class Projects::CommitsController < Projects::ApplicationController
before_action :set_commits, except: :commits_root before_action :set_commits, except: :commits_root
feature_category :source_code_management feature_category :source_code_management
urgency :low, [:signatures, :show]
def commits_root def commits_root
redirect_to project_commits_path(@project, @project.default_branch) redirect_to project_commits_path(@project, @project.default_branch)
......
...@@ -21,6 +21,7 @@ class Projects::CompareController < Projects::ApplicationController ...@@ -21,6 +21,7 @@ class Projects::CompareController < Projects::ApplicationController
before_action :validate_refs! before_action :validate_refs!
feature_category :source_code_management feature_category :source_code_management
urgency :low, [:show, :create, :signatures]
# Diffs may be pretty chunky, the less is better in this endpoint. # Diffs may be pretty chunky, the less is better in this endpoint.
# Pagination design guides: https://design.gitlab.com/components/pagination/#behavior # Pagination design guides: https://design.gitlab.com/components/pagination/#behavior
......
...@@ -11,6 +11,7 @@ class Projects::FindFileController < Projects::ApplicationController ...@@ -11,6 +11,7 @@ class Projects::FindFileController < Projects::ApplicationController
before_action :authorize_download_code! before_action :authorize_download_code!
feature_category :source_code_management feature_category :source_code_management
urgency :low, [:show, :list]
def show def show
return render_404 unless @repository.commit(@ref) return render_404 unless @repository.commit(@ref)
......
...@@ -15,6 +15,7 @@ class Projects::ForksController < Projects::ApplicationController ...@@ -15,6 +15,7 @@ class Projects::ForksController < Projects::ApplicationController
before_action :authorize_fork_namespace!, only: [:create] before_action :authorize_fork_namespace!, only: [:create]
feature_category :source_code_management feature_category :source_code_management
urgency :low, [:index]
before_action do before_action do
push_frontend_feature_flag(:fork_project_form, @project, default_enabled: :yaml) push_frontend_feature_flag(:fork_project_form, @project, default_enabled: :yaml)
......
...@@ -12,6 +12,7 @@ class Projects::GraphsController < Projects::ApplicationController ...@@ -12,6 +12,7 @@ class Projects::GraphsController < Projects::ApplicationController
track_redis_hll_event :charts, name: 'p_analytics_repo' track_redis_hll_event :charts, name: 'p_analytics_repo'
feature_category :source_code_management feature_category :source_code_management
urgency :low, [:show]
def show def show
respond_to do |format| respond_to do |format|
......
...@@ -11,6 +11,7 @@ class Projects::NetworkController < Projects::ApplicationController ...@@ -11,6 +11,7 @@ class Projects::NetworkController < Projects::ApplicationController
before_action :assign_commit before_action :assign_commit
feature_category :source_code_management feature_category :source_code_management
urgency :low, [:show]
def show def show
@url = project_network_path(@project, @ref, @options.merge(format: :json)) @url = project_network_path(@project, @ref, @options.merge(format: :json))
......
...@@ -12,6 +12,7 @@ class Projects::RefsController < Projects::ApplicationController ...@@ -12,6 +12,7 @@ class Projects::RefsController < Projects::ApplicationController
before_action :authorize_download_code! before_action :authorize_download_code!
feature_category :source_code_management feature_category :source_code_management
urgency :low, [:switch, :logs_tree]
def switch def switch
respond_to do |format| respond_to do |format|
......
...@@ -12,6 +12,7 @@ module Projects ...@@ -12,6 +12,7 @@ module Projects
feature_category :source_code_management, [:show, :cleanup] feature_category :source_code_management, [:show, :cleanup]
feature_category :continuous_delivery, [:create_deploy_token] feature_category :continuous_delivery, [:create_deploy_token]
urgency :low, [:show]
def show def show
render_show render_show
......
...@@ -11,6 +11,7 @@ class Projects::TagsController < Projects::ApplicationController ...@@ -11,6 +11,7 @@ class Projects::TagsController < Projects::ApplicationController
before_action :authorize_admin_tag!, only: [:new, :create, :destroy] before_action :authorize_admin_tag!, only: [:new, :create, :destroy]
feature_category :source_code_management feature_category :source_code_management
urgency :low, [:new, :show, :index]
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def index def index
......
...@@ -6,6 +6,7 @@ class Projects::TemplatesController < Projects::ApplicationController ...@@ -6,6 +6,7 @@ class Projects::TemplatesController < Projects::ApplicationController
before_action :get_template_class before_action :get_template_class
feature_category :source_code_management feature_category :source_code_management
urgency :low, [:names]
def index def index
templates = @template_type.template_subsets(project) templates = @template_type.template_subsets(project)
......
...@@ -23,6 +23,7 @@ class Projects::TreeController < Projects::ApplicationController ...@@ -23,6 +23,7 @@ class Projects::TreeController < Projects::ApplicationController
end end
feature_category :source_code_management feature_category :source_code_management
urgency :low, [:show]
def show def show
return render_404 unless @commit return render_404 unless @commit
......
...@@ -52,6 +52,7 @@ class ProjectsController < Projects::ApplicationController ...@@ -52,6 +52,7 @@ class ProjectsController < Projects::ApplicationController
feature_category :team_planning, [:preview_markdown, :new_issuable_address] feature_category :team_planning, [:preview_markdown, :new_issuable_address]
feature_category :importers, [:export, :remove_export, :generate_new_export, :download_export] feature_category :importers, [:export, :remove_export, :generate_new_export, :download_export]
feature_category :code_review, [:unfoldered_environment_names] feature_category :code_review, [:unfoldered_environment_names]
urgency :low, [:refs]
def index def index
redirect_to(current_user ? root_path : explore_root_path) redirect_to(current_user ? root_path : explore_root_path)
......
...@@ -13,6 +13,7 @@ module Repositories ...@@ -13,6 +13,7 @@ module Repositories
# added here as a part of the refactor, will be removed # added here as a part of the refactor, will be removed
# https://gitlab.com/gitlab-org/gitlab/-/issues/328692 # https://gitlab.com/gitlab-org/gitlab/-/issues/328692
delegate :deploy_token, :user, to: :authentication_result, allow_nil: true delegate :deploy_token, :user, to: :authentication_result, allow_nil: true
urgency :medium, [:batch]
def batch def batch
unless objects.present? unless objects.present?
......
...@@ -11,6 +11,8 @@ module Repositories ...@@ -11,6 +11,8 @@ module Repositories
# added here as a part of the refactor, will be removed # added here as a part of the refactor, will be removed
# https://gitlab.com/gitlab-org/gitlab/-/issues/328692 # https://gitlab.com/gitlab-org/gitlab/-/issues/328692
delegate :deploy_token, :user, to: :authentication_result, allow_nil: true delegate :deploy_token, :user, to: :authentication_result, allow_nil: true
urgency :medium, [:download, :upload_authorize]
urgency :low, [:upload_finalize]
def download def download
lfs_object = LfsObject.find_by_oid(oid) lfs_object = LfsObject.find_by_oid(oid)
......
...@@ -11,6 +11,7 @@ class Projects::PathLocksController < Projects::ApplicationController ...@@ -11,6 +11,7 @@ class Projects::PathLocksController < Projects::ApplicationController
before_action :check_license before_action :check_license
feature_category :source_code_management feature_category :source_code_management
urgency :low, [:index]
def index def index
@path_locks = @project.path_locks.page(params[:page]) @path_locks = @project.path_locks.page(params[:page])
......
...@@ -21,7 +21,7 @@ module API ...@@ -21,7 +21,7 @@ module API
desc 'Get all merge request approval rules' do desc 'Get all merge request approval rules' do
success EE::API::Entities::MergeRequestApprovalRule success EE::API::Entities::MergeRequestApprovalRule
end end
get do get '/', urgency: :low do
merge_request = find_merge_request_with_access(params[:merge_request_iid]) merge_request = find_merge_request_with_access(params[:merge_request_iid])
present merge_request.approval_rules, with: EE::API::Entities::MergeRequestApprovalRule, current_user: current_user present merge_request.approval_rules, with: EE::API::Entities::MergeRequestApprovalRule, current_user: current_user
......
...@@ -38,7 +38,7 @@ module API ...@@ -38,7 +38,7 @@ module API
detail 'This feature was introduced in 14.3 behind the :group_merge_request_approval_settings_feature_flag' detail 'This feature was introduced in 14.3 behind the :group_merge_request_approval_settings_feature_flag'
success EE::API::Entities::MergeRequestApprovalSettings success EE::API::Entities::MergeRequestApprovalSettings
end end
get do get '/', urgency: :medium do
not_found! unless ::Feature.enabled?(:group_merge_request_approval_settings_feature_flag, user_project.root_ancestor, default_enabled: :yaml) not_found! unless ::Feature.enabled?(:group_merge_request_approval_settings_feature_flag, user_project.root_ancestor, default_enabled: :yaml)
group = user_project.group.present? ? user_project.root_ancestor : nil group = user_project.group.present? ? user_project.root_ancestor : nil
......
...@@ -29,7 +29,7 @@ module API ...@@ -29,7 +29,7 @@ module API
detail 'This feature was introduced in 10.6' detail 'This feature was introduced in 10.6'
success EE::API::Entities::ApprovalSettings success EE::API::Entities::ApprovalSettings
end end
get '/' do get '/', urgency: :low do
present user_project.present(current_user: current_user), with: EE::API::Entities::ApprovalSettings present user_project.present(current_user: current_user), with: EE::API::Entities::ApprovalSettings
end end
......
...@@ -41,7 +41,7 @@ module API ...@@ -41,7 +41,7 @@ module API
optional :page_token, type: String, desc: 'Name of branch to start the paginaition from' optional :page_token, type: String, desc: 'Name of branch to start the paginaition from'
end end
get ':id/repository/branches' do get ':id/repository/branches', urgency: :low do
ff_enabled = Feature.enabled?(:api_caching_rate_limit_branches, user_project, default_enabled: :yaml) ff_enabled = Feature.enabled?(:api_caching_rate_limit_branches, user_project, default_enabled: :yaml)
cache_action_if(ff_enabled, [user_project, :branches, current_user, declared_params], expires_in: 30.seconds) do cache_action_if(ff_enabled, [user_project, :branches, current_user, declared_params], expires_in: 30.seconds) do
...@@ -86,7 +86,7 @@ module API ...@@ -86,7 +86,7 @@ module API
head do head do
user_project.repository.branch_exists?(params[:branch]) ? no_content! : not_found! user_project.repository.branch_exists?(params[:branch]) ? no_content! : not_found!
end end
get do get '/', urgency: :low do
branch = find_branch!(params[:branch]) branch = find_branch!(params[:branch])
present branch, with: Entities::Branch, current_user: current_user, project: user_project present branch, with: Entities::Branch, current_user: current_user, project: user_project
......
...@@ -27,7 +27,7 @@ module API ...@@ -27,7 +27,7 @@ module API
params do params do
requires :id, type: String, desc: 'The ID of a project' requires :id, type: String, desc: 'The ID of a project'
end end
resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS, urgency: :low do
desc 'Get a project repository commits' do desc 'Get a project repository commits' do
success Entities::Commit success Entities::Commit
end end
...@@ -43,7 +43,7 @@ module API ...@@ -43,7 +43,7 @@ module API
optional :trailers, type: Boolean, desc: 'Parse and include Git trailers for every commit', default: false optional :trailers, type: Boolean, desc: 'Parse and include Git trailers for every commit', default: false
use :pagination use :pagination
end end
get ':id/repository/commits' do get ':id/repository/commits', urgency: :low do
path = params[:path] path = params[:path]
before = params[:until] before = params[:until]
after = params[:since] after = params[:since]
...@@ -169,7 +169,7 @@ module API ...@@ -169,7 +169,7 @@ module API
requires :sha, type: String, desc: 'A commit sha, or the name of a branch or tag' requires :sha, type: String, desc: 'A commit sha, or the name of a branch or tag'
use :pagination use :pagination
end end
get ':id/repository/commits/:sha/diff', requirements: API::COMMIT_ENDPOINT_REQUIREMENTS do get ':id/repository/commits/:sha/diff', requirements: API::COMMIT_ENDPOINT_REQUIREMENTS, urgency: :low do
commit = user_project.commit(params[:sha]) commit = user_project.commit(params[:sha])
not_found! 'Commit' unless commit not_found! 'Commit' unless commit
...@@ -295,7 +295,7 @@ module API ...@@ -295,7 +295,7 @@ module API
optional :type, type: String, values: %w[branch tag all], default: 'all', desc: 'Scope' optional :type, type: String, values: %w[branch tag all], default: 'all', desc: 'Scope'
use :pagination use :pagination
end end
get ':id/repository/commits/:sha/refs', requirements: API::COMMIT_ENDPOINT_REQUIREMENTS do get ':id/repository/commits/:sha/refs', requirements: API::COMMIT_ENDPOINT_REQUIREMENTS, urgency: :low do
commit = user_project.commit(params[:sha]) commit = user_project.commit(params[:sha])
not_found!('Commit') unless commit not_found!('Commit') unless commit
...@@ -363,7 +363,7 @@ module API ...@@ -363,7 +363,7 @@ module API
requires :sha, type: String, desc: 'A commit sha, or the name of a branch or tag on which to find Merge Requests' requires :sha, type: String, desc: 'A commit sha, or the name of a branch or tag on which to find Merge Requests'
use :pagination use :pagination
end end
get ':id/repository/commits/:sha/merge_requests', requirements: API::COMMIT_ENDPOINT_REQUIREMENTS do get ':id/repository/commits/:sha/merge_requests', requirements: API::COMMIT_ENDPOINT_REQUIREMENTS, urgency: :low do
authorize! :read_merge_request, user_project authorize! :read_merge_request, user_project
commit = user_project.commit(params[:sha]) commit = user_project.commit(params[:sha])
......
...@@ -122,7 +122,7 @@ module API ...@@ -122,7 +122,7 @@ module API
requires :file_path, type: String, file_path: true, desc: 'The url encoded path to the file. Ex. lib%2Fclass%2Erb' requires :file_path, type: String, file_path: true, desc: 'The url encoded path to the file. Ex. lib%2Fclass%2Erb'
optional :ref, type: String, desc: 'The name of branch, tag or commit', allow_blank: false optional :ref, type: String, desc: 'The name of branch, tag or commit', allow_blank: false
end end
head ":id/repository/files/:file_path/raw", requirements: FILE_ENDPOINT_REQUIREMENTS do head ":id/repository/files/:file_path/raw", requirements: FILE_ENDPOINT_REQUIREMENTS, urgency: :low do
assign_file_vars! assign_file_vars!
set_http_headers(blob_data) set_http_headers(blob_data)
...@@ -133,7 +133,7 @@ module API ...@@ -133,7 +133,7 @@ module API
requires :file_path, type: String, file_path: true, desc: 'The url encoded path to the file. Ex. lib%2Fclass%2Erb' requires :file_path, type: String, file_path: true, desc: 'The url encoded path to the file. Ex. lib%2Fclass%2Erb'
optional :ref, type: String, desc: 'The name of branch, tag or commit', allow_blank: false optional :ref, type: String, desc: 'The name of branch, tag or commit', allow_blank: false
end end
get ":id/repository/files/:file_path/raw", requirements: FILE_ENDPOINT_REQUIREMENTS do get ":id/repository/files/:file_path/raw", requirements: FILE_ENDPOINT_REQUIREMENTS, urgency: :low do
assign_file_vars! assign_file_vars!
no_cache_headers no_cache_headers
...@@ -147,7 +147,7 @@ module API ...@@ -147,7 +147,7 @@ module API
requires :file_path, type: String, file_path: true, desc: 'The url encoded path to the file. Ex. lib%2Fclass%2Erb' requires :file_path, type: String, file_path: true, desc: 'The url encoded path to the file. Ex. lib%2Fclass%2Erb'
requires :ref, type: String, desc: 'The name of branch, tag or commit', allow_blank: false requires :ref, type: String, desc: 'The name of branch, tag or commit', allow_blank: false
end end
head ":id/repository/files/:file_path", requirements: FILE_ENDPOINT_REQUIREMENTS do head ":id/repository/files/:file_path", requirements: FILE_ENDPOINT_REQUIREMENTS, urgency: :low do
assign_file_vars! assign_file_vars!
set_http_headers(blob_data) set_http_headers(blob_data)
...@@ -174,7 +174,7 @@ module API ...@@ -174,7 +174,7 @@ module API
params do params do
use :extended_file_params use :extended_file_params
end end
post ":id/repository/files/:file_path", requirements: FILE_ENDPOINT_REQUIREMENTS do post ":id/repository/files/:file_path", requirements: FILE_ENDPOINT_REQUIREMENTS, urgency: :low do
authorize! :push_code, user_project authorize! :push_code, user_project
file_params = declared_params(include_missing: false) file_params = declared_params(include_missing: false)
...@@ -192,7 +192,7 @@ module API ...@@ -192,7 +192,7 @@ module API
params do params do
use :extended_file_params use :extended_file_params
end end
put ":id/repository/files/:file_path", requirements: FILE_ENDPOINT_REQUIREMENTS do put ":id/repository/files/:file_path", requirements: FILE_ENDPOINT_REQUIREMENTS, urgency: :low do
authorize! :push_code, user_project authorize! :push_code, user_project
file_params = declared_params(include_missing: false) file_params = declared_params(include_missing: false)
......
...@@ -145,7 +145,7 @@ module API ...@@ -145,7 +145,7 @@ module API
check_allowed(params) check_allowed(params)
end end
post "/lfs_authenticate", feature_category: :source_code_management do post "/lfs_authenticate", feature_category: :source_code_management, urgency: :high do
not_found! unless container&.lfs_enabled? not_found! unless container&.lfs_enabled?
status 200 status 200
......
...@@ -24,7 +24,7 @@ module API ...@@ -24,7 +24,7 @@ module API
requires :oid, type: String, desc: 'The object ID to query' requires :oid, type: String, desc: 'The object ID to query'
requires :gl_repository, type: String, desc: "Project identifier (e.g. project-1)" requires :gl_repository, type: String, desc: "Project identifier (e.g. project-1)"
end end
get "/" do get "/", urgency: :high do
lfs_object = find_lfs_object(params[:oid]) lfs_object = find_lfs_object(params[:oid])
not_found! unless lfs_object not_found! unless lfs_object
......
...@@ -25,7 +25,7 @@ module API ...@@ -25,7 +25,7 @@ module API
# Examples: # Examples:
# GET /projects/:id/merge_requests/:merge_request_iid/approvals # GET /projects/:id/merge_requests/:merge_request_iid/approvals
desc 'List approvals for merge request' desc 'List approvals for merge request'
get 'approvals' do get 'approvals', urgency: :low do
not_found!("Merge Request") unless can?(current_user, :read_merge_request, user_project) not_found!("Merge Request") unless can?(current_user, :read_merge_request, user_project)
merge_request = find_merge_request_with_access(params[:merge_request_iid]) merge_request = find_merge_request_with_access(params[:merge_request_iid])
...@@ -47,7 +47,7 @@ module API ...@@ -47,7 +47,7 @@ module API
use :ee_approval_params use :ee_approval_params
end end
post 'approve' do post 'approve', urgency: :low do
merge_request = find_merge_request_with_access(params[:merge_request_iid], :approve_merge_request) merge_request = find_merge_request_with_access(params[:merge_request_iid], :approve_merge_request)
check_sha_param!(params, merge_request) check_sha_param!(params, merge_request)
...@@ -63,7 +63,7 @@ module API ...@@ -63,7 +63,7 @@ module API
end end
desc 'Remove an approval from a merge request' desc 'Remove an approval from a merge request'
post 'unapprove' do post 'unapprove', urgency: :low do
merge_request = find_merge_request_with_access(params[:merge_request_iid], :approve_merge_request) merge_request = find_merge_request_with_access(params[:merge_request_iid], :approve_merge_request)
success = ::MergeRequests::RemoveApprovalService success = ::MergeRequests::RemoveApprovalService
......
...@@ -404,7 +404,7 @@ module API ...@@ -404,7 +404,7 @@ module API
use :collection_params use :collection_params
use :with_custom_attributes use :with_custom_attributes
end end
get ':id/forks', feature_category: :source_code_management do get ':id/forks', feature_category: :source_code_management, urgency: :low do
forks = ForkProjectsFinder.new(user_project, params: project_finder_params, current_user: current_user).execute forks = ForkProjectsFinder.new(user_project, params: project_finder_params, current_user: current_user).execute
present_projects forks, request_scope: user_project present_projects forks, request_scope: user_project
...@@ -514,7 +514,7 @@ module API ...@@ -514,7 +514,7 @@ module API
end end
desc 'Get languages in project repository' desc 'Get languages in project repository'
get ':id/languages', feature_category: :source_code_management do get ':id/languages', feature_category: :source_code_management, urgency: :medium do
::Projects::RepositoryLanguagesService ::Projects::RepositoryLanguagesService
.new(user_project, current_user) .new(user_project, current_user)
.execute.to_h { |lang| [lang.name, lang.share] } .execute.to_h { |lang| [lang.name, lang.share] }
......
...@@ -91,7 +91,7 @@ module API ...@@ -91,7 +91,7 @@ module API
requires :name, type: String, desc: 'The name of the protected branch' requires :name, type: String, desc: 'The name of the protected branch'
end end
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
delete ':id/protected_branches/:name', requirements: BRANCH_ENDPOINT_REQUIREMENTS do delete ':id/protected_branches/:name', requirements: BRANCH_ENDPOINT_REQUIREMENTS, urgency: :low do
protected_branch = user_project.protected_branches.find_by!(name: params[:name]) protected_branch = user_project.protected_branches.find_by!(name: params[:name])
destroy_conditionally!(protected_branch) do destroy_conditionally!(protected_branch) do
......
...@@ -79,7 +79,7 @@ module API ...@@ -79,7 +79,7 @@ module API
optional :page_token, type: String, desc: 'Record from which to start the keyset pagination' optional :page_token, type: String, desc: 'Record from which to start the keyset pagination'
end end
end end
get ':id/repository/tree' do get ':id/repository/tree', urgency: :low do
tree_finder = ::Repositories::TreeFinder.new(user_project, declared_params(include_missing: false)) tree_finder = ::Repositories::TreeFinder.new(user_project, declared_params(include_missing: false))
not_found!("Tree") unless tree_finder.commit_exists? not_found!("Tree") unless tree_finder.commit_exists?
...@@ -144,7 +144,7 @@ module API ...@@ -144,7 +144,7 @@ module API
optional :from_project_id, type: String, desc: 'The project to compare from' optional :from_project_id, type: String, desc: 'The project to compare from'
optional :straight, type: Boolean, desc: 'Comparison method, `true` for direct comparison between `from` and `to` (`from`..`to`), `false` to compare using merge base (`from`...`to`)', default: false optional :straight, type: Boolean, desc: 'Comparison method, `true` for direct comparison between `from` and `to` (`from`..`to`), `false` to compare using merge base (`from`...`to`)', default: false
end end
get ':id/repository/compare' do get ':id/repository/compare', urgency: :low do
ff_enabled = Feature.enabled?(:api_caching_rate_limit_repository_compare, user_project, default_enabled: :yaml) ff_enabled = Feature.enabled?(:api_caching_rate_limit_repository_compare, user_project, default_enabled: :yaml)
target_project = fetch_target_project(current_user, user_project, params) target_project = fetch_target_project(current_user, user_project, params)
......
...@@ -23,7 +23,7 @@ module API ...@@ -23,7 +23,7 @@ module API
optional :search, type: String, desc: 'Return list of tags matching the search criteria' optional :search, type: String, desc: 'Return list of tags matching the search criteria'
use :pagination use :pagination
end end
get ':id/repository/tags', feature_category: :source_code_management do get ':id/repository/tags', feature_category: :source_code_management, urgency: :low do
tags = ::TagsFinder.new(user_project.repository, tags = ::TagsFinder.new(user_project.repository,
sort: "#{params[:order_by]}_#{params[:sort]}", sort: "#{params[:order_by]}_#{params[:sort]}",
search: params[:search]).execute search: params[:search]).execute
......
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