Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
47f98037
Commit
47f98037
authored
Nov 17, 2020
by
Sean McGivern
Committed by
Bob Van Landuyt
Nov 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update feature categorisation docs for API endpoints
parent
1ce4c0d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
1 deletion
+40
-1
doc/development/feature_categorization/index.md
doc/development/feature_categorization/index.md
+40
-1
No files found.
doc/development/feature_categorization/index.md
View file @
47f98037
...
@@ -8,7 +8,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
...
@@ -8,7 +8,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> [Introduced](https://gitlab.com/groups/gitlab-com/gl-infra/-/epics/269) in GitLab 13.2.
> [Introduced](https://gitlab.com/groups/gitlab-com/gl-infra/-/epics/269) in GitLab 13.2.
Each Sidekiq worker, controller action, or
(eventually)
API endpoint
Each Sidekiq worker, controller action, or API endpoint
must declare a
`feature_category`
attribute. This attribute maps each
must declare a
`feature_category`
attribute. This attribute maps each
of these to a
[
feature
of these to a
[
feature
category
](
https://about.gitlab.com/handbook/product/product-categories/
)
. This
category
](
https://about.gitlab.com/handbook/product/product-categories/
)
. This
...
@@ -118,3 +118,42 @@ assigned to all actions.
...
@@ -118,3 +118,42 @@ assigned to all actions.
The spec also validates if the used feature categories are known. And if
The spec also validates if the used feature categories are known. And if
the actions used in configuration still exist as routes.
the actions used in configuration still exist as routes.
## API endpoints
Grape API endpoints can use the
`feature_category`
class method, like
[
Rails controllers
](
#rails-controllers
)
do:
```
ruby
module
API
class
Issues
<
::
API
::
Base
feature_category
:issue_tracking
end
end
```
The second argument can be used to specify feature categories for
specific routes:
```
ruby
module
API
class
Users
<
::
API
::
Base
feature_category
:users
,
[
'/users/:id/custom_attributes'
,
'/users/:id/custom_attributes/:key'
]
end
end
```
Or the feature category can be specified in the action itself:
```
ruby
module
API
class
Users
<
::
API
::
Base
get
':id'
,
feature_category: :users
do
end
end
end
```
As with Rails controllers, an API class must specify the category for
every single action unless the same category is used for every action
within that class.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment