Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Removes deprecated feature flags for 3.0 #23663

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions RESOURCES/FEATURE_FLAGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 CRUD view, add "menu access on Manage" and "menu access on Alerts & Report" permissions to the role.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
);
});

Expand All @@ -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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down Expand Up @@ -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 });
Expand Down
4 changes: 1 addition & 3 deletions superset-frontend/src/utils/hostNamesConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -43,7 +42,6 @@ function getDomainsConfig() {
initFeatureFlags(bootstrapData.common.feature_flags);

if (
isFeatureEnabled(FeatureFlag.ALLOW_DASHBOARD_DOMAIN_SHARDING) &&
bootstrapData &&
bootstrapData.common &&
bootstrapData.common.conf &&
Expand Down
8 changes: 0 additions & 8 deletions superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,6 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
# 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,
Expand Down Expand Up @@ -428,8 +424,6 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
"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,
Expand All @@ -454,8 +448,6 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
# 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,
Expand Down