diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 08:43:02 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 08:43:02 +0000 |
commit | d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb (patch) | |
tree | 2341ef426af70ad1e289c38036737e04b0aa5007 /lib/api/base.rb | |
parent | d6e514dd13db8947884cd58fe2a9c2a063400a9b (diff) | |
download | gitlab-ce-d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb.tar.gz |
Add latest changes from gitlab-org/gitlab@14-4-stable-eev14.4.0-rc42
Diffstat (limited to 'lib/api/base.rb')
-rw-r--r-- | lib/api/base.rb | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/api/base.rb b/lib/api/base.rb index 33e47c18fcd..c245a65b30b 100644 --- a/lib/api/base.rb +++ b/lib/api/base.rb @@ -2,20 +2,33 @@ module API class Base < Grape::API::Instance # rubocop:disable API/Base - include ::Gitlab::WithFeatureCategory + include ::Gitlab::EndpointAttributes class << self def feature_category_for_app(app) feature_category_for_action(path_for_app(app)) end + def urgency_for_app(app) + urgency_for_action(path_for_app(app)) + end + def path_for_app(app) normalize_path(app.namespace, app.options[:path].first) end + def endpoint_id_for_route(route) + "#{route.request_method} #{route.origin}" + end + def route(methods, paths = ['/'], route_options = {}, &block) + actions = Array(paths).map { |path| normalize_path(namespace, path) } if category = route_options.delete(:feature_category) - feature_category(category, Array(paths).map { |path| normalize_path(namespace, path) }) + feature_category(category, actions) + end + + if target = route_options.delete(:urgency) + urgency(target, actions) end super |