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

yousoph 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 033b7bc385e fix(databases): update broken database documentation links 
to /user-docs namespace (#41557)
033b7bc385e is described below

commit 033b7bc385ec78e7c9a37085da423fafb206f877
Author: yousoph <[email protected]>
AuthorDate: Mon Jul 6 13:02:02 2026 -0700

    fix(databases): update broken database documentation links to /user-docs 
namespace (#41557)
    
    Co-authored-by: Claude Opus 4.8 <[email protected]>
    Co-authored-by: Đỗ Trọng Hải <[email protected]>
    Co-authored-by: Evan Rusackas <[email protected]>
---
 .../src/components/ImportModal/ErrorAlert.tsx      |  2 +-
 .../components/ImportModal/ImportErrorAlert.tsx    |  2 +-
 .../databases/DatabaseModal/ModalHeader.test.tsx   | 58 ++++++++++++++++++++++
 .../databases/DatabaseModal/ModalHeader.tsx        | 21 +++++++-
 .../datasets/AddDataset/Footer/Footer.test.tsx     |  2 +-
 5 files changed, 80 insertions(+), 5 deletions(-)

diff --git a/superset-frontend/src/components/ImportModal/ErrorAlert.tsx 
b/superset-frontend/src/components/ImportModal/ErrorAlert.tsx
index 24551678c38..e43f7f761d1 100644
--- a/superset-frontend/src/components/ImportModal/ErrorAlert.tsx
+++ b/superset-frontend/src/components/ImportModal/ErrorAlert.tsx
@@ -28,7 +28,7 @@ import { antdWarningAlertStyles } from './styles';
 const supersetTextDocs = getDatabaseDocumentationLinks();
 export const DOCUMENTATION_LINK = supersetTextDocs
   ? supersetTextDocs.support
-  : 'https://superset.apache.org/docs/databases/installing-database-drivers';
+  : 
'https://superset.apache.org/user-docs/databases/#installing-database-drivers';
 
 export interface IProps {
   errorMessage: string;
diff --git a/superset-frontend/src/components/ImportModal/ImportErrorAlert.tsx 
b/superset-frontend/src/components/ImportModal/ImportErrorAlert.tsx
index 30c360f3c77..826f7ee5fd0 100644
--- a/superset-frontend/src/components/ImportModal/ImportErrorAlert.tsx
+++ b/superset-frontend/src/components/ImportModal/ImportErrorAlert.tsx
@@ -26,7 +26,7 @@ import { ErrorAlert } from 'src/components';
 const supersetTextDocs = getDatabaseDocumentationLinks();
 export const DOCUMENTATION_LINK = supersetTextDocs
   ? supersetTextDocs.support
-  : 'https://superset.apache.org/docs/databases/installing-database-drivers';
+  : 
'https://superset.apache.org/user-docs/databases/#installing-database-drivers';
 
 export interface IProps {
   errorMessage: string;
diff --git 
a/superset-frontend/src/features/databases/DatabaseModal/ModalHeader.test.tsx 
b/superset-frontend/src/features/databases/DatabaseModal/ModalHeader.test.tsx
new file mode 100644
index 00000000000..ee5589bb04a
--- /dev/null
+++ 
b/superset-frontend/src/features/databases/DatabaseModal/ModalHeader.test.tsx
@@ -0,0 +1,58 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { render, screen } from 'spec/helpers/testing-library';
+import ModalHeader from './ModalHeader';
+import type { DatabaseForm, DatabaseObject } from '../types';
+
+// Force the production fallback branches (no SupersetText override) so the
+// generated /user-docs documentation links are exercised.
+jest.mock('src/views/CRUD/hooks', () => ({
+  getDatabaseDocumentationLinks: () => undefined,
+}));
+
+const buildProps = (engine: string) => ({
+  isLoading: false,
+  isEditMode: false,
+  useSqlAlchemyForm: false,
+  hasConnectedDb: false,
+  db: { engine } as Partial<DatabaseObject>,
+  dbName: 'my db',
+  dbModel: { name: engine, engine } as DatabaseForm,
+});
+
+const getDocHref = (engine: string) => {
+  render(<ModalHeader {...buildProps(engine)} />, { useRedux: true });
+  return screen.getByRole('link').getAttribute('href');
+};
+
+test('uses the generic /user-docs link when the engine name matches the doc 
slug', () => {
+  expect(getDocHref('postgresql')).toBe(
+    'https://superset.apache.org/user-docs/databases/supported/postgresql',
+  );
+});
+
+test('maps divergent engine names to their /user-docs doc slugs', () => {
+  expect(getDocHref('bigquery')).toBe(
+    
'https://superset.apache.org/user-docs/databases/supported/google-bigquery',
+  );
+});
+
+test('does not link to the legacy /docs/databases namespace', () => {
+  expect(getDocHref('mysql')).not.toContain('/docs/databases/');
+});
diff --git 
a/superset-frontend/src/features/databases/DatabaseModal/ModalHeader.tsx 
b/superset-frontend/src/features/databases/DatabaseModal/ModalHeader.tsx
index 733514c37d0..7dffb983cc5 100644
--- a/superset-frontend/src/features/databases/DatabaseModal/ModalHeader.tsx
+++ b/superset-frontend/src/features/databases/DatabaseModal/ModalHeader.tsx
@@ -35,12 +35,29 @@ export const DOCUMENTATION_LINK = supersetTextDocs
   ? supersetTextDocs.support
   : 
'https://superset.apache.org/user-docs/databases/#installing-database-drivers';
 
+// Engine identifiers (SQLAlchemy backend names) whose value differs from the
+// human-readable slug under /user-docs/databases/supported/. Engines whose 
slug
+// equals the engine name are handled by the generic link below.
 const irregularDocumentationLinks = {
-  postgresql: 'https://superset.apache.org',
   mssql:
     
'https://superset.apache.org/user-docs/databases/supported/microsoft-sql-server',
   gsheets:
     'https://superset.apache.org/user-docs/databases/supported/google-sheets',
+  bigquery:
+    
'https://superset.apache.org/user-docs/databases/supported/google-bigquery',
+  awsathena:
+    'https://superset.apache.org/user-docs/databases/supported/amazon-athena',
+  redshift:
+    
'https://superset.apache.org/user-docs/databases/supported/amazon-redshift',
+  druid:
+    'https://superset.apache.org/user-docs/databases/supported/apache-druid',
+  hive: 
'https://superset.apache.org/user-docs/databases/supported/apache-hive',
+  spark:
+    
'https://superset.apache.org/user-docs/databases/supported/apache-spark-sql',
+  db2: 'https://superset.apache.org/user-docs/databases/supported/ibm-db2',
+  hana: 'https://superset.apache.org/user-docs/databases/supported/sap-hana',
+  clickhousedb:
+    'https://superset.apache.org/user-docs/databases/supported/clickhouse',
 };
 
 const documentationLink = (engine: string | undefined) => {
@@ -56,7 +73,7 @@ const documentationLink = (engine: string | undefined) => {
       engine as keyof typeof irregularDocumentationLinks
     ]
   ) {
-    return `https://superset.apache.org/docs/databases/${engine}`;
+    return 
`https://superset.apache.org/user-docs/databases/supported/${engine}`;
   }
   return irregularDocumentationLinks[
     engine as keyof typeof irregularDocumentationLinks
diff --git 
a/superset-frontend/src/features/datasets/AddDataset/Footer/Footer.test.tsx 
b/superset-frontend/src/features/datasets/AddDataset/Footer/Footer.test.tsx
index b0714fc90c5..e671fb6a986 100644
--- a/superset-frontend/src/features/datasets/AddDataset/Footer/Footer.test.tsx
+++ b/superset-frontend/src/features/datasets/AddDataset/Footer/Footer.test.tsx
@@ -41,7 +41,7 @@ jest.mock('src/views/CRUD/hooks', () => ({
   }),
   getDatabaseDocumentationLinks: () => ({
     support:
-      'https://superset.apache.org/docs/databases/installing-database-drivers',
+      
'https://superset.apache.org/user-docs/databases/#installing-database-drivers',
   }),
 }));
 

Reply via email to