Commit 86ace8ca authored by Abdul Wadood's avatar Abdul Wadood Committed by Bob Van Landuyt

Assign urgencies to group::workspace owned endpoints

The endpoints with higher number of requests on gitlab.com are assigned
higher urgency and vice-versa.
parent 06db7ddc
......@@ -13,6 +13,7 @@ class AutocompleteController < ApplicationController
feature_category :continuous_delivery, [:deploy_keys_with_owners]
urgency :low, [:merge_request_target_branches]
urgency :default, [:users]
def users
group = Autocomplete::GroupFinder
......
......@@ -25,6 +25,9 @@ class Explore::ProjectsController < Explore::ApplicationController
feature_category :projects
# TODO: Set higher urgency after addressing https://gitlab.com/gitlab-org/gitlab/-/issues/357913
urgency :low, [:index]
def index
show_alert_if_search_is_disabled
@projects = load_projects
......
......@@ -9,6 +9,9 @@ module Groups
feature_category :subgroups
# TODO: Set to higher urgency after resolving https://gitlab.com/gitlab-org/gitlab/-/issues/331494
urgency :low, [:index]
def index
params[:sort] ||= @group_projects_sort
parent = if params[:parent_id].present?
......
......@@ -59,7 +59,8 @@ class GroupsController < Groups::ApplicationController
feature_category :importers, [:export, :download_export]
urgency :high, [:unfoldered_environment_names]
urgency :low, [:merge_requests]
# TODO: Set #show to higher urgency after resolving https://gitlab.com/gitlab-org/gitlab/-/issues/334795
urgency :low, [:merge_requests, :show]
def index
redirect_to(current_user ? dashboard_groups_path : explore_groups_path)
......
......@@ -56,7 +56,8 @@ class ProjectsController < Projects::ApplicationController
feature_category :code_review, [:unfoldered_environment_names]
feature_category :portfolio_management, [:planning_hierarchy]
urgency :low, [:refs]
# TODO: Set high urgency for #show https://gitlab.com/gitlab-org/gitlab/-/issues/334444
urgency :low, [:refs, :show]
urgency :high, [:unfoldered_environment_names]
def index
......
......@@ -33,6 +33,9 @@ class UsersController < ApplicationController
feature_category :snippets, [:snippets]
# TODO: Set higher urgency after resolving https://gitlab.com/gitlab-org/gitlab/-/issues/357914
urgency :low, [:show]
def show
respond_to do |format|
format.html
......
......@@ -249,7 +249,8 @@ module API
use :with_custom_attributes
optional :with_projects, type: Boolean, default: true, desc: 'Omit project details'
end
get ":id", feature_category: :subgroups do
# TODO: Set higher urgency after resolving https://gitlab.com/gitlab-org/gitlab/-/issues/357841
get ":id", feature_category: :subgroups, urgency: :low do
group = find_group!(params[:id])
group.preload_shared_group_links
......@@ -300,7 +301,8 @@ module API
use :with_custom_attributes
use :optional_projects_params
end
get ":id/projects", feature_category: :subgroups do
# TODO: Set higher urgency after resolving https://gitlab.com/gitlab-org/gitlab/-/issues/211498
get ":id/projects", feature_category: :subgroups, urgency: :low do
finder_options = {
only_owned: !params[:with_shared],
include_subgroups: params[:include_subgroups],
......@@ -347,7 +349,7 @@ module API
use :group_list_params
use :with_custom_attributes
end
get ":id/subgroups", feature_category: :subgroups do
get ":id/subgroups", feature_category: :subgroups, urgency: :low do
groups = find_groups(declared_params(include_missing: false), params[:id])
present_groups params, groups
end
......
......@@ -8,6 +8,9 @@ module API
feature_category :users
# TODO: Set higher urgency after resolving https://gitlab.com/gitlab-org/gitlab/-/issues/357839
urgency :low
params do
requires :id, type: String, desc: 'The ID of a project'
end
......
......@@ -214,7 +214,7 @@ module API
use :statistics_params
use :with_custom_attributes
end
get ":user_id/projects", feature_category: :projects do
get ":user_id/projects", feature_category: :projects, urgency: :default do
user = find_user(params[:user_id])
not_found!('User') unless user
......@@ -251,7 +251,8 @@ module API
use :statistics_params
use :with_custom_attributes
end
get feature_category: :projects do
# TODO: Set higher urgency https://gitlab.com/gitlab-org/gitlab/-/issues/211495
get feature_category: :projects, urgency: :low do
present_projects load_projects
end
......@@ -340,7 +341,8 @@ module API
optional :license, type: Boolean, default: false,
desc: 'Include project license data'
end
get ":id", feature_category: :projects do
# TODO: Set higher urgency https://gitlab.com/gitlab-org/gitlab/-/issues/357622
get ":id", feature_category: :projects, urgency: :default do
options = {
with: current_user ? Entities::ProjectWithAccess : Entities::BasicProjectDetails,
current_user: current_user,
......
......@@ -99,7 +99,7 @@ module API
use :optional_index_params_ee
end
# rubocop: disable CodeReuse/ActiveRecord
get feature_category: :users do
get feature_category: :users, urgency: :default do
authenticated_as_admin! if params[:extern_uid].present? && params[:provider].present?
unless current_user&.admin?
......@@ -143,7 +143,7 @@ module API
use :with_custom_attributes
end
# rubocop: disable CodeReuse/ActiveRecord
get ":id", feature_category: :users do
get ":id", feature_category: :users, urgency: :medium do
forbidden!('Not authorized!') unless current_user
unless current_user.admin?
......@@ -168,7 +168,7 @@ module API
params do
requires :user_id, type: String, desc: 'The ID or username of the user'
end
get ":user_id/status", requirements: API::USER_REQUIREMENTS, feature_category: :users do
get ":user_id/status", requirements: API::USER_REQUIREMENTS, feature_category: :users, urgency: :high do
user = find_user(params[:user_id])
not_found!('User') unless user && can?(current_user, :read_user, user)
......@@ -919,7 +919,7 @@ module API
desc 'Get the currently authenticated user' do
success Entities::UserPublic
end
get feature_category: :users do
get feature_category: :users, urgency: :medium do
entity =
if current_user.admin?
Entities::UserWithAdmin
......
......@@ -9,7 +9,7 @@ RSpec.describe Gitlab::Metrics::RailsSlis do
end
allow(Gitlab::RequestEndpoints).to receive(:all_api_endpoints).and_return([api_route])
allow(Gitlab::RequestEndpoints).to receive(:all_controller_actions).and_return([[ProjectsController, 'show']])
allow(Gitlab::RequestEndpoints).to receive(:all_controller_actions).and_return([[ProjectsController, 'index']])
allow(Gitlab::Graphql::KnownOperations).to receive(:default).and_return(Gitlab::Graphql::KnownOperations.new(%w(foo bar)))
end
......@@ -22,7 +22,7 @@ RSpec.describe Gitlab::Metrics::RailsSlis do
request_urgency: :default
},
{
endpoint_id: "ProjectsController#show",
endpoint_id: "ProjectsController#index",
feature_category: :projects,
request_urgency: :default
}
......
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