Commit b45adad7 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'bvl-api-feature-categories-2' into 'master'

Add feature categories to the API B -> G

See merge request gitlab-org/gitlab!46421
parents ace29a81 bfe2a24d
...@@ -8,6 +8,8 @@ module API ...@@ -8,6 +8,8 @@ module API
helpers ::API::Helpers::BadgesHelpers helpers ::API::Helpers::BadgesHelpers
feature_category :continuous_integration
helpers do helpers do
def find_source_if_admin(source_type) def find_source_if_admin(source_type)
source = find_source(source_type, params[:id]) source = find_source(source_type, params[:id])
......
...@@ -9,6 +9,8 @@ module API ...@@ -9,6 +9,8 @@ module API
before { authenticate! } before { authenticate! }
feature_category :boards
helpers do helpers do
def board_parent def board_parent
user_project user_project
......
...@@ -10,6 +10,8 @@ module API ...@@ -10,6 +10,8 @@ module API
after_validation { content_type "application/json" } after_validation { content_type "application/json" }
feature_category :source_code_management
before do before do
require_repository_enabled! require_repository_enabled!
authorize! :download_code, user_project authorize! :download_code, user_project
......
...@@ -4,6 +4,8 @@ module API ...@@ -4,6 +4,8 @@ module API
class BroadcastMessages < ::API::Base class BroadcastMessages < ::API::Base
include PaginationParams include PaginationParams
feature_category :navigation
resource :broadcast_messages do resource :broadcast_messages do
helpers do helpers do
def find_message def find_message
......
...@@ -7,6 +7,8 @@ module API ...@@ -7,6 +7,8 @@ module API
before { authenticate! } before { authenticate! }
feature_category :continuous_integration
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
......
...@@ -7,6 +7,8 @@ module API ...@@ -7,6 +7,8 @@ module API
before { authenticate_non_get! } before { authenticate_non_get! }
feature_category :continuous_integration
params do params do
requires :id, type: String, desc: 'The project ID' requires :id, type: String, desc: 'The project ID'
end end
......
...@@ -7,6 +7,8 @@ module API ...@@ -7,6 +7,8 @@ module API
content_type :txt, 'text/plain' content_type :txt, 'text/plain'
feature_category :continuous_integration
resource :runners do resource :runners do
desc 'Registers a new Runner' do desc 'Registers a new Runner' do
success Entities::RunnerRegistrationDetails success Entities::RunnerRegistrationDetails
......
...@@ -7,6 +7,8 @@ module API ...@@ -7,6 +7,8 @@ module API
before { authenticate! } before { authenticate! }
feature_category :continuous_integration
resource :runners do resource :runners do
desc 'Get runners available for user' do desc 'Get runners available for user' do
success Entities::Runner success Entities::Runner
......
...@@ -4,6 +4,8 @@ require 'mime/types' ...@@ -4,6 +4,8 @@ require 'mime/types'
module API module API
class CommitStatuses < ::API::Base class CommitStatuses < ::API::Base
feature_category :continuous_integration
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
......
...@@ -6,6 +6,8 @@ module API ...@@ -6,6 +6,8 @@ module API
class Commits < ::API::Base class Commits < ::API::Base
include PaginationParams include PaginationParams
feature_category :source_code_management
before do before do
require_repository_enabled! require_repository_enabled!
authorize! :download_code, user_project authorize! :download_code, user_project
......
...@@ -4,6 +4,8 @@ module API ...@@ -4,6 +4,8 @@ module API
class ContainerRegistryEvent < ::API::Base class ContainerRegistryEvent < ::API::Base
DOCKER_DISTRIBUTION_EVENTS_V1_JSON = 'application/vnd.docker.distribution.events.v1+json' DOCKER_DISTRIBUTION_EVENTS_V1_JSON = 'application/vnd.docker.distribution.events.v1+json'
feature_category :package_registry
before { authenticate_registry_notification! } before { authenticate_registry_notification! }
resource :container_registry_event do resource :container_registry_event do
......
...@@ -6,6 +6,8 @@ module API ...@@ -6,6 +6,8 @@ module API
before { authenticate! } before { authenticate! }
feature_category :continuous_delivery
helpers do helpers do
def add_deploy_keys_project(project, attrs = {}) def add_deploy_keys_project(project, attrs = {})
project.deploy_keys_projects.create(attrs) project.deploy_keys_projects.create(attrs)
......
...@@ -4,6 +4,8 @@ module API ...@@ -4,6 +4,8 @@ module API
class DeployTokens < ::API::Base class DeployTokens < ::API::Base
include PaginationParams include PaginationParams
feature_category :continuous_delivery
helpers do helpers do
def scope_params def scope_params
scopes = params.delete(:scopes) scopes = params.delete(:scopes)
......
...@@ -7,6 +7,8 @@ module API ...@@ -7,6 +7,8 @@ module API
before { authenticate! } before { authenticate! }
feature_category :continuous_delivery
params do params do
requires :id, type: String, desc: 'The project ID' requires :id, type: String, desc: 'The project ID'
end end
......
...@@ -7,6 +7,8 @@ module API ...@@ -7,6 +7,8 @@ module API
before { authenticate! } before { authenticate! }
feature_category :continuous_delivery
params do params do
requires :id, type: String, desc: 'The project ID' requires :id, type: String, desc: 'The project ID'
end end
......
...@@ -4,6 +4,8 @@ module API ...@@ -4,6 +4,8 @@ module API
class ErrorTracking < ::API::Base class ErrorTracking < ::API::Base
before { authenticate! } before { authenticate! }
feature_category :error_tracking
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
......
...@@ -8,6 +8,8 @@ module API ...@@ -8,6 +8,8 @@ module API
allow_access_with_scope :read_user, if: -> (request) { request.get? } allow_access_with_scope :read_user, if: -> (request) { request.get? }
feature_category :users
resource :events do resource :events do
desc "List currently authenticated user's events" do desc "List currently authenticated user's events" do
detail 'This feature was introduced in GitLab 9.3.' detail 'This feature was introduced in GitLab 9.3.'
......
...@@ -7,6 +7,8 @@ module API ...@@ -7,6 +7,8 @@ module API
ENVIRONMENT_SCOPE_ENDPOINT_REQUIREMENTS = FeatureFlags::FEATURE_FLAG_ENDPOINT_REQUIREMENTS ENVIRONMENT_SCOPE_ENDPOINT_REQUIREMENTS = FeatureFlags::FEATURE_FLAG_ENDPOINT_REQUIREMENTS
.merge(environment_scope: API::NO_SLASH_URL_PART_REGEX) .merge(environment_scope: API::NO_SLASH_URL_PART_REGEX)
feature_category :feature_flags
before do before do
authorize_read_feature_flags! authorize_read_feature_flags!
end end
......
...@@ -7,6 +7,8 @@ module API ...@@ -7,6 +7,8 @@ module API
FEATURE_FLAG_ENDPOINT_REQUIREMENTS = API::NAMESPACE_OR_PROJECT_REQUIREMENTS FEATURE_FLAG_ENDPOINT_REQUIREMENTS = API::NAMESPACE_OR_PROJECT_REQUIREMENTS
.merge(name: API::NO_SLASH_URL_PART_REGEX) .merge(name: API::NO_SLASH_URL_PART_REGEX)
feature_category :feature_flags
before do before do
authorize_read_feature_flags! authorize_read_feature_flags!
end end
......
...@@ -8,6 +8,8 @@ module API ...@@ -8,6 +8,8 @@ module API
message.is_a?(String) ? { message: message }.to_json : message.to_json message.is_a?(String) ? { message: message }.to_json : message.to_json
} }
feature_category :feature_flags
before do before do
authorize_admin_feature_flags_user_lists! authorize_admin_feature_flags_user_lists!
end end
......
...@@ -4,6 +4,8 @@ module API ...@@ -4,6 +4,8 @@ module API
class Features < ::API::Base class Features < ::API::Base
before { authenticated_as_admin! } before { authenticated_as_admin! }
feature_category :feature_flags
helpers do helpers do
def gate_value(params) def gate_value(params)
case params[:value] case params[:value]
......
...@@ -9,6 +9,8 @@ module API ...@@ -9,6 +9,8 @@ module API
# Prevents returning plain/text responses for files with .txt extension # Prevents returning plain/text responses for files with .txt extension
after_validation { content_type "application/json" } after_validation { content_type "application/json" }
feature_category :source_code_management
helpers ::API::Helpers::HeadersHelpers helpers ::API::Helpers::HeadersHelpers
helpers do helpers do
......
...@@ -6,6 +6,8 @@ module API ...@@ -6,6 +6,8 @@ module API
before { authenticate! } before { authenticate! }
feature_category :continuous_delivery
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
......
...@@ -7,6 +7,8 @@ module API ...@@ -7,6 +7,8 @@ module API
prepend_if_ee('EE::API::BoardsResponses') # rubocop: disable Cop/InjectEnterpriseEditionModule prepend_if_ee('EE::API::BoardsResponses') # rubocop: disable Cop/InjectEnterpriseEditionModule
feature_category :boards
before do before do
authenticate! authenticate!
end end
......
...@@ -6,6 +6,8 @@ module API ...@@ -6,6 +6,8 @@ module API
before { authenticate! } before { authenticate! }
feature_category :kubernetes_management
params do params do
requires :id, type: String, desc: 'The ID of the group' requires :id, type: String, desc: 'The ID of the group'
end end
......
...@@ -8,6 +8,8 @@ module API ...@@ -8,6 +8,8 @@ module API
before { authorize_read_group_container_images! } before { authorize_read_group_container_images! }
feature_category :package_registry
REPOSITORY_ENDPOINT_REQUIREMENTS = API::NAMESPACE_OR_PROJECT_REQUIREMENTS.merge( REPOSITORY_ENDPOINT_REQUIREMENTS = API::NAMESPACE_OR_PROJECT_REQUIREMENTS.merge(
tag_name: API::NO_SLASH_URL_PART_REGEX) tag_name: API::NO_SLASH_URL_PART_REGEX)
......
...@@ -10,6 +10,8 @@ module API ...@@ -10,6 +10,8 @@ module API
authorize! :admin_group, user_group authorize! :admin_group, user_group
end end
feature_category :importers
params do params do
requires :id, type: String, desc: 'The ID of a group' requires :id, type: String, desc: 'The ID of a group'
end end
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
module API module API
class GroupImport < ::API::Base class GroupImport < ::API::Base
feature_category :importers
helpers Helpers::FileUploadHelpers helpers Helpers::FileUploadHelpers
helpers do helpers do
......
...@@ -7,6 +7,8 @@ module API ...@@ -7,6 +7,8 @@ module API
before { authenticate! } before { authenticate! }
feature_category :issue_tracking
params do params do
requires :id, type: String, desc: 'The ID of a group' requires :id, type: String, desc: 'The ID of a group'
end end
......
...@@ -7,6 +7,8 @@ module API ...@@ -7,6 +7,8 @@ module API
before { authenticate! } before { authenticate! }
feature_category :issue_tracking
params do params do
requires :id, type: String, desc: 'The ID of a group' requires :id, type: String, desc: 'The ID of a group'
end end
......
...@@ -7,6 +7,8 @@ module API ...@@ -7,6 +7,8 @@ module API
before { authenticate! } before { authenticate! }
before { authorize! :admin_build, user_group } before { authorize! :admin_build, user_group }
feature_category :continuous_integration
params do params do
requires :id, type: String, desc: 'The ID of a group' requires :id, type: String, desc: 'The ID of a group'
end end
......
...@@ -7,6 +7,8 @@ module API ...@@ -7,6 +7,8 @@ module API
before { authenticate_non_get! } before { authenticate_non_get! }
feature_category :subgroups
helpers Helpers::GroupsHelpers helpers Helpers::GroupsHelpers
helpers do helpers do
......
...@@ -22,7 +22,17 @@ RSpec.describe 'Every API endpoint' do ...@@ -22,7 +22,17 @@ RSpec.describe 'Every API endpoint' do
completed_classes = [ completed_classes = [
::API::Users, ::API::Issues, ::API::AccessRequests, ::API::Admin::Ci::Variables, ::API::Users, ::API::Issues, ::API::AccessRequests, ::API::Admin::Ci::Variables,
::API::Admin::InstanceClusters, ::API::Admin::Sidekiq, ::API::Appearance, ::API::Admin::InstanceClusters, ::API::Admin::Sidekiq, ::API::Appearance,
::API::Applications, ::API::Avatar, ::API::AwardEmoji ::API::Applications, ::API::Avatar, ::API::AwardEmoji, API::Badges,
::API::Boards, ::API::Branches, ::API::BroadcastMessages, ::API::Ci::Pipelines,
::API::Ci::PipelineSchedules, ::API::Ci::Runners, ::API::Ci::Runner,
::API::Commits, ::API::CommitStatuses, ::API::ContainerRegistryEvent,
::API::DeployKeys, ::API::DeployTokens, ::API::Deployments, ::API::Environments,
::API::ErrorTracking, ::API::Events, ::API::FeatureFlags, ::API::FeatureFlagScopes,
::API::FeatureFlagsUserLists, ::API::Features, ::API::Files, ::API::FreezePeriods,
::API::GroupBoards, ::API::GroupClusters, ::API::GroupExport, ::API::GroupImport,
::API::GroupLabels, ::API::GroupMilestones, ::API::Groups,
::API::GroupContainerRepositories, ::API::GroupVariables
] ]
next unless completed_classes.include?(klass) next unless completed_classes.include?(klass)
......
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