diff --git a/docs/activation-strategies.md b/docs/activation-strategies.md index d2b28aa58c..8e034ac756 100644 --- a/docs/activation-strategies.md +++ b/docs/activation-strategies.md @@ -29,15 +29,15 @@ A flexible rollout strategy which combines all gradual rollout strategies in to - **stickiness** is used to define how we guarantee consistency for gradual rollout. The same userId and the same rollout percentage should give predictable results. Configuration that should be supported: - **default** - Unleash chooses the first value present on the context in defined order userId, sessionId, random. - - **userId** - guaranteed to be sticky on userId. If userId not present the behaviour would be false - - **sessionId** - guaranteed to be sticky on sessionId. If sessionId not present the behaviour would be false. + - **userId** - guaranteed to be sticky on userId. If userId not present the behavior would be false + - **sessionId** - guaranteed to be sticky on sessionId. If sessionId not present the behavior would be false. - **random** - no stickiness guaranteed. For every isEnabled call it will yield a random true/false based on the selected rollout percentage. -- **groupId** is used to ensure that different toggles will **hash differently** for the same user. The groupId defaults to _feature toggle name_, but is overridable by the user to _correlate rollout_ of multiple feature toggles. +- **groupId** is used to ensure that different toggles will **hash differently** for the same user. The groupId defaults to _feature toggle name_, but the use can override it to _correlate rollout_ of multiple feature toggles. - **rollout** The percentage (0-100) you want to enable the feature toggle for. ## gradualRolloutUserId -The `gradualRolloutUserId` strategy gradually activates a feature toggle for logged in users. Stickiness is based on the user ID. The strategy guarantees that the same user gets the same experience every time across devices. It also assures that a user which is among the first 10% will also be among the first 20% of the users. That way, we ensure the users get the same experience, even if we gradually increase the number of users exposed to a particular feature. To achieve this, we hash the user ID and normalise the hash value to a number between 1 and 100 with a simple modulo operator. +The `gradualRolloutUserId` strategy gradually activates a feature toggle for logged in users. Stickiness is based on the user ID. The strategy guarantees that the same user gets the same experience every time across devices. It also assures that a user which is among the first 10% will also be among the first 20% of the users. That way, we ensure the users get the same experience, even if we gradually increase the number of users exposed to a particular feature. To achieve this, we hash the user ID and normalize the hash value to a number between 1 and 100 with a simple modulo operator. ![hash_and_normalise](assets/hash_and_normalise.png) diff --git a/docs/addons.md b/docs/addons.md deleted file mode 100644 index 5170593c87..0000000000 --- a/docs/addons.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -id: addons -title: Unleash Addons ---- - -> This feature was introduced in _Unleash v3.11.0_. - -Unleash Addons allows you to extend Unleash with new functionality diff --git a/docs/addons/addons.md b/docs/addons/addons.md new file mode 100644 index 0000000000..67e6285708 --- /dev/null +++ b/docs/addons/addons.md @@ -0,0 +1,16 @@ +--- +id: index +title: Addons Introduction +--- + +> This feature was introduced in _Unleash v3.11.0_. + +Unleash Addons allows you to extend Unleash with new functionality. Currently addons allow you to listen to changes in Unleash and trigger updates in other systems, typical via a WebHook. + +Currently Unleash support the following Addons out of the box: + +- [Webhook](./webhook) - A generic way to post messages from Unleash to third party services. +- [Slack](./slack) - Allows Unleash to post updates to Slack. +- [Jira Commenter](./jira-commenter) - Allows Unleash to post comments to jira issues (beta). + +In future releases we plan to support community built addons. diff --git a/docs/addons/jira-comment.md b/docs/addons/jira-comment.md deleted file mode 100644 index 21c0787265..0000000000 --- a/docs/addons/jira-comment.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -id: jira-comment -title: Unleash Jira commenter addon ---- - -> This feature was introduced in _Unleash v3.11.0_. - -Enables commenting on issues from unleash when toggles are updated/revived/archived/created. - -## Configuration - -- When configuring an instance of the Jira commenter plugin you'll need the following - - - JIRA base url - e.g. https://mycompany.atlassian.net. - - JIRA username - the username of the user the plugin should comment as. - - JIRA api token - an api token for the user the plugin should comment as. - - If you're running Atlassian cloud - it can be added by visiting: https://id.atlassian.com/manage-profile/security/api-tokens when logged in as the user the plugin should comment as. - -- After the instance is configured, you can now tag your feature toggles with tags of type `jira`. -- The value of the tag should be in normal JIRA issue format (PROJECTKEY-ISSUENUMBER). -- Once a toggle has been tagged with a jira tag, all updates to the toggle will be added as a comment on the issue stored in the tag. diff --git a/docs/addons/jira-commenter.md b/docs/addons/jira-commenter.md new file mode 100644 index 0000000000..6641a1ad10 --- /dev/null +++ b/docs/addons/jira-commenter.md @@ -0,0 +1,38 @@ +--- +id: jira-commenter +title: Jira commenter +--- + +> This feature was introduced in _Unleash v3.11.0_. + +Enables commenting on issues from unleash when toggles are updated/revived/archived/created. + +## Configuration + +#### Events + +You can choose to trigger updates for the following events (we might add more event types in the future): + +- feature-created +- feature-updated +- feature-archived +- feature-revived + +#### Parameters + +Unleash Jira Commenter addons takes the following parameters. + +- **JIRA base url** - e.g. https://mycompany.atlassian.net. +- **JIRA username** - the username of the user the plugin should comment as. +- **JIRA api token** - an api token for the user the plugin should comment as. + +An api token can be configured using https://id.atlassian.com/manage-profile/security/api-tokens when logged in as the users you'd like the plugin to make the comment as. + +#### Tags + +- The Jira commenter addon also defined the Tag Type "jira". You may use this tag to tell the plugin which issue Unleash should post updates to. +- The value of the tag should be in normal JIRA issue format (PROJECTKEY-ISSUENUMBER). + +![Jira tags](../assets/jira_addon_tags.png) + +In the picture you can see we have defined one Jira tag for the `demo` toggle. In this example, the issue **UC-1** would receive updates then something happens to this toggle diff --git a/docs/addons/slack.md b/docs/addons/slack.md new file mode 100644 index 0000000000..4d5ba1ef92 --- /dev/null +++ b/docs/addons/slack.md @@ -0,0 +1,38 @@ +--- +id: slack +title: Slack +--- + +> This feature was introduced in _Unleash v3.11.0_. + +The Slack addon allows Unleash to post Updates when a feature toggle is updated. To set up Slack, you need to configure an incoming Slack webhook URL. You can follow [Sending messages using Incoming Webhooks](https://api.slack.com/incoming-webhooks) on how to do that. You can also choose to [create a slack app for Unleash](https://api.slack.com/apps), which will provide you with additional functionality to control how Unleash communicates messages on your Slack workspace. + +The Slack addon will perform a single retry if the HTTP POST against the Slack Webhook URL fails (either a 50x or network error). Duplicate events may happen,m and you should never assume events always comes in order. + +## Configuration + +#### Events + +You can choose to trigger updates for the following events (we might add more event types in the future): + +- feature-created +- feature-updated +- feature-archived +- feature-revived + +#### Parameters + +Unleash Slack addon takes the following parameters. + +- **Slack Webhook URL** - This is the only required property. If you are using a Slack Application you must also make sure your application is allowed to post to the channel you want to post to. +- **Username** - Used to override the username used to post the update to a slack channel. +- **Emoji Icon** - Used to override the emoji icon used to post the update to a slack channel. +- Default channel - Where to post the message if the feature toggles has not overriden the channel via the slack tags. + +#### Tags + +The Slack addon also defined the Tag type "slack". You may use this tag to override which slack channel Unleash should post updates to for this feature toggle. + +![Slack Tags](../assets/slack_addon_tags.png) + +In the picture you can see we have defined two slack tags for the "Demo" toggle. In this example Unleash will post updates to the **#notifications** and **#random** channel. diff --git a/docs/addons/webhook.md b/docs/addons/webhook.md index 8f600876bd..b939b3c438 100644 --- a/docs/addons/webhook.md +++ b/docs/addons/webhook.md @@ -1,8 +1,44 @@ --- id: webhook -title: Unleash Webhook addon +title: Webhook --- > This feature was introduced in _Unleash v3.11.0_. -Unleash Addons allows you to extend Unleash with new functionality +The Webhook Addon introduces a generic way to post messages from Unleash to third party services. Unleash allows you to define a webhook which listens changes in Unleash and post them to a third party services. + +The webhook will perform a single retry if the HTTP POST call fails (either a 50x or network error). Duplicate events may happen,m and you should never assume events always comes in order. + +## Configuration + +#### Events + +You can choose to trigger updates for the following events (we might add more event types in the future): + +- feature-created +- feature-updated +- feature-archived +- feature-revived + +#### Parameters + +Unleash Webhook addon takes the following parameters. + +**Webhook URL** This is the only required property. If you are using a Slack Application you must also make sure your application is allowed to post the channel you want to post to. + +**Content-Type** Used to set the content-type header used when unleash performs a HTTP POST to the defined endpoint. + +**Body template** Used to override the body template used by Unleash when performing the HTTP POST. You may format you message using a [Mustache template](https://mustache.github.io). You will have the [Unleash event format](/docs/api/admin/events) available in the rendering context. + +Example: + +```mustache +{ + "event": "{{event.type}}", + "createdBy": "{{event.createdBy}}", + "featureToggle": "{{event.data.name}}", + "timestamp": "{{event.data.createdAt}}" +} +``` + +If you don't specify anything Unleash will use the [Unleash event format](/docs/api/admin/events). diff --git a/docs/assets/jira_addon_tags.png b/docs/assets/jira_addon_tags.png new file mode 100644 index 0000000000..b0e85ad08b Binary files /dev/null and b/docs/assets/jira_addon_tags.png differ diff --git a/docs/assets/slack_addon_tags.png b/docs/assets/slack_addon_tags.png new file mode 100644 index 0000000000..101a095b23 Binary files /dev/null and b/docs/assets/slack_addon_tags.png differ diff --git a/website/i18n/en.json b/website/i18n/en.json index f08436b43a..d2bac9eb47 100644 --- a/website/i18n/en.json +++ b/website/i18n/en.json @@ -8,11 +8,17 @@ "activation_strategy": { "title": "Activation Strategies" }, - "addons": { - "title": "Unleash Addons" + "addons/index": { + "title": "Addons Introduction" + }, + "addons/jira-commenter": { + "title": "Jira commenter" + }, + "addons/slack": { + "title": "Slack" }, "addons/webhook": { - "title": "Unleash Webhook addon" + "title": "Webhook" }, "api/admin/addons": { "title": "/api/admin/addons" @@ -121,6 +127,7 @@ }, "categories": { "User Documentation": "User Documentation", + "Addons": "Addons", "Developer Guide": "Developer Guide", "Guides": "Guides", "Client": "Client", diff --git a/website/sidebars.json b/website/sidebars.json index 93ee1e6b6a..181695243d 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -9,10 +9,15 @@ "securing_unleash", "unleash_context", "activation_strategy", - "addons", "client_specification", "migration_guide" ], + "Addons": [ + "addons/index", + "addons/webhook", + "addons/slack", + "addons/jira-commenter" + ], "Developer Guide": [ "developer_guide", "database_schema",