You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "bikash-barnwal (via GitHub)" <gi...@apache.org> on 2026/08/14 15:14:51 UTC

[PR] fix(app-root): serve unprefixed /static/ paths under a non-root app root [superset]

bikash-barnwal opened a new pull request, #43169:
URL: https://github.com/apache/superset/pull/43169

   ### SUMMARY
   
   `AppRootMiddleware.__call__` returned `NotFound()` for any request whose `PATH_INFO` did not start with the configured app root. Webpack compiles the frontend with `/static/assets/` as its `publicPath`, which is baked into the bundle at build time, so lazily loaded chunks and the assets they reference are requested **without** the app-root prefix. Under `SUPERSET_APP_ROOT=/analytics` those requests were rejected with a 404, so the logo, CSS and JS chunks failed to load.
   
   `STATIC_ASSETS_PREFIX` defaults to the app root, which covers the URLs Superset generates server-side, but it cannot affect paths webpack already hard-coded into the bundle.
   
   This adds a passthrough branch for unprefixed `/static/` paths. `PATH_INFO` and `SCRIPT_NAME` are deliberately left untouched there, because the static route is registered at `/static/...` on the unprefixed app. The app-root branch is still checked first, so `/analytics/static/assets/...` continues to be stripped and remounted as before. Paths that merely contain `/static/` further along (`/other/static/assets/main.js`) or that only share a string prefix with the app root (`/analyticsfoo/...`) still 404.
   
   Scope note: only static assets are reachable through the new branch, and they are already served publicly at the prefixed path — no application route becomes reachable without the prefix.
   
   Also documents that a reverse proxy fronting a prefixed deployment has to forward `/static` in addition to the prefix, which is the configuration in the issue's reproduction.
   
   Fixes #39429
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A — no visual change beyond assets loading instead of 404ing.
   
   ### TESTING INSTRUCTIONS
   
   Automated:
   
   ```bash
   pytest tests/unit_tests/middleware/test_app_root_middleware.py
   ```
   
   The new test module pins all three behaviors of the middleware: prefix stripping, `/static/` passthrough, and 404 for everything else.
   
   Manual:
   
   1. Start Superset with `SUPERSET_APP_ROOT=/analytics`.
   2. Request `http://localhost:8088/static/assets/images/superset-logo-horiz.png` — 200 on this branch, 404 on `master`.
   3. Request `http://localhost:8088/analytics/static/assets/images/superset-logo-horiz.png` — still 200 (unchanged).
   4. Request `http://localhost:8088/dashboard/list/` — still 404 (unchanged).
   5. Load `http://localhost:8088/analytics` and confirm no `/static/assets/*` 404s in the browser network tab.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: #39429
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] 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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(app-root): serve unprefixed /static/ paths under a non-root app root [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #43169:
URL: https://github.com/apache/superset/pull/43169#issuecomment-5297160421

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/43169?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `0%` with `2 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 65.90%. Comparing base ([`c068a8c`](https://app.codecov.io/gh/apache/superset/commit/c068a8c09cf355e7fe493a7867bf33644d34ea39?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`a06f7fd`](https://app.codecov.io/gh/apache/superset/commit/a06f7fd13507bdc8a92015839cc3fafe70d3020d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 1 commits behind head on master.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/43169?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [superset/app.py](https://app.codecov.io/gh/apache/superset/pull/43169?src=pr&el=tree&filepath=superset%2Fapp.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvYXBwLnB5) | 0.00% | [1 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/superset/pull/43169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #43169      +/-   ##
   ==========================================
   - Coverage   66.68%   65.90%   -0.78%     
   ==========================================
     Files        2872     2872              
     Lines      163447   163449       +2     
     Branches    37727    37728       +1     
   ==========================================
   - Hits       108988   107721    -1267     
   - Misses      52327    53601    +1274     
   + Partials     2132     2127       -5     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/43169/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hive](https://app.codecov.io/gh/apache/superset/pull/43169/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `38.21% <0.00%> (-0.01%)` | :arrow_down: |
   | [postgres](https://app.codecov.io/gh/apache/superset/pull/43169/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [presto](https://app.codecov.io/gh/apache/superset/pull/43169/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `40.16% <0.00%> (-0.01%)` | :arrow_down: |
   | [python](https://app.codecov.io/gh/apache/superset/pull/43169/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `57.73% <0.00%> (-1.58%)` | :arrow_down: |
   | [sqlite](https://app.codecov.io/gh/apache/superset/pull/43169/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `57.59% <0.00%> (-0.01%)` | :arrow_down: |
   | [unit](https://app.codecov.io/gh/apache/superset/pull/43169/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/43169?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(app-root): serve unprefixed /static/ paths under a non-root app root [superset]

Posted by "bikash-barnwal (via GitHub)" <gi...@apache.org>.
bikash-barnwal commented on PR #43169:
URL: https://github.com/apache/superset/pull/43169#issuecomment-5550337624

   Good catch, fixed — the docker/nginx dev template's `/static` location only matched `${SUPERSET_APP_ROOT}/static`, so under a subpath app root the Flask-side fix here was never actually reached for unprefixed requests (and the default app root of `/` made that location string a double-slash that matched nothing at all). Replaced it with one regex location that matches both the app-root-prefixed and the bare `/static/` path. Verified by rendering the template with `envsubst` and running `nginx -t` for both an app root of `/` and `/analytics`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(app-root): serve unprefixed /static/ paths under a non-root app root [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #43169:
URL: https://github.com/apache/superset/pull/43169#issuecomment-5296796190

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **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 <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(app-root): serve unprefixed /static/ paths under a non-root app root [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #43169:
URL: https://github.com/apache/superset/pull/43169#issuecomment-5294954168

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(app-root): serve unprefixed /static/ paths under a non-root app root [superset]

Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on code in PR #43169:
URL: https://github.com/apache/superset/pull/43169#discussion_r3870873687


##########
superset/app.py:
##########
@@ -242,4 +242,12 @@ def __call__(
             environ["PATH_INFO"] = original_path_info[len(self.app_root) :]
             environ["SCRIPT_NAME"] = self.app_root
             return self.wsgi_app(environ, start_response)
+        if original_path_info == "/static" or original_path_info.startswith("/static/"):

Review Comment:
   With `SUPERSET_APP_ROOT=/static`, `/static/assets/...` matches the app-root branch above this one first, which strips `/static` and sends `/assets/...` to Flask; the static route then still 404s and this passthrough is unreachable. Since the documented prefix contract only requires a leading slash, should `/static` be rejected as a reserved app root or handled before the prefix rewrite?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(app-root): serve unprefixed /static/ paths under a non-root app root [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #43169:
URL: https://github.com/apache/superset/pull/43169#issuecomment-5612052069

   @bikash-barnwal nice catch on nginx, that thread looks resolved with the latest commit.
   
   One thing still open: sadpandajoe's question about `SUPERSET_APP_ROOT=/static`. The prefix branch runs first, so that config would swallow the static passthrough and still 404. Worth rejecting `/static` as a reserved app root, or reordering the checks?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(app-root): serve unprefixed /static/ paths under a non-root app root [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #43169:
URL: https://github.com/apache/superset/pull/43169#discussion_r3819080675


##########
superset/app.py:
##########
@@ -242,4 +242,12 @@ def __call__(
             environ["PATH_INFO"] = original_path_info[len(self.app_root) :]
             environ["SCRIPT_NAME"] = self.app_root
             return self.wsgi_app(environ, start_response)
+        if original_path_info == "/static" or original_path_info.startswith("/static/"):
+            # Webpack bakes `/static/assets/` into the bundle as its publicPath,
+            # so lazily loaded chunks and the assets they reference are always
+            # requested without the app-root prefix. Serve those unprefixed
+            # paths as-is instead of 404ing them; the app root is left off
+            # PATH_INFO and SCRIPT_NAME because the static route is registered
+            # at `/static/...` on the unprefixed app.
+            return self.wsgi_app(environ, start_response)

Review Comment:
   Yes. The middleware change only helps if `/static/...` reaches WSGI; in the bundled nginx deployment, nginx currently handles that request first and returns 404.
   
   Add a root-level static location alongside the prefixed one, forwarding it to Superset without rewriting the path, for example:
   
   ```nginx
   location /static/ {
       proxy_pass http://superset_app/static/;
       proxy_set_header Host $host;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
   }
   ```
   
   The exact upstream and shared proxy settings should match the existing `${SUPERSET_APP_ROOT}/static` location. Keep the middleware branch as well, since non-nginx deployments may route `/static` directly to WSGI. This ensures both `/analytics/static/...` and webpack’s unprefixed `/static/...` requests work.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(app-root): serve unprefixed /static/ paths under a non-root app root [superset]

Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #43169:
URL: https://github.com/apache/superset/pull/43169#issuecomment-5294973942

   ### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">🔨</span> Latest commit | 8ed7b4ffd428c6afd264f8abade8570569c7117d |
   |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a7f30ec3139780008be794f |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-43169--superset-docs-preview.netlify.app](https://deploy-preview-43169--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTQzMTY5LS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.HND8B1ztr9lwSWvXMDde6dleeTQMExOzZuaz9vUJALY)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   |<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DcpBDkAwEADAv-xZo1JR_MAzVrUqwW7alRDxd73NYV7gRAcLjAAVzAlPF4vDdtfIrBKRqCwom1OMOUtMdK2x1MXzTs-0lNyhDUZ7Zxoz2F5r3c_eDm2A7wc) |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-43169--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(app-root): serve unprefixed /static/ paths under a non-root app root [superset]

Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on code in PR #43169:
URL: https://github.com/apache/superset/pull/43169#discussion_r3819078249


##########
superset/app.py:
##########
@@ -242,4 +242,12 @@ def __call__(
             environ["PATH_INFO"] = original_path_info[len(self.app_root) :]
             environ["SCRIPT_NAME"] = self.app_root
             return self.wsgi_app(environ, start_response)
+        if original_path_info == "/static" or original_path_info.startswith("/static/"):
+            # Webpack bakes `/static/assets/` into the bundle as its publicPath,
+            # so lazily loaded chunks and the assets they reference are always
+            # requested without the app-root prefix. Serve those unprefixed
+            # paths as-is instead of 404ing them; the app root is left off
+            # PATH_INFO and SCRIPT_NAME because the static route is registered
+            # at `/static/...` on the unprefixed app.
+            return self.wsgi_app(environ, start_response)

Review Comment:
   Agreed—the bundled nginx configuration never forwards root-level `/static` requests, so app-root deployments still 404 lazy chunks after this change. Should the proxy configuration forward `/static` too?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(app-root): serve unprefixed /static/ paths under a non-root app root [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #43169:
URL: https://github.com/apache/superset/pull/43169#issuecomment-5294997616

   <!-- Bito Reply -->
   The flagged issue is correct. The middleware change in `superset/app.py` ensures that requests to `/static/...` are passed to the WSGI application, but if the reverse proxy (e.g., nginx) does not forward these requests to the application, they will still result in a 404 error before reaching the middleware.
   
   To resolve this, you must update your nginx configuration to ensure that requests to `/static` are proxied to the Superset application, similar to how the application root is proxied. For example, add a location block for `/static` in your nginx configuration:
   
   ```nginx
   location /static/ {
       proxy_pass http://localhost:8088/static/;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
   }
   ```
   
   This ensures that static assets are correctly routed to the application even when an application root prefix is configured.
   
   **superset/app.py**
   ```
   if original_path_info == "/static" or original_path_info.startswith("/static/"):
               # Webpack bakes `/static/assets/` into the bundle as its publicPath,
               # so lazily loaded chunks and the assets they reference are always
               # requested without the app-root prefix. Serve those unprefixed
               # paths as-is instead of 404ing them; the app root is left off
               # PATH_INFO and SCRIPT_NAME because the static route is registered
               # at `/static/...` on the unprefixed app.
               return self.wsgi_app(environ, start_response)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(app-root): serve unprefixed /static/ paths under a non-root app root [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #43169:
URL: https://github.com/apache/superset/pull/43169#issuecomment-5298448078

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **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 <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(app-root): serve unprefixed /static/ paths under a non-root app root [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #43169:
URL: https://github.com/apache/superset/pull/43169#discussion_r3785007524


##########
superset/app.py:
##########
@@ -242,4 +242,12 @@ def __call__(
             environ["PATH_INFO"] = original_path_info[len(self.app_root) :]
             environ["SCRIPT_NAME"] = self.app_root
             return self.wsgi_app(environ, start_response)
+        if original_path_info == "/static" or original_path_info.startswith("/static/"):
+            # Webpack bakes `/static/assets/` into the bundle as its publicPath,
+            # so lazily loaded chunks and the assets they reference are always
+            # requested without the app-root prefix. Serve those unprefixed
+            # paths as-is instead of 404ing them; the app root is left off
+            # PATH_INFO and SCRIPT_NAME because the static route is registered
+            # at `/static/...` on the unprefixed app.
+            return self.wsgi_app(environ, start_response)

Review Comment:
   **Suggestion:** The new branch only helps when `/static/...` reaches this WSGI application, but the bundled nginx configuration has no root-level `/static` location: it proxies only `${SUPERSET_APP_ROOT}/static` and `${SUPERSET_APP_ROOT}`. With the documented Docker/nginx deployment and `SUPERSET_APP_ROOT=/analytics`, webpack's unprefixed requests are handled by nginx instead of reaching this branch and still fail before Superset can serve them. Add a root-level static proxy in the supplied nginx configuration or otherwise ensure that deployment forwards `/static` to the application. [api mismatch]
   
   <details>
   <summary><b>Severity Level:</b> Critical 🚨</summary>
   
   ```mdx
   - ❌ Bundled nginx deployments still return 404 for unprefixed static assets.
   - ❌ CSS and lazy-loaded JavaScript fail under non-root app roots.
   - ⚠️ The middleware fix works only when `/static` reaches WSGI.
   ```
   </details>
   
   [![Fix in Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=ac1f459fa0ba4a69b6afaceb5854d688&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [![Fix in VSCode Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=ac1f459fa0ba4a69b6afaceb5854d688&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset/app.py
   **Line:** 245:252
   **Comment:**
   	*Api Mismatch: The new branch only helps when `/static/...` reaches this WSGI application, but the bundled nginx configuration has no root-level `/static` location: it proxies only `${SUPERSET_APP_ROOT}/static` and `${SUPERSET_APP_ROOT}`. With the documented Docker/nginx deployment and `SUPERSET_APP_ROOT=/analytics`, webpack's unprefixed requests are handled by nginx instead of reaching this branch and still fail before Superset can serve them. Add a root-level static proxy in the supplied nginx configuration or otherwise ensure that deployment forwards `/static` to the application.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43169&comment_hash=43f2fde645bfb0d8f690109754295df707d1076121a5aedcf6730682ae42aa64&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43169&comment_hash=43f2fde645bfb0d8f690109754295df707d1076121a5aedcf6730682ae42aa64&reaction=dislike'>👎</a>



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(app-root): serve unprefixed /static/ paths under a non-root app root [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #43169:
URL: https://github.com/apache/superset/pull/43169#issuecomment-5551227854

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers an incremental AI Review.
   - `/review full` - 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 <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(app-root): serve unprefixed /static/ paths under a non-root app root [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #43169:
URL: https://github.com/apache/superset/pull/43169#issuecomment-5434987445

   As sadpandajoe flagged, the bundled nginx template only proxies `${SUPERSET_APP_ROOT}/static`, not a root-level `/static`, so unprefixed static requests still 404 under the documented Docker/nginx setup. Mind adding a `/static` location there too? Happy to review if you can address that, or to jump in with some commits if you want a hand.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(app-root): serve unprefixed /static/ paths under a non-root app root [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #43169:
URL: https://github.com/apache/superset/pull/43169#issuecomment-6488248203

   ## <a href="https://codeant.ai/" title="CodeAnt AI"><img src="https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/codeant-block-purple-v2.svg" width="28" height="28" align="absmiddle" style="vertical-align:middle" alt="CodeAnt" /></a>&nbsp; CodeAnt PR Risk
   
   **🟢&nbsp; Low Risk**
   
   - The PR appears safe to merge; nginx now forwards both app-root-prefixed and bare static requests, and the middleware preserves bare static paths.
   
   **Assessed commit:** `9f0d633c5030`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org