1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-12 01:17:04 +02:00

fix: add docs for addons

This commit is contained in:
Ivar Conradi Østhus 2021-02-05 14:19:04 +01:00
parent dcf1224a17
commit 1486cdab52
11 changed files with 150 additions and 39 deletions

View File

@ -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)

View File

@ -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

16
docs/addons/addons.md Normal file
View File

@ -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.

View File

@ -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.

View File

@ -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

38
docs/addons/slack.md Normal file
View File

@ -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.

View File

@ -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).

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

@ -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",

View File

@ -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",