diff options
author | Rémy Coutable <remy@rymai.me> | 2017-06-28 19:29:56 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-06-28 19:29:56 +0200 |
commit | 289fae78e971e117e69fb87602f5f6284419b863 (patch) | |
tree | a9f69eeae404bc939eadeb8fe4c73614868056d4 | |
parent | 94b673747e94e32dea576b0eaa915f6fb731628d (diff) | |
download | gitlab-ce-289fae78e971e117e69fb87602f5f6284419b863.tar.gz |
Rename flipper_group to feature_group34078-allow-to-enable-feature-flags-with-more-granularity
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r-- | doc/api/features.md | 4 | ||||
-rw-r--r-- | lib/api/features.rb | 8 | ||||
-rw-r--r-- | spec/requests/api/features_spec.rb | 12 |
3 files changed, 12 insertions, 12 deletions
diff --git a/doc/api/features.md b/doc/api/features.md index a3bf5d018a7..558869255cc 100644 --- a/doc/api/features.md +++ b/doc/api/features.md @@ -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 diff --git a/lib/api/features.rb b/lib/api/features.rb index e426bc050eb..21745916463 100644 --- a/lib/api/features.rb +++ b/lib/api/features.rb @@ -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]) diff --git a/spec/requests/api/features_spec.rb b/spec/requests/api/features_spec.rb index 0ee0749c7a1..1d8aaeea8f2 100644 --- a/spec/requests/api/features_spec.rb +++ b/spec/requests/api/features_spec.rb @@ -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( |