Skip to content

fix: add subdirectory deployment support for brandSpinnerUrl#37523

Merged
sadpandajoe merged 21 commits into
apache:masterfrom
innovark37:innovark/fix/fix-brand-spinner-url
Jul 13, 2026
Merged

fix: add subdirectory deployment support for brandSpinnerUrl#37523
sadpandajoe merged 21 commits into
apache:masterfrom
innovark37:innovark/fix/fix-brand-spinner-url

Conversation

@innovark37

@innovark37 innovark37 commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

SUMMARY

This PR fixes theme token handling for subdirectory deployments by ensuring brandSpinnerUrl is prefixed with the configured static assets prefix before it is used by the initial SPA template and frontend bootstrap payload.

Problem

When Superset is deployed under a subdirectory, for example /superset/ or /analytics/, a root-relative loading spinner image URL such as /static/assets/images/loading.gif could break because brandSpinnerUrl was used without the static assets prefix. This caused 404 errors for the spinner image in non-root deployments.

Root Cause

brandLogoUrl and APP_ICON paths are normalized on the frontend with ensureStaticPrefix, but brandSpinnerUrl is also used by spa.html before React mounts. Because the initial template rendered brandSpinnerUrl directly, frontend-only URL normalization did not cover the first loading spinner render.

Solution

Normalize brandSpinnerUrl while building the SPA template context. Root-relative spinner URLs are prefixed with STATIC_ASSETS_PREFIX, while absolute URLs are left unchanged. The normalized value is written back into the theme data used by both spa.html and the frontend bootstrap payload, keeping the initial spinner and React spinner behavior consistent.

TESTING INSTRUCTIONS

  1. Create test theme configuration:
THEME_DEFAULT = {
    "token": {
        "brandSpinnerUrl": "/static/assets/images/loading.gif",
    },
    "algorithm": "default",
}
  1. Start Superset with a subdirectory deployment:
SUPERSET_APP_ROOT=/analytics
  1. Verify the loading spinner appears and is requested from:
/analytics/static/assets/images/loading.gif

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@bito-code-review

bito-code-review Bot commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #f98b39

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: aa970ee..aa970ee
    • superset/app.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot Bot added the global:theming Related to theming Superset label Jan 28, 2026
@codecov

codecov Bot commented Jan 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 18.18182% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.60%. Comparing base (3c69822) to head (4f82cbb).

Files with missing lines Patch % Lines
superset/views/base.py 18.18% 8 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #37523      +/-   ##
==========================================
+ Coverage   56.13%   64.60%   +8.47%     
==========================================
  Files        2742     2735       -7     
  Lines      153422   152097    -1325     
  Branches    35198    34622     -576     
==========================================
+ Hits        86116    98262   +12146     
+ Misses      66480    51927   -14553     
- Partials      826     1908    +1082     
Flag Coverage Δ
hive 39.06% <18.18%> (?)
mysql 57.96% <18.18%> (?)
postgres 58.01% <18.18%> (?)
presto 41.06% <18.18%> (-0.01%) ⬇️
python 59.40% <18.18%> (+18.33%) ⬆️
sqlite 57.62% <18.18%> (?)
unit 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends subdirectory deployment support so that the theme token brandSpinnerUrl is treated consistently with brandLogoUrl and APP_ICON, preventing broken spinner images when Superset runs under a non-root path.

Changes:

  • In create_app, when SUPERSET_APP_ROOT (or superset_app_root) is set and APP_ICON is a /static/ path, update the theme tokens to also prefix brandSpinnerUrl with the application root when it points to /static/.

Comment thread superset/app.py Outdated
Comment thread superset/app.py Outdated
Comment thread superset/app.py Outdated
Comment thread superset/app.py Outdated
@netlify

netlify Bot commented Jan 29, 2026

Copy link
Copy Markdown

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 0b3c875
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/698052cbf98a87000809c1e7
😎 Deploy Preview https://deploy-preview-37523--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@bito-code-review

bito-code-review Bot commented Jan 29, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #9957a2

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: aa970ee..b6091ee
    • superset/app.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@pull-request-size pull-request-size Bot added size/L and removed size/M labels Feb 2, 2026
Comment thread superset/app.py Outdated
@codeant-ai-for-open-source codeant-ai-for-open-source Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Mar 11, 2026
@innovark37

Copy link
Copy Markdown
Contributor Author

@sadpandajoe
Hi! This PR is still open and I'd love to move it forward. If there are any concerns or changes needed, please let me know and I'll be happy to address them. Thanks for your time!

@bito-code-review bito-code-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Agent Run #d561e6

Actionable Suggestions - 1
Review Details
  • Files reviewed - 1 · Commit Range: 0b3c875..9001f85
    • superset/app.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Comment thread superset/app.py Outdated
@bito-code-review

bito-code-review Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #64ae25

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 9001f85..0559dd1
    • superset/app.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@bito-code-review

bito-code-review Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #0774e8

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 0559dd1..05c4893
    • superset/views/base.py
    • tests/unit_tests/views/test_base_theme_helpers.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@apache apache deleted a comment from codeant-ai-for-open-source Bot Jul 1, 2026
@apache apache deleted a comment from bito-code-review Bot Jul 1, 2026
Comment thread superset/views/base.py Outdated
Comment thread tests/unit_tests/views/test_base_theme_helpers.py
Comment thread tests/unit_tests/views/test_base_theme_helpers.py
Comment thread tests/unit_tests/views/test_base_theme_helpers.py
Comment thread tests/unit_tests/views/test_base_theme_helpers.py
@bito-code-review

bito-code-review Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #9fc45f

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 05c4893..765cb1c
    • superset/views/base.py
    • tests/unit_tests/views/test_base_theme_helpers.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@sadpandajoe
sadpandajoe merged commit d4a31d1 into apache:master Jul 13, 2026
59 checks passed
@innovark37
innovark37 deleted the innovark/fix/fix-brand-spinner-url branch July 14, 2026 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

global:theming Related to theming Superset size/L size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants