Method: Gitlab::Client::Features#set_feature

Defined in:
lib/gitlab/client/features.rb

#set_feature(name, value, options = {}) ⇒ Gitlab::ObjectifiedHash

Set a features gate value. If a feature with the given name does not exist yet it will be created. The value can be a boolean, or an integer to indicate percentage of time.

Examples:

Gitlab.set_feature('new_library', true)
Gitlab.set_feature('new_library', 8)
Gitlab.set_feature('new_library', true, {user: 'gitlab'})

Parameters:

  • name(required) (String)

    Name of the feature to create or update

  • value(required) (String, Integer)

    true or false to enable/disable, or an integer for percentage of time

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :feature_group(optional) (String)

    A Feature group name

  • :user(optional) (String)

    A GitLab username

  • :project(optional) (String)

    A projects path, for example “gitlab-org/gitlab-ce”

Returns:



32
33
34
35
# File 'lib/gitlab/client/features.rb', line 32

def set_feature(name, value, options = {})
  body = { value: value }.merge(options)
  post("/features/#{name}", body: body)
end