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