Feature Flags

5 minute readExtensibilityDeveloper productivity

This plugin integrates with CloudBees Feature Management to facilitate feature flagging as part of deployments and releases.

Plugin version 1.2.0.2021083060

Revised on September 09, 2021

Plugin configurations

Plugin configurations are sets of parameters that apply across some or all of the plugin procedures. They reduce repetition of common values, create predefined parameter sets for end users, and securely store credentials where needed. Each configuration is given a unique name that is entered in designated parameters on procedures that use them.

Creating plugin configurations

To create plugin configurations in CloudBees CD, do these steps:

  • Go to Administration Plugins to open the Plugin Manager.

  • Find the EC-FeatureFlags-1.2.0.2021083060 row.

  • Click Configure to open the Configurations page.

  • Click Create Configuration as per the description of parameters below.

Configuration procedure parameters

ParameterDescription

Configuration Name

The name for the created configuration

Description

Description for the configuration

User Token

The User Token required to connect to the CloudBees Feature Flags Instance.

It can be retrieved from App Settings → Integrations → User Token → Show.

Check Connection?

If checked, the connection endpoint and credentials entered as part of the configuration will be tested. If this option is checked, configuration will not be saved if the test fails.

Debug Level

This option sets debug level for logs. If info is selected, only summary information will be shown, for debug, there will be some debug information and for trace the whole requests and responses will be shown.

Plugin procedures

Get Environments

This procedure retrieves the different environments registered in CloudBees Feature Management for the specified Application.

Get Environments parameters

ParameterDescription

Configuration Name

Previously defined configuration for the plugin

Application Id

The Id of the application whose environments needs to be retrieved.

It can be chosen from App Settings → Integrations → Application Id.

Output parameters

ParameterDescription

environments

JSON representation of the environments registered in Rollout.

Get Experiments

This procedure retrieves all flags associated with a specified Application and Environment.

Get Experiments parameters

ParameterDescription

Configuration Name

Previously defined configuration for the plugin

Application Id

The Id of the application from which flags should be retrieved.

It can be chosen from App Settings → Integrations → Application Id.

Environment Name

Environment name, e.g. Production.

Output parameters

ParameterDescription

experiments

JSON representation of the flags that are retrieved.

Get Experiment

Retrieves a single flag data associated with a specified flag.

Get Experiment parameters

ParameterDescription

Configuration Name

Previously defined configuration for the plugin

Application Id

The Id of the application from which the specified flag should be retrieved.

It can be chosen from App Settings → Integrations → Application Id.

Environment Name

Environment name, e.g. Production.

Flag Name

Name of the flag that is managed by the flag. If the flag for the selected flag does not exist, the procedure will fail.

Output parameters

ParameterDescription

experiment

JSON representation of the flag.

Create or Update Experiment

This procedure creates a new CloudBees Feature Flags flag. If the flag exists already it would update it.

Create or Update Experiment parameters

ParameterDescription

Configuration Name

Previously defined configuration for the plugin

Application Id

The Id of the application from which the specified flag should be retrieved.

It can be chosen from App Settings → Integrations → Application Id.

Environment Name

Environment name, e.g. Production.

Flag Name

The name of the flag, e.g. featureEnabled.

Action

The action to uptake. Available actions are: Set value - set boolean flag true/false. Set splitted value - set split percentage. Set scheduled value - set percentage and scheduled date.

Condition

The condition for the action. Available conditions are: All Users (No condition) Target Groups - apply only for the specific target groups

Flag Value

The value to set. Checked equals to True.

True Percentage

Percentage for the True value expressed as a number. Default is 100.

Start Date

Start date for the scheduled value.

Target Groups

Target groups covered by the condition. When specifying multiple target groups, separate them by a new line.

Target Groups Operator

The logical relationship between the groups.

Enabled

If checked, this flag will be enabled.

Default Value

Default value for the flag if no conditions are provided.

Apply to version

Apply condition only to specified version.

Operator

Set version operator.

Semantic version

Application version to compare to.

Toggle flag

This procedure will enable/disable the flag

Toggle flag parameters

ParameterDescription

Configuration Name

Previously defined configuration for the plugin

Application ID

The Id of the application from which the specified flag should be retrieved.

It can be chosen from App Settings → Integrations → Application Id.

Environment Name

Environment name, e.g. Production.

Flag Name

The name of the flag, e.g. featureEnabled.

Targeting

Enable of disable the targeting.

Collect Reporting Data

Collect Reporting Data parameters

ParameterDescription

Configuration name

Previously defined configuration for the plugin

Application Id

The Id of the application from which flags should be retrieved. It can be chosen from App Settings → Integrations → Application Id.

Environment Name

Environment name, e.g. Production.

Filter by flag name

Regex for filtering flags by their names, eg. myFlag\d+

Filter by flag label

Regex for filtering flags by their label, eg. myFlag Label\d+

Metadata property path

Property sheet where run metadata will be stored. If omitted, /mySchedule/EC-Git-%JobName%-%Report Object Type% will be used for schedule contest. For all other contexts root is /myProject.

Transform script

Allows a user to provide Groovy closure for payload customization. This script will be invoked by the plugin with 1 or 2 parameters. * if one parameter: it is a payload object. * if two parameters: 1st parameter is context object (FlowPlugin), 2nd is a payload object. In this example "flagsStale" field will be changed in the payload object:

{ Object pluginObject, Map flag -> if (!flag) { return flag }

flag["flagsStale"] *= 10

return flag }

or

{ Map flag -> if (!flag) { return flag }

flag["flagsStale"] *= 10

return flag }

Preview

If checked, no data will be sent to the reporting system. Use this option to preview gathered data.

Debug

If checked, the log level will be set to "Debug" for the job.

Release name

Name of the CloudBees Flow release collected data relates to.

Release project name

Name of the CloudBees Flow release project collected data relates to.

Use Case

This example provides a simple example of how the EC-FeatureFlags can be used with a CloudBees CD Deployment.

Release notes

EC-FeatureFlags 1.2.1

  • Fixed Dynamic dropdowns for the Toggle flag procedure.

EC-FeatureFlags 1.2.0

  • Added integration with CloudBees Analytics server.

  • Added option NOR to group conditions.

  • Removed option NOT from group conditions.

EC-FeatureFlags 1.1.0

  • Added Toggle flag procedure

EC-FeatureFlags 1.0.4

  • Upgraded third-party dependencies.

EC-FeatureFlags 1.0.3

  • Upgraded third-party dependencies to address security issues.

EC-FeatureFlags 1.0.2

  • The documentation has been migrated to the main documentation site.

EC-FeatureFlags 1.0.1

  • Upgraded okhttp library to address security issues.

EC-FeatureFlags 1.0.0

  • Introduced EC-FeatureFlags plugin.