fix(subdirectory): unblock CI after Superset.route_base="" collisions

Three CI failures rooted in the route_base="" migration:

* Backend `test_explore_redirect`: `Superset.explore` and `ExploreView.root`
  both register at `/explore/`; ExploreView wins, leaving the form_data →
  form_data_key cache-and-redirect contract dead. Move that early-return
  into `ExploreView.root` (delegates to `Superset.get_redirect_url()`).
* Cypress `actions.test.js` / `editmode.test.ts`: `cypress/utils/urls.ts`
  still hardcoded `/superset/dashboard/...` for 4 dashboard constants;
  drop the prefix.
* Playwright `auth/login.spec.ts`: `playwright/utils/urls.ts` `WELCOME`
  was `'superset/welcome/'`; login redirects to `/welcome/` now.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joe Li
2026-05-14 20:23:07 -07:00
parent 47d3425064
commit d8335c0e1b
3 changed files with 14 additions and 6 deletions

View File

@@ -19,9 +19,8 @@
export const DASHBOARD_LIST = '/dashboard/list/';
export const CHART_LIST = '/chart/list/';
export const WORLD_HEALTH_DASHBOARD = '/superset/dashboard/world_health/';
export const SAMPLE_DASHBOARD_1 = '/superset/dashboard/1-sample-dashboard/';
export const SUPPORTED_CHARTS_DASHBOARD =
'/superset/dashboard/supported_charts_dash/';
export const TABBED_DASHBOARD = '/superset/dashboard/tabbed_dash/';
export const WORLD_HEALTH_DASHBOARD = '/dashboard/world_health/';
export const SAMPLE_DASHBOARD_1 = '/dashboard/1-sample-dashboard/';
export const SUPPORTED_CHARTS_DASHBOARD = '/dashboard/supported_charts_dash/';
export const TABBED_DASHBOARD = '/dashboard/tabbed_dash/';
export const DATABASE_LIST = '/databaseview/list';

View File

@@ -35,5 +35,5 @@ export const URL = {
LOGIN: 'login/',
SAVED_QUERIES_LIST: 'savedqueryview/list/',
SQLLAB: 'sqllab',
WELCOME: 'superset/welcome/',
WELCOME: 'welcome/',
} as const;

View File

@@ -14,6 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from flask import redirect, request
from flask_appbuilder import permission_name
from flask_appbuilder.api import expose
from flask_appbuilder.security.decorators import has_access
@@ -33,6 +34,14 @@ class ExploreView(BaseSupersetView):
@permission_name("read")
@event_logger.log_this
def root(self) -> FlaskResponse:
# After `Superset.route_base = ""`, both `Superset.explore` and this
# view register at `/explore/`; this view wins. Preserve the legacy
# form_data → form_data_key cache-and-redirect contract here so
# callers passing `?form_data=...` still get the short cache-key URL.
if request.args.get("form_data"):
from superset.views.core import Superset # avoid circular import
return redirect(Superset.get_redirect_url())
return super().render_app_template()