You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2023/04/17 13:48:31 UTC

[superset] branch master updated: chore: Removes deprecated feature flags for 3.0 (#23663)

This is an automated email from the ASF dual-hosted git repository.

michaelsmolina pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 6234888c69 chore: Removes deprecated feature flags for 3.0 (#23663)
6234888c69 is described below

commit 6234888c69e20e6e4002a908105c4966978b5dc5
Author: Michael S. Molina <70...@users.noreply.github.com>
AuthorDate: Mon Apr 17 10:48:05 2023 -0300

    chore: Removes deprecated feature flags for 3.0 (#23663)
---
 RESOURCES/FEATURE_FLAGS.md                                     |  3 ---
 UPDATING.md                                                    |  1 +
 .../packages/superset-ui-core/src/components/SafeMarkdown.tsx  |  7 +++----
 .../packages/superset-ui-core/src/utils/featureFlags.ts        |  3 ---
 .../packages/superset-ui-core/test/utils/featureFlag.test.ts   | 10 +++-------
 .../src/features/databases/DatabaseModal/index.tsx             |  5 +----
 superset-frontend/src/utils/hostNamesConfig.js                 |  4 +---
 superset/config.py                                             |  8 --------
 8 files changed, 9 insertions(+), 32 deletions(-)

diff --git a/RESOURCES/FEATURE_FLAGS.md b/RESOURCES/FEATURE_FLAGS.md
index 1143f93a78..6e6bf16e5f 100644
--- a/RESOURCES/FEATURE_FLAGS.md
+++ b/RESOURCES/FEATURE_FLAGS.md
@@ -93,7 +93,4 @@ These features flags currently default to True and **will be removed in a future
 
 [//]: # "PLEASE KEEP THE LIST SORTED ALPHABETICALLY"
 
-- ALLOW_DASHBOARD_DOMAIN_SHARDING
-- DISPLAY_MARKDOWN_HTML
-- FORCE_DATABASE_CONNECTIONS_SSL
 - GENERIC_CHART_AXES
diff --git a/UPDATING.md b/UPDATING.md
index f502c6497e..9afd8d353f 100644
--- a/UPDATING.md
+++ b/UPDATING.md
@@ -49,6 +49,7 @@ assists people when migrating to a new version.
 ### Breaking Changes
 
 - [23651](https://github.com/apache/superset/pull/23651) Removes UX_BETA feature flag.
+- [23663](https://github.com/apache/superset/pull/23663) Removes deprecated feature flags `ALLOW_DASHBOARD_DOMAIN_SHARDING`, `DISPLAY_MARKDOWN_HTML`, and `FORCE_DATABASE_CONNECTIONS_SSL`.
 - [22798](https://github.com/apache/superset/pull/22798): To make the welcome page more relevant in production environments, the last tab on the welcome page has been changed from to feature all charts/dashboards the user has access to (previously only examples were shown). To keep current behavior unchanged, add the following to your `superset_config.py`: `WELCOME_PAGE_LAST_TAB = "examples"`
 - [22328](https://github.com/apache/superset/pull/22328): For deployments that have enabled the "THUMBNAILS" feature flag, the function that calculates dashboard digests has been updated to consider additional properties to more accurately identify changes in the dashboard metadata. This change will invalidate all currently cached dashboard thumbnails.
 - [21765](https://github.com/apache/superset/pull/21765): For deployments that have enabled the "ALERT_REPORTS" feature flag, Gamma users will no longer have read and write access to Alerts & Reports by default. To give Gamma users the ability to schedule reports from the Dashboard and Explore view like before, create an additional role with "can read on ReportSchedule" and "can write on ReportSchedule" permissions. To further give Gamma users access to the "Alerts & Reports" menu and CR [...]
diff --git a/superset-frontend/packages/superset-ui-core/src/components/SafeMarkdown.tsx b/superset-frontend/packages/superset-ui-core/src/components/SafeMarkdown.tsx
index 929db60b0c..b0826ce2ed 100644
--- a/superset-frontend/packages/superset-ui-core/src/components/SafeMarkdown.tsx
+++ b/superset-frontend/packages/superset-ui-core/src/components/SafeMarkdown.tsx
@@ -44,12 +44,11 @@ function SafeMarkdown({
   htmlSanitization = true,
   htmlSchemaOverrides = {},
 }: SafeMarkdownProps) {
-  const displayHtml = isFeatureEnabled(FeatureFlag.DISPLAY_MARKDOWN_HTML);
   const escapeHtml = isFeatureEnabled(FeatureFlag.ESCAPE_MARKDOWN_HTML);
 
   const rehypePlugins = useMemo(() => {
     const rehypePlugins: any = [];
-    if (displayHtml && !escapeHtml) {
+    if (!escapeHtml) {
       rehypePlugins.push(rehypeRaw);
       if (htmlSanitization) {
         const schema = getOverrideHtmlSchema(
@@ -60,14 +59,14 @@ function SafeMarkdown({
       }
     }
     return rehypePlugins;
-  }, [displayHtml, escapeHtml, htmlSanitization, htmlSchemaOverrides]);
+  }, [escapeHtml, htmlSanitization, htmlSchemaOverrides]);
 
   // React Markdown escapes HTML by default
   return (
     <ReactMarkdown
       rehypePlugins={rehypePlugins}
       remarkPlugins={[remarkGfm]}
-      skipHtml={!displayHtml}
+      skipHtml={false}
     >
       {source}
     </ReactMarkdown>
diff --git a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts
index 21e0ec279c..2627a42369 100644
--- a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts
+++ b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts
@@ -22,7 +22,6 @@ export enum FeatureFlag {
   // PLEASE KEEP THE LIST SORTED ALPHABETICALLY
   ALERTS_ATTACH_REPORTS = 'ALERTS_ATTACH_REPORTS',
   ALERT_REPORTS = 'ALERT_REPORTS',
-  ALLOW_DASHBOARD_DOMAIN_SHARDING = 'ALLOW_DASHBOARD_DOMAIN_SHARDING',
   ALLOW_FULL_CSV_EXPORT = 'ALLOW_FULL_CSV_EXPORT',
   CLIENT_CACHE = 'CLIENT_CACHE',
   DASHBOARD_CROSS_FILTERS = 'DASHBOARD_CROSS_FILTERS',
@@ -36,7 +35,6 @@ export enum FeatureFlag {
   DATAPANEL_CLOSED_BY_DEFAULT = 'DATAPANEL_CLOSED_BY_DEFAULT',
   DISABLE_DATASET_SOURCE_EDIT = 'DISABLE_DATASET_SOURCE_EDIT',
   DISABLE_LEGACY_DATASOURCE_EDITOR = 'DISABLE_LEGACY_DATASOURCE_EDITOR',
-  DISPLAY_MARKDOWN_HTML = 'DISPLAY_MARKDOWN_HTML',
   DRILL_TO_DETAIL = 'DRILL_TO_DETAIL',
   DRILL_BY = 'DRILL_BY',
   DYNAMIC_PLUGINS = 'DYNAMIC_PLUGINS',
@@ -50,7 +48,6 @@ export enum FeatureFlag {
   ENABLE_TEMPLATE_REMOVE_FILTERS = 'ENABLE_TEMPLATE_REMOVE_FILTERS',
   ESCAPE_MARKDOWN_HTML = 'ESCAPE_MARKDOWN_HTML',
   ESTIMATE_QUERY_COST = 'ESTIMATE_QUERY_COST',
-  FORCE_DATABASE_CONNECTIONS_SSL = 'FORCE_DATABASE_CONNECTIONS_SSL',
   GENERIC_CHART_AXES = 'GENERIC_CHART_AXES',
   GLOBAL_ASYNC_QUERIES = 'GLOBAL_ASYNC_QUERIES',
   HORIZONTAL_FILTER_BAR = 'HORIZONTAL_FILTER_BAR',
diff --git a/superset-frontend/packages/superset-ui-core/test/utils/featureFlag.test.ts b/superset-frontend/packages/superset-ui-core/test/utils/featureFlag.test.ts
index 66c58e79af..ef6e0c3729 100644
--- a/superset-frontend/packages/superset-ui-core/test/utils/featureFlag.test.ts
+++ b/superset-frontend/packages/superset-ui-core/test/utils/featureFlag.test.ts
@@ -25,13 +25,11 @@ it('returns false and raises console error if feature flags have not been initia
     value: undefined,
   });
 
-  expect(isFeatureEnabled(FeatureFlag.ALLOW_DASHBOARD_DOMAIN_SHARDING)).toEqual(
-    false,
-  );
+  expect(isFeatureEnabled(FeatureFlag.DRILL_BY)).toEqual(false);
   expect(console.error).toHaveBeenCalled();
   // @ts-expect-error
   expect(console.error.mock.calls[0][0]).toEqual(
-    'Failed to query feature flag ALLOW_DASHBOARD_DOMAIN_SHARDING',
+    'Failed to query feature flag DRILL_BY',
   );
 });
 
@@ -40,9 +38,7 @@ it('returns false for unset feature flag', () => {
     value: {},
   });
 
-  expect(isFeatureEnabled(FeatureFlag.ALLOW_DASHBOARD_DOMAIN_SHARDING)).toEqual(
-    false,
-  );
+  expect(isFeatureEnabled(FeatureFlag.DRILL_BY)).toEqual(false);
 });
 
 it('returns true for set feature flag', () => {
diff --git a/superset-frontend/src/features/databases/DatabaseModal/index.tsx b/superset-frontend/src/features/databases/DatabaseModal/index.tsx
index a14a851b60..4a80612369 100644
--- a/superset-frontend/src/features/databases/DatabaseModal/index.tsx
+++ b/superset-frontend/src/features/databases/DatabaseModal/index.tsx
@@ -588,9 +588,6 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
   const dbImages = getDatabaseImages();
   const connectionAlert = getConnectionAlert();
   const isEditMode = !!databaseId;
-  const sslForced = isFeatureEnabled(
-    FeatureFlag.FORCE_DATABASE_CONNECTIONS_SSL,
-  );
   const disableSSHTunnelingForEngine = (
     availableDbs?.databases?.find(
       (DB: DatabaseObject) =>
@@ -1537,7 +1534,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
       <DatabaseConnectionForm
         isEditMode={isEditMode}
         db={db as DatabaseObject}
-        sslForced={sslForced}
+        sslForced={false}
         dbModel={dbModel}
         onAddTableCatalog={() => {
           setDB({ type: ActionType.addTableCatalogSheet });
diff --git a/superset-frontend/src/utils/hostNamesConfig.js b/superset-frontend/src/utils/hostNamesConfig.js
index eabc3b64ee..dfbf9b26c9 100644
--- a/superset-frontend/src/utils/hostNamesConfig.js
+++ b/superset-frontend/src/utils/hostNamesConfig.js
@@ -16,8 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import { FeatureFlag } from '@superset-ui/core';
-import { initFeatureFlags, isFeatureEnabled } from 'src/featureFlags';
+import { initFeatureFlags } from 'src/featureFlags';
 import getBootstrapData from './getBootstrapData';
 
 function getDomainsConfig() {
@@ -43,7 +42,6 @@ function getDomainsConfig() {
   initFeatureFlags(bootstrapData.common.feature_flags);
 
   if (
-    isFeatureEnabled(FeatureFlag.ALLOW_DASHBOARD_DOMAIN_SHARDING) &&
     bootstrapData &&
     bootstrapData.common &&
     bootstrapData.common.conf &&
diff --git a/superset/config.py b/superset/config.py
index 04e6b48b44..8baf177ba5 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -386,10 +386,6 @@ LANGUAGES = {}
 # and FEATURE_FLAGS = { 'BAR': True, 'BAZ': True } in superset_config.py
 # will result in combined feature flags of { 'FOO': True, 'BAR': True, 'BAZ': True }
 DEFAULT_FEATURE_FLAGS: Dict[str, bool] = {
-    # allow dashboard to use sub-domains to send chart request
-    # you also need ENABLE_CORS and
-    # SUPERSET_WEBSERVER_DOMAINS for list of domains
-    "ALLOW_DASHBOARD_DOMAIN_SHARDING": True,
     # Experimental feature introducing a client (browser) cache
     "CLIENT_CACHE": False,
     "DISABLE_DATASET_SOURCE_EDIT": False,
@@ -428,8 +424,6 @@ DEFAULT_FEATURE_FLAGS: Dict[str, bool] = {
     "TAGGING_SYSTEM": False,
     "SQLLAB_BACKEND_PERSISTENCE": True,
     "LISTVIEWS_DEFAULT_CARD_VIEW": False,
-    # When True, this flag allows display of HTML tags in Markdown components
-    "DISPLAY_MARKDOWN_HTML": True,
     # When True, this escapes HTML (rather than rendering it) in Markdown components
     "ESCAPE_MARKDOWN_HTML": False,
     "DASHBOARD_NATIVE_FILTERS": True,
@@ -454,8 +448,6 @@ DEFAULT_FEATURE_FLAGS: Dict[str, bool] = {
     # for report with type 'report' still send with email and slack message with
     # screenshot and link
     "ALERTS_ATTACH_REPORTS": True,
-    # FORCE_DATABASE_CONNECTIONS_SSL is depreciated.
-    "FORCE_DATABASE_CONNECTIONS_SSL": False,
     # Allow users to export full CSV of table viz type.
     # This could cause the server to run out of memory or compute.
     "ALLOW_FULL_CSV_EXPORT": False,