From 97db3223b76050dbaa75077b6ec393034ebe80a8 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Wed, 20 Dec 2023 14:11:46 +0000 Subject: [PATCH] chore: Simplify integration config (#3165) Co-authored-by: Ben Rometsch --- docs/docs/deployment/overview.md | 276 +++++++++++++++--- docs/docs/platform/releases.md | 6 - docs/package.json | 5 +- frontend/web/components/Aside.js | 5 +- .../web/components/pages/IntegrationsPage.js | 9 +- 5 files changed, 242 insertions(+), 59 deletions(-) diff --git a/docs/docs/deployment/overview.md b/docs/docs/deployment/overview.md index 5f10e6355cad..17caf6cf0ebc 100644 --- a/docs/docs/deployment/overview.md +++ b/docs/docs/deployment/overview.md @@ -181,40 +181,39 @@ the platform. For example, if you wanted to disable Google OAuth authentication, The list of the flags and remote config we're currently using in production is below: -| Flag Name | Description | Text Value | -| ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | -| `4eyes` | Whether to enable the Change Requests feature | None | -| `announcement` | Shows an announcement at the top of the app | None | -| `butter_bar` | Show html in a butter bar for certain users | None | -| `case_sensitive_flags` | Enables the project setting to allow case sensitive flags | None | -| `compare_environments` | Compare feature flag changes across environments | None | -| `configure_hide_sensitive_data` | If the value is true, the hide sensitive data switch will be displayed in the environment settings. | None | -| `dark_mode` | Enables Dark Mode in UI See Below | None | -| `disable_create_org` | Turning this on will prevent users from creating any additional organisations | None | -| `disable_users_as_reviewers` | If enabled, this flag will hide the Assigned users section in the Change Requests and in the Create Change Request modal in the Features page. | None | -| `enable_metadata` | If enabled, metadata can be handled | None | -| `feature_name_regex` | Enables the project setting to add a regex matcher to validate feature names | None | -| `feature_versioning` | Opt into feature versioning for your environment | None | -| `flag_analytics` | Flag usage chart - requires additional infrastructure ([See here](/deployment/overview#flag-analytics)) | None | -| `force_2fa` | Enables the organisation setting to force 2 factor authentication | None | -| `integration_data` | Integration config for different providers | [See Below](#integration_data) | -| `integrations` | Defines the integrations we display | ["amplitude","datadog","dynatrace","new-relic","segment","rudderstack","webhook","slack", "heap","mixpanel"] | -| `mailing_list` | Determines if mailing list consent is shown on signup | None | -| `max_api_calls_alert` | If enabled, shows an alert message in the top banner when the organization is over a 70% of its API calls limit | None | -| `oauth_github` | GitHub login key | [See Below](#oauth_github) | -| `oauth_google` | Google login key | [See Below](#oauth_google) | -| `payments_enabled` | Determines whether to show payment UI / seats | None | -| `plan_based_access` | Controls rbac and 2f based on plans | None | -| `rotate_api_token` | Enables the ability to rotate a user's access token | [See Below](#oauth_google) | -| `saml` | Enables SAML authentication | [See](/deployment/configuration/authentication/SAML) | -| `segment_associated_features` | Enables the ability to see features associated with a segment | None | -| `segment_operators` | Determines what rules are shown when creating a segment | [See Below](#segment_operators) | -| `serverside_sdk_keys` | Enable Server-side Environment Keys | None | -| `show_role_management` | Show role management tab in OrganisationalSettingsPage | None | -| `sso_idp` | For self hosted, this will automatically redirect to the pre configured IdP | None | -| `tag_environments` | Enables an environment setting to add a UI hint to your environments (e.g. for prod) | None | -| `usage_chart` | Organisation Analytics usage chart - | None | -| `verify_seats_limit_for_invite_links` | Determines whether to show los invite links | None | +| Flag Name | Description | Text Value | +| ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | +| `4eyes` | Whether to enable the Change Requests feature | None | +| `announcement` | Shows an announcement at the top of the app | None | +| `butter_bar` | Show html in a butter bar for certain users | None | +| `case_sensitive_flags` | Enables the project setting to allow case sensitive flags | None | +| `compare_environments` | Compare feature flag changes across environments | None | +| `configure_hide_sensitive_data` | If the value is true, the hide sensitive data switch will be displayed in the environment settings. | None | +| `dark_mode` | Enables Dark Mode in UI See Below | None | +| `disable_create_org` | Turning this on will prevent users from creating any additional organisations | None | +| `disable_users_as_reviewers` | If enabled, this flag will hide the Assigned users section in the Change Requests and in the Create Change Request modal in the Features page. | None | +| `enable_metadata` | If enabled, metadata can be handled | None | +| `feature_name_regex` | Enables the project setting to add a regex matcher to validate feature names | None | +| `feature_versioning` | Opt into feature versioning for your environment | None | +| `flag_analytics` | Flag usage chart - requires additional infrastructure ([See here](/deployment/overview#flag-analytics)) | None | +| `force_2fa` | Enables the organisation setting to force 2 factor authentication | None | +| `integration_data` | Integration config for different providers | [See Below](#integration_data) | +| `mailing_list` | Determines if mailing list consent is shown on signup | None | +| `max_api_calls_alert` | If enabled, shows an alert message in the top banner when the organization is over a 70% of its API calls limit | None | +| `oauth_github` | GitHub login key | [See Below](#oauth_github) | +| `oauth_google` | Google login key | [See Below](#oauth_google) | +| `payments_enabled` | Determines whether to show payment UI / seats | None | +| `plan_based_access` | Controls rbac and 2f based on plans | None | +| `rotate_api_token` | Enables the ability to rotate a user's access token | [See Below](#oauth_google) | +| `saml` | Enables SAML authentication | [See](/deployment/configuration/authentication/SAML) | +| `segment_associated_features` | Enables the ability to see features associated with a segment | None | +| `segment_operators` | Determines what rules are shown when creating a segment | [See Below](#segment_operators) | +| `serverside_sdk_keys` | Enable Server-side Environment Keys | None | +| `show_role_management` | Show role management tab in OrganisationalSettingsPage | None | +| `sso_idp` | For self hosted, this will automatically redirect to the pre configured IdP | None | +| `tag_environments` | Enables an environment setting to add a UI hint to your environments (e.g. for prod) | None | +| `usage_chart` | Organisation Analytics usage chart - | None | +| `verify_seats_limit_for_invite_links` | Determines whether to show los invite links | None | ### `integration_data` @@ -231,7 +230,8 @@ The list of the flags and remote config we're currently using in production is b }, { "key": "api_key", - "label": "API Key" + "label": "API Key", + "hidden": true } ], "tags": ["logging"], @@ -249,7 +249,8 @@ The list of the flags and remote config we're currently using in production is b }, { "key": "api_key", - "label": "API Key" + "label": "API Key", + "hidden": true }, { "key": "entity_selector", @@ -276,7 +277,12 @@ The list of the flags and remote config we're currently using in production is b "fields": [ { "key": "api_key", - "label": "API Key" + "label": "API Key", + "hidden": true + }, + { + "key": "base_url", + "label": "Base URL" } ], "tags": ["analytics"], @@ -294,7 +300,8 @@ The list of the flags and remote config we're currently using in production is b }, { "key": "api_key", - "label": "New Relic API Key" + "label": "New Relic API Key", + "hidden": true }, { "key": "app_id", @@ -312,7 +319,8 @@ The list of the flags and remote config we're currently using in production is b "fields": [ { "key": "api_key", - "label": "API Key" + "label": "API Key", + "hidden": true } ], "tags": ["analytics"], @@ -330,7 +338,8 @@ The list of the flags and remote config we're currently using in production is b }, { "key": "api_key", - "label": "API Key" + "label": "API Key", + "hidden": true } ], "tags": ["analytics"], @@ -348,7 +357,8 @@ The list of the flags and remote config we're currently using in production is b }, { "key": "secret", - "label": "Your Webhook Secret" + "label": "Your Webhook Secret", + "hidden": true } ], "tags": ["analytics"], @@ -362,7 +372,8 @@ The list of the flags and remote config we're currently using in production is b "fields": [ { "key": "api_key", - "label": "API Key" + "label": "API Key", + "hidden": true } ], "tags": ["analytics"], @@ -374,9 +385,188 @@ The list of the flags and remote config we're currently using in production is b "image": "/static/images/integrations/mp.svg", "docs": "https://docs.flagsmith.com/integrations/analytics/mixpanel", "fields": [ + { + "datadog": { + "perEnvironment": false, + "image": "/static/images/integrations/datadog.svg", + "docs": "https://docs.flagsmith.com/integrations/apm/datadog/", + "fields": [ + { + "key": "base_url", + "label": "Base URL" + }, + { + "key": "api_key", + "label": "API Key", + "hidden": true + } + ], + "tags": ["logging"], + "title": "Datadog", + "description": "Sends events to Datadog for when flags are created, updated and removed. Logs are tagged with the environment they came from e.g. production." + }, + "dynatrace": { + "perEnvironment": true, + "image": "/static/images/integrations/dynatrace.svg", + "docs": "https://docs.flagsmith.com/integrations/apm/dynatrace/", + "fields": [ + { + "key": "base_url", + "label": "Base URL" + }, + { + "key": "api_key", + "label": "API Key", + "hidden": true + }, + { + "key": "entity_selector", + "label": "Entity Selector" + } + ], + "tags": ["logging"], + "title": "Dynatrace", + "description": "Sends events to Dynatrace for when flags are created, updated and removed. Logs are tagged with the environment they came from e.g. production." + }, + "slack": { + "perEnvironment": true, + "isOauth": true, + "image": "/static/images/integrations/slack.svg", + "docs": "https://docs.flagsmith.com/integrations/slack/", + "tags": ["messaging"], + "title": "Slack", + "description": "Sends messages to Slack when flags are created, updated and removed. Logs are tagged with the environment they came from e.g. production." + }, + "amplitude": { + "perEnvironment": true, + "image": "/static/images/integrations/amplitude.svg", + "docs": "https://docs.flagsmith.com/integrations/analytics/amplitude/", + "fields": [ + { + "key": "api_key", + "label": "API Key", + "hidden": true + }, + { + "key": "base_url", + "label": "Base URL" + } + ], + "tags": ["analytics"], + "title": "Amplitude", + "description": "Sends data on what flags served to each identity." + }, + "new-relic": { + "perEnvironment": false, + "image": "/static/images/integrations/new_relic.svg", + "docs": "https://docs.flagsmith.com/integrations/apm/newrelic", + "fields": [ + { + "key": "base_url", + "label": "New Relic Base URL" + }, + { + "key": "api_key", + "label": "New Relic API Key", + "hidden": true + }, + { + "key": "app_id", + "label": "New Relic Application ID" + } + ], + "tags": ["analytics"], + "title": "New Relic", + "description": "Sends events to New Relic for when flags are created, updated and removed." + }, + "segment": { + "perEnvironment": true, + "image": "/static/images/integrations/segment.svg", + "docs": "https://docs.flagsmith.com/integrations/analytics/segment", + "fields": [ + { + "key": "api_key", + "label": "API Key", + "hidden": true + } + ], + "tags": ["analytics"], + "title": "Segment", + "description": "Sends data on what flags served to each identity." + }, + "rudderstack": { + "perEnvironment": true, + "image": "/static/images/integrations/rudderstack.svg", + "docs": "https://docs.flagsmith.com/integrations/analytics/rudderstack", + "fields": [ + { + "key": "base_url", + "label": "Rudderstack Data Plane URL" + }, + { + "key": "api_key", + "label": "API Key", + "hidden": true + } + ], + "tags": ["analytics"], + "title": "Rudderstack", + "description": "Sends data on what flags served to each identity." + }, + "webhook": { + "perEnvironment": true, + "image": "/static/images/integrations/webhooks.svg", + "docs": "https://docs.flagsmith.com/integrations/webhook", + "fields": [ + { + "key": "url", + "label": "Your Webhook URL Endpoint" + }, + { + "key": "secret", + "label": "Your Webhook Secret", + "hidden": true + } + ], + "tags": ["analytics"], + "title": "Webhook", + "description": "Sends data on what flags served to each identity to a Webhook Endpoint you provide." + }, + "heap": { + "perEnvironment": true, + "image": "/static/images/integrations/heap.svg", + "docs": "https://docs.flagsmith.com/integrations/analytics/heap", + "fields": [ + { + "key": "api_key", + "label": "API Key", + "hidden": true + } + ], + "tags": ["analytics"], + "title": "Heap Analytics", + "description": "Sends data on what flags served to each identity." + }, + "mixpanel": { + "perEnvironment": true, + "image": "/static/images/integrations/mp.svg", + "docs": "https://docs.flagsmith.com/integrations/analytics/mixpanel", + "fields": [ + { + "key": "api_key", + "label": "Project Token", + "hidden": true + } + ], + "tags": ["analytics"], + "title": "Mixpanel", + "description": "Sends data on what flags served to each identity." + } + }, { "key": "api_key", - "label": "Project Token" + "label": "Project Token", + "hidden": true } ], "tags": ["analytics"], diff --git a/docs/docs/platform/releases.md b/docs/docs/platform/releases.md index 5ca95f853520..2c5d0365df7d 100644 --- a/docs/docs/platform/releases.md +++ b/docs/docs/platform/releases.md @@ -402,12 +402,6 @@ new features and bug fixes since our last release: The remote config to use this is as follows: -```json -integrations: - -["data_dog"] -``` - ```json integration_data { diff --git a/docs/package.json b/docs/package.json index 78d05de503fc..36edb07220ae 100644 --- a/docs/package.json +++ b/docs/package.json @@ -11,8 +11,9 @@ "clear": "docusaurus clear", "serve": "docusaurus serve", "write-translations": "docusaurus write-translations", - "write-heading-ids": "docusaurus write-heading-ids" - }, + "write-heading-ids": "docusaurus write-heading-ids", + "prettier": "npx prettier --check docs", + "prettier:fix": "npx prettier --write --check docs"}, "dependencies": { "@docusaurus/core": "3.0.1", "@docusaurus/plugin-google-tag-manager": "^3.0.1", diff --git a/frontend/web/components/Aside.js b/frontend/web/components/Aside.js index 641d8dab782f..38614739676e 100644 --- a/frontend/web/components/Aside.js +++ b/frontend/web/components/Aside.js @@ -91,8 +91,9 @@ const Aside = class extends Component { render() { const { asideIsVisible, disabled, toggleAside } = this.props - let integrations = Utils.getFlagsmithValue('integrations') || '[]' - integrations = JSON.parse(integrations) + const integrations = Object.keys( + JSON.parse(Utils.getFlagsmithValue('integration_data') || '{}'), + ) const environmentId = (this.props.environmentId !== 'create' && this.props.environmentId) || (ProjectStore.model && diff --git a/frontend/web/components/pages/IntegrationsPage.js b/frontend/web/components/pages/IntegrationsPage.js index 8c79d891e5e9..57f9a2ab542e 100644 --- a/frontend/web/components/pages/IntegrationsPage.js +++ b/frontend/web/components/pages/IntegrationsPage.js @@ -21,12 +21,9 @@ const ProjectSettingsPage = class extends Component { } render() { - let integrations = Utils.getFlagsmithValue('integrations') || '[]' - try { - integrations = JSON.parse(integrations).sort() - } catch (e) { - integrations = [] - } + const integrations = Object.keys( + JSON.parse(Utils.getFlagsmithValue('integration_data') || '{}'), + ) return (