Commit 289fae78 authored by Rémy Coutable's avatar Rémy Coutable

Rename flipper_group to feature_group

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 94b67374
......@@ -58,10 +58,10 @@ POST /features/:name
| --------- | ---- | -------- | ----------- |
| `name` | string | yes | Name of the feature to create or update |
| `value` | integer/string | yes | `true` or `false` to enable/disable, or an integer for percentage of time |
| `flipper_group` | string | no | A Flipper group name |
| `feature_group` | string | no | A Feature group name |
| `user` | string | no | A GitLab username |
Note that `flipper_group` and `user` are mutually exclusive.
Note that `feature_group` and `user` are mutually exclusive.
```bash
curl --data "value=30" --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/features/new_library
......
......@@ -15,8 +15,8 @@ module API
end
def gate_target(params)
if params[:flipper_group]
Feature.group(params[:flipper_group])
if params[:feature_group]
Feature.group(params[:feature_group])
elsif params[:user]
User.find_by_username(params[:user])
else
......@@ -40,9 +40,9 @@ module API
end
params do
requires :value, type: String, desc: '`true` or `false` to enable/disable, an integer for percentage of time'
optional :flipper_group, type: String, desc: 'A Flipper group name'
optional :feature_group, type: String, desc: 'A Feature group name'
optional :user, type: String, desc: 'A GitLab username'
mutually_exclusive :flipper_group, :user
mutually_exclusive :feature_group, :user
end
post ':name' do
feature = Feature.get(params[:name])
......
......@@ -88,8 +88,8 @@ describe API::Features do
'gates' => [{ 'key' => 'boolean', 'value' => true }])
end
it 'creates an enabled feature for the given Flipper group when passed flipper_group=perf_team' do
post api("/features/#{feature_name}", admin), value: 'true', flipper_group: 'perf_team'
it 'creates an enabled feature for the given Flipper group when passed feature_group=perf_team' do
post api("/features/#{feature_name}", admin), value: 'true', feature_group: 'perf_team'
expect(response).to have_http_status(201)
expect(json_response).to eq(
......@@ -147,8 +147,8 @@ describe API::Features do
'gates' => [{ 'key' => 'boolean', 'value' => true }])
end
it 'enables the feature for the given Flipper group when passed flipper_group=perf_team' do
post api("/features/#{feature_name}", admin), value: 'true', flipper_group: 'perf_team'
it 'enables the feature for the given Flipper group when passed feature_group=perf_team' do
post api("/features/#{feature_name}", admin), value: 'true', feature_group: 'perf_team'
expect(response).to have_http_status(201)
expect(json_response).to eq(
......@@ -188,11 +188,11 @@ describe API::Features do
'gates' => [{ 'key' => 'boolean', 'value' => false }])
end
it 'disables the feature for the given Flipper group when passed flipper_group=perf_team' do
it 'disables the feature for the given Flipper group when passed feature_group=perf_team' do
feature.enable(Feature.group(:perf_team))
expect(Feature.get(feature_name).enabled?(admin)).to be_truthy
post api("/features/#{feature_name}", admin), value: 'false', flipper_group: 'perf_team'
post api("/features/#{feature_name}", admin), value: 'false', feature_group: 'perf_team'
expect(response).to have_http_status(201)
expect(json_response).to eq(
......
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