You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "albundy83 (via GitHub)" <gi...@apache.org> on 2026/02/17 18:31:04 UTC
[PR] fix(superset_app_root): when used with oauth [superset]
albundy83 opened a new pull request, #38033:
URL: https://github.com/apache/superset/pull/38033
<!---
Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
Example:
fix(dashboard): load charts correctly
-->
### SUMMARY
Continue to improve https://github.com/apache/superset/issues/26319
Fix https://github.com/apache/superset/issues/34552
### TESTING INSTRUCTIONS
- Have a nice kubernetes cluster (here rke2 1.34.3)
- configure your wonderful superset to use oauth (for example keycloak)
```yaml
envFromSecrets:
- superset-oauth-providers # contains all my super secret keycloak stuff (urls and client_secret etc ...)
configOverrides:
enable_oauth: |
from os import environ as env
from flask_appbuilder.security.manager import (AUTH_DB, AUTH_OAUTH)
AUTH_TYPE = AUTH_OAUTH
OAUTH_PROVIDERS = [
{
'name': env.get('name'),
'icon': env.get('icon'),
'token_key': 'access_token',
'remote_app': {
'client_id': env.get('client_id'),
'client_secret': env.get('client_secret'),
'client_kwargs': {
'scope': env.get('client_kwargs_scope'),
},
'access_token_url': env.get('access_token_url'),
'api_base_url': env.get('api_base_url'),
'authorize_url': env.get('authorize_url'),
'server_metadata_url': env.get('server_metadata_url'),
},
}
]
# Map Authlib roles to superset roles
AUTH_ROLE_ADMIN = 'Admin'
AUTH_ROLE_PUBLIC = 'Public'
# Will allow user self registration, allowing to create Flask users from Authorized User
AUTH_USER_REGISTRATION = True
# The default user self registration role
AUTH_USER_REGISTRATION_ROLE = 'Admin'
```
- deploy using new beta feature [SUPERSET_APP_ROOT](https://github.com/apache/superset/issues/26319):
```yaml
extraEnv:
SUPERSET_APP_ROOT: /tableau
```
- connect for example to https://superset.youpi.fr/tableau using
When you click on "Sign in with Keycloak"
You first have a 404 as url is the like this: https://superset.youpi.fr/login/keycloak?next=%2Fsuperset%2Fwelcome%2F (sub url /tableau is missing)
If you manually add /tableau, you will then have: https://superset.youpi.fr/superset/welcome/ (and still /tableau is missing)
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [x] Has associated issue:
- [ ] 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(superset_app_root): when used with oauth [superset]
Posted by "hannespr (via GitHub)" <gi...@apache.org>.
hannespr commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-3992945514
I just checked locally:
```
const nextUrl = useMemo(() => {
try {
const params = new URLSearchParams(window.location.search);
return params.get('next') || '';
} catch (_error) {
return '';
}
}, []);
```
works like a charm for me :+1:
--
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(superset_app_root): when used with oauth [superset]
Posted by "hannespr (via GitHub)" <gi...@apache.org>.
hannespr commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-5054646505
Thank you very much, @albundy83 and @rusackas for fix & stamina. Highly appreciated :heart:
--
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(superset_app_root): when used with oauth [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 #38033:
URL: https://github.com/apache/superset/pull/38033#discussion_r3564749808
##########
superset-frontend/src/pages/Register/Register.test.tsx:
##########
@@ -17,32 +17,63 @@
* under the License.
*/
import { render, screen } from 'spec/helpers/testing-library';
-import { MemoryRouter } from 'react-router-dom';
+import { MemoryRouter, Route } from 'react-router-dom';
+import getBootstrapData from 'src/utils/getBootstrapData';
import Register from './index';
jest.mock('src/utils/getBootstrapData', () => ({
__esModule: true,
- default: () => ({
+ default: jest.fn(() => ({
common: {
conf: {
RECAPTCHA_PUBLIC_KEY: '',
},
},
- }),
+ })),
+}));
+
+const mockMakeUrl = jest.fn((path: string) => path);
+jest.mock('src/utils/pathUtils', () => ({
+ makeUrl: (...args: string[]) => mockMakeUrl(...args),
}));
Review Comment:
**Suggestion:** The module mock is stubbing `makeUrl`, but the Register page now resolves its login link via `ensureAppRoot` from `navigationUtils`. Because `ensureAppRoot` is not provided by this mock, activation-page renders can crash with a function-not-found error when building the login href. Mock `ensureAppRoot` (or mock `navigationUtils` directly) instead of only `makeUrl`. [api mismatch]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
❌ Register activation tests crash with TypeError on login render.
⚠️ SUPERSET_APP_ROOT login link behavior lacks reliable coverage.
⚠️ navigationUtils-pathUtils contract obscured by misleading test mocks.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. In `superset-frontend/src/pages/Register/Register.test.tsx:35-38`, the test defines
`mockMakeUrl` and calls `jest.mock('src/utils/pathUtils', () => ({ makeUrl: (...args:
string[]) => mockMakeUrl(...args), }))`, replacing the entire `pathUtils` module with an
object that only exports `makeUrl`.
2. In `superset-frontend/src/utils/navigationUtils.ts:24-38`, `navigationUtils` imports `{
ensureAppRoot, makeUrl, stripAppRoot }` from `'./pathUtils'` and re-exports them (`export
{ ensureAppRoot, makeUrl, stripAppRoot };`). Because the Jest mock provides only
`makeUrl`, the imported `ensureAppRoot` and `stripAppRoot` become `undefined` in the test
environment.
3. In `superset-frontend/src/pages/Register/index.tsx:35,79-105`, the `Register` component
imports `ensureAppRoot` from `'src/utils/navigationUtils'` and, in the activation-success
branch (`if (activationHash)`), renders a `Button` with `href={ensureAppRoot('/login/')}`
and `data-test="login-button"`.
4. When the test calls `renderActivated()` (`Register.test.tsx:66-73`), React renders the
activation-success page and executes `ensureAppRoot('/login/')`. Because `ensureAppRoot`
is `undefined` due to the incorrect `pathUtils` mock, this call throws a `TypeError:
ensureAppRoot is not a function`, causing the activation-page tests to crash instead of
validating the login link or SUPERSET_APP_ROOT behavior.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=d2e914652bf64daca0fb008f578f1d80&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=d2e914652bf64daca0fb008f578f1d80&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/pages/Register/Register.test.tsx
**Line:** 35:38
**Comment:**
*Api Mismatch: The module mock is stubbing `makeUrl`, but the Register page now resolves its login link via `ensureAppRoot` from `navigationUtils`. Because `ensureAppRoot` is not provided by this mock, activation-page renders can crash with a function-not-found error when building the login href. Mock `ensureAppRoot` (or mock `navigationUtils` directly) instead of only `makeUrl`.
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%2F38033&comment_hash=2af7a3682953f9ccb3b62e548387fd066addfa7df54aefe0fe78eabbba8c812f&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38033&comment_hash=2af7a3682953f9ccb3b62e548387fd066addfa7df54aefe0fe78eabbba8c812f&reaction=dislike'>👎</a>
##########
superset-frontend/src/pages/Register/Register.test.tsx:
##########
@@ -80,3 +111,71 @@ test('should render input placeholders', () => {
expect(screen.getByPlaceholderText('Password')).toBeInTheDocument();
expect(screen.getByPlaceholderText('Confirm password')).toBeInTheDocument();
});
+
+// --- Recaptcha tests ---
+
+test('should not render captcha when RECAPTCHA_PUBLIC_KEY is empty', () => {
+ renderRegister();
+ expect(screen.queryByTestId('captcha-input')).not.toBeInTheDocument();
+});
+
+test('should render captcha when RECAPTCHA_PUBLIC_KEY is set', () => {
+ mockGetBootstrapData.mockReturnValue({
+ common: {
+ conf: {
+ RECAPTCHA_PUBLIC_KEY: 'test-key-123',
+ },
+ },
+ } as ReturnType<typeof getBootstrapData>);
+ renderRegister();
+ expect(screen.getByTestId('captcha-input')).toBeInTheDocument();
+});
+
+// --- Activation success page tests ---
+
+test('should render activation success page when activationHash is present', () => {
+ renderActivated();
+ expect(screen.getByText('Registration successful')).toBeInTheDocument();
+ expect(
+ screen.getByText(
+ 'Your account is activated. You can log in with your credentials.',
+ ),
+ ).toBeInTheDocument();
+ expect(screen.getByTestId('login-button')).toBeInTheDocument();
+});
+
+test('should not render registration form on activation page', () => {
+ renderActivated();
+ expect(screen.queryByTestId('username-input')).not.toBeInTheDocument();
+ expect(screen.queryByTestId('register-button')).not.toBeInTheDocument();
+});
+
+test('should call makeUrl for login link on activation page', () => {
+ renderActivated();
+ expect(mockMakeUrl).toHaveBeenCalledWith('/login/');
+});
Review Comment:
**Suggestion:** This assertion is checking calls to `makeUrl`, but the component no longer uses `makeUrl` for the activation-page login link, so this test will fail even when behavior is correct. Update the assertion to track the helper actually used by the component (`ensureAppRoot`) and verify the rendered href accordingly. [logic error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
⚠️ Activation login-link test asserts obsolete makeUrl helper usage.
⚠️ Correct ensureAppRoot-based behavior may still fail this test.
⚠️ Developers may chase false negatives during registration flow changes.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Inspect the Register component at
`superset-frontend/src/pages/Register/index.tsx:35,79-105`: when `activationHash` is
present, it renders a success `Result` whose `extra` array includes a `Button` with
`href={ensureAppRoot('/login/')}` and `data-test="login-button"`. There is no reference to
`makeUrl` anywhere in this component.
2. In `superset-frontend/src/utils/pathUtils.ts:53-69,85-87`, `ensureAppRoot(path)` is the
primary helper that prefixes router-relative paths with the application root;
`makeUrl(path)` is just a thin wrapper that returns `ensureAppRoot(path)`. The Register
page accesses `ensureAppRoot` via `navigationUtils` (`navigationUtils.ts:24,38`), not
`makeUrl` directly.
3. The test `should call makeUrl for login link on activation page` at
`Register.test.tsx:153-156` calls `renderActivated()` (defined at lines 66-73) and then
asserts `expect(mockMakeUrl).toHaveBeenCalledWith('/login/');`. Given the component’s
current implementation, the login link is built through `ensureAppRoot('/login/')` and
never calls `makeUrl`, so `mockMakeUrl` is not a reliable proxy for the actual helper the
component uses.
4. As a result, once the module mocking is corrected to provide a working `ensureAppRoot`
(for example, by mocking `navigationUtils` or exporting `ensureAppRoot` from the
`pathUtils` mock), this test will either fail despite correct behavior (because `makeUrl`
is not invoked) or force an artificial implementation where `ensureAppRoot` calls
`makeUrl` just to satisfy the assertion, meaning the test is validating an obsolete
contract instead of the real `ensureAppRoot`-based login-link behavior.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=90c823d5326d4c09b26a979b49e4b58b&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=90c823d5326d4c09b26a979b49e4b58b&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/pages/Register/Register.test.tsx
**Line:** 153:156
**Comment:**
*Logic Error: This assertion is checking calls to `makeUrl`, but the component no longer uses `makeUrl` for the activation-page login link, so this test will fail even when behavior is correct. Update the assertion to track the helper actually used by the component (`ensureAppRoot`) and verify the rendered href accordingly.
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%2F38033&comment_hash=918742635d7fe9ee5002eec701d98b5c26cd78488f960217c110fa2e620b1e20&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38033&comment_hash=918742635d7fe9ee5002eec701d98b5c26cd78488f960217c110fa2e620b1e20&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(superset_app_root): when used with oauth [superset]
Posted by "hannespr (via GitHub)" <gi...@apache.org>.
hannespr commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-3992887140
For some reason I did not discover it yesterday - but now I am experiencing problems with the login button `next` query-param for the redirect after successful authentication. It renders the following:
```
href="/superset/login/MyIdP?next=%2Fsuperset%2Fsuperset%2Fsuperset%2Fwelcome%2F"
```
but correct would be (I have `SUPERSET_APP_ROOT=/superset`)
```
href="/superset/login/MyIdP?next=%2Fsuperset%2Fsuperset%2Fwelcome%2F"
```
Thus, after successful authentication, I get a 404.
If I see this correctly, the problem is, that you wrap the `next`-URL with `ensureAppRoot` although the URL is retrieved already with the correct app root attached:
```
const nextUrl = useMemo(() => {
try {
const params = new URLSearchParams(window.location.search);
const next = params.get('next') || '';
return next ? ensureAppRoot(next) : '';
} catch (_error) {
return '';
}
}, []);
```
I think the correct approach would be to just use the URL as retrieved from the URL search params as it is already "ensured app root".
What do you think, @albundy83?
--
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(superset_app_root): when used with oauth [superset]
Posted by "albundy83 (via GitHub)" <gi...@apache.org>.
albundy83 commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-3985945350
I have now pushed an updated release, I hope will work also with you.
Thanks a lot for your comments :)
--
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(superset_app_root): when used with oauth [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe merged PR #38033:
URL: https://github.com/apache/superset/pull/38033
--
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(superset_app_root): when used with oauth [superset]
Posted by "hannespr (via GitHub)" <gi...@apache.org>.
hannespr commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-4009947654
The `ensureAppRoot` function has been adjusted in a similar & compatible way on the `master` meanwhile :rocket:.
--
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(superset_app_root): when used with oauth [superset]
Posted by "hannespr (via GitHub)" <gi...@apache.org>.
hannespr commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-3986214968
I think I found the problem:
The logo url is wrapped with `ensureAppRoot`
```
<StyledBrandLink href={ensureAppRoot(theme.brandLogoHref)}>
```
but this method is not suited for external URLs - it will just mess them up. I am from the Java/Spring world :smile: - there I recently saw code which handles such cases like that:
```
export function ensureAppRoot(path: string): string {
if(path.beginsWith("http")
return path
...
```
If we assume that no one will start their internal paths with http... this is an effective way to detect external URLs which could also be implemented here. Brand URL should be typically external URL (I guess?), so a separate check, not using `ensureAppRoot` would also be fine in my opinion, although I like the first variant better as it is harder to get wrong.
Regarding your question, I have configured my theme like this:
```
{
"algorithm": "default",
"token": {
"brandLogoHref": "https://example.com"
}
}
```
which makes the upper left logo a link to that URL.
--
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(superset_app_root): when used with oauth [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-4117110960
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(superset_app_root): when used with oauth [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #38033:
URL: https://github.com/apache/superset/pull/38033#discussion_r3627546156
##########
superset-frontend/src/pages/Login/Login.test.tsx:
##########
@@ -31,27 +31,26 @@ const defaultBootstrapData = {
},
};
-const mockApplicationRoot = jest.fn<string, []>(() => '');
+jest.mock('src/utils/getBootstrapData', () => ({
+ __esModule: true,
+ default: jest.fn(() => defaultBootstrapData),
+}));
-jest.mock('src/utils/getBootstrapData', () => {
- const actual = jest.requireActual<
- typeof import('src/utils/getBootstrapData')
- >('src/utils/getBootstrapData');
- return {
- __esModule: true,
- ...actual,
- default: jest.fn(() => defaultBootstrapData),
- applicationRoot: () => mockApplicationRoot(),
- };
-});
+const mockEnsureAppRoot = jest.fn((path: string) => path);
+jest.mock('src/utils/pathUtils', () => ({
Review Comment:
This works — `navigationUtils` re-exports `ensureAppRoot` straight from `pathUtils`, so mocking `pathUtils` intercepts the call the component actually makes.
##########
superset-frontend/src/pages/Login/index.tsx:
##########
@@ -96,15 +96,19 @@ export default function Login() {
}, []);
const loginEndpoint = useMemo(
- () => (nextUrl ? `/login/?next=${encodeURIComponent(nextUrl)}` : '/login/'),
+ () =>
+ ensureAppRoot(
+ nextUrl ? `/login/?next=${encodeURIComponent(nextUrl)}` : '/login/',
+ ),
[nextUrl],
);
const buildProviderLoginUrl = (providerName: string) => {
- const base = `/login/${encodeURIComponent(providerName)}`;
- return ensureAppRoot(
- nextUrl ? `${base}?next=${encodeURIComponent(nextUrl)}` : base,
- );
+ const base = `/login/${providerName}`;
Review Comment:
Good catch — restored `encodeURIComponent` on the provider name in `buildProviderLoginUrl`.
##########
superset/app.py:
##########
@@ -81,6 +81,12 @@ def create_app(
# value of app_root so things work out of the box
if not app.config["STATIC_ASSETS_PREFIX"]:
app.config["STATIC_ASSETS_PREFIX"] = app_root
+ # Prefix APP_ICON path with subdirectory root for subdirectory deployments
+ if (
+ app.config.get("APP_ICON", "").startswith("/static/")
+ and app_root != "/"
+ ):
+ app.config["APP_ICON"] = f"{app_root}{app.config['APP_ICON']}"
Review Comment:
Switched to `STATIC_ASSETS_PREFIX` (which defaults to `app_root` here) so a custom CDN/static prefix is honoured.
##########
superset-frontend/src/pages/Register/Register.test.tsx:
##########
@@ -17,32 +17,63 @@
* under the License.
*/
import { render, screen } from 'spec/helpers/testing-library';
-import { MemoryRouter } from 'react-router-dom';
+import { MemoryRouter, Route } from 'react-router-dom';
+import getBootstrapData from 'src/utils/getBootstrapData';
import Register from './index';
jest.mock('src/utils/getBootstrapData', () => ({
__esModule: true,
- default: () => ({
+ default: jest.fn(() => ({
common: {
conf: {
RECAPTCHA_PUBLIC_KEY: '',
},
},
- }),
+ })),
+}));
+
+const mockMakeUrl = jest.fn((path: string) => path);
+jest.mock('src/utils/pathUtils', () => ({
+ makeUrl: (...args: string[]) => mockMakeUrl(...args),
}));
Review Comment:
Fixed — the mock now stubs `ensureAppRoot`, matching what the component imports.
##########
superset-frontend/src/pages/Register/Register.test.tsx:
##########
@@ -80,3 +111,71 @@ test('should render input placeholders', () => {
expect(screen.getByPlaceholderText('Password')).toBeInTheDocument();
expect(screen.getByPlaceholderText('Confirm password')).toBeInTheDocument();
});
+
+// --- Recaptcha tests ---
+
+test('should not render captcha when RECAPTCHA_PUBLIC_KEY is empty', () => {
+ renderRegister();
+ expect(screen.queryByTestId('captcha-input')).not.toBeInTheDocument();
+});
+
+test('should render captcha when RECAPTCHA_PUBLIC_KEY is set', () => {
+ mockGetBootstrapData.mockReturnValue({
+ common: {
+ conf: {
+ RECAPTCHA_PUBLIC_KEY: 'test-key-123',
+ },
+ },
+ } as ReturnType<typeof getBootstrapData>);
+ renderRegister();
+ expect(screen.getByTestId('captcha-input')).toBeInTheDocument();
+});
+
+// --- Activation success page tests ---
+
+test('should render activation success page when activationHash is present', () => {
+ renderActivated();
+ expect(screen.getByText('Registration successful')).toBeInTheDocument();
+ expect(
+ screen.getByText(
+ 'Your account is activated. You can log in with your credentials.',
+ ),
+ ).toBeInTheDocument();
+ expect(screen.getByTestId('login-button')).toBeInTheDocument();
+});
+
+test('should not render registration form on activation page', () => {
+ renderActivated();
+ expect(screen.queryByTestId('username-input')).not.toBeInTheDocument();
+ expect(screen.queryByTestId('register-button')).not.toBeInTheDocument();
+});
+
+test('should call makeUrl for login link on activation page', () => {
+ renderActivated();
+ expect(mockMakeUrl).toHaveBeenCalledWith('/login/');
+});
Review Comment:
Fixed — the assertion now checks `ensureAppRoot`.
--
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(superset_app_root): when used with oauth [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 #38033:
URL: https://github.com/apache/superset/pull/38033#discussion_r3556209224
##########
superset-frontend/src/pages/Login/index.tsx:
##########
@@ -95,15 +96,19 @@ export default function Login() {
}, []);
const loginEndpoint = useMemo(
- () => (nextUrl ? `/login/?next=${encodeURIComponent(nextUrl)}` : '/login/'),
+ () =>
+ ensureAppRoot(
+ nextUrl ? `/login/?next=${encodeURIComponent(nextUrl)}` : '/login/',
+ ),
Review Comment:
**Suggestion:** `SupersetClient.postForm` already prefixes endpoints with the configured app root internally, so wrapping the login endpoint with `ensureAppRoot` here causes double-prefix URLs (for example `/superset/superset/login/`) in subpath deployments and breaks DB/LDAP login with 404s. Keep this endpoint as a raw relative path when calling `postForm`. [api mismatch]
<details>
<summary><b>Severity Level:</b> Critical 🚨</summary>
```mdx
- ❌ DB/LDAP login POST hits double-prefixed, non-existent endpoint.
- ❌ Subpath deployments cannot authenticate using database credentials.
- ⚠️ OAuth/OIDC logins work but endpoint handling inconsistent.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Load the login page implemented in
`superset-frontend/src/pages/Login/index.tsx:83-160`. The `loginEndpoint` memo is defined
at lines 98-104 and now wraps the relative login path with `ensureAppRoot`:
- Line 98: `const loginEndpoint = useMemo(`
- Lines 99-102: `() => ensureAppRoot(nextUrl ? '/login/?next=...' : '/login/')`
2. Inspect `ensureAppRoot` in `superset-frontend/src/utils/pathUtils.ts:44-60`. For a
subpath deployment where `applicationRoot()` returns `'/superset'` (derived from
`getBootstrapData().common.application_root` in `src/utils/getBootstrapData.ts:68-82`),
calling `ensureAppRoot('/login/')` returns `'/superset/login/'` (line 59: `return
\`\${root}\${normalizedPath}\`;`).
3. For database or LDAP authentication, the login form submit handler `onFinish` at
`superset-frontend/src/pages/Login/index.tsx:133-141` invokes the shared client:
- Line 139: comment about standard form submission for Flask-AppBuilder compatibility
- Line 140: `SupersetClient.postForm(loginEndpoint, values, '');`
In `packages/superset-ui-core/src/connection/SupersetClientClass.ts:119-151`,
`postForm` builds the URL using `this.getUrl({ endpoint })`, and `getUrl` at lines
26-42 constructs:
- `return \`\${this.protocol}//\${cleanHost}\${this.appRoot}/\${endpoint[0] === '/' ?
endpoint.slice(1) : endpoint}\`;`
This means the configured `appRoot` is always prefixed to the provided `endpoint`.
4. In a subpath deployment where SupersetClient is configured with `appRoot = '/superset'`
(matching the behaviour validated by
`packages/superset-ui-core/test/connection/SupersetClient.test.ts:109-112`, which expects
`getUrl({ endpoint: '/some/path' })` to contain `'/app/some/path'` when `appRoot:
'/app'`), the combination of steps 2 and 3 yields:
- `loginEndpoint` from React: `'/superset/login/?next=...'`
- `getUrl` with `appRoot = '/superset'`:
`https://host/superset/superset/login/?next=...`
This double-prefixed path (`/superset/superset/login/`) does not match the backend
login route (`/superset/login/`), so the POST from `SupersetClient.postForm` hits a
non-existent endpoint and the DB/LDAP login request fails with a 404 in subpath
deployments.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=2b1c2332e5e7414f97226c017cc98c00&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=2b1c2332e5e7414f97226c017cc98c00&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/pages/Login/index.tsx
**Line:** 99:102
**Comment:**
*Api Mismatch: `SupersetClient.postForm` already prefixes endpoints with the configured app root internally, so wrapping the login endpoint with `ensureAppRoot` here causes double-prefix URLs (for example `/superset/superset/login/`) in subpath deployments and breaks DB/LDAP login with 404s. Keep this endpoint as a raw relative path when calling `postForm`.
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%2F38033&comment_hash=aa2598df29589a1ce038f30475cf9396b51777318e3d240363b9580b0430ded5&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38033&comment_hash=aa2598df29589a1ce038f30475cf9396b51777318e3d240363b9580b0430ded5&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(superset_app_root): when used with oauth [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 #38033:
URL: https://github.com/apache/superset/pull/38033#discussion_r3627552126
##########
superset-frontend/src/pages/Register/Register.test.tsx:
##########
@@ -80,3 +111,71 @@ test('should render input placeholders', () => {
expect(screen.getByPlaceholderText('Password')).toBeInTheDocument();
expect(screen.getByPlaceholderText('Confirm password')).toBeInTheDocument();
});
+
+// --- Recaptcha tests ---
+
+test('should not render captcha when RECAPTCHA_PUBLIC_KEY is empty', () => {
+ renderRegister();
+ expect(screen.queryByTestId('captcha-input')).not.toBeInTheDocument();
+});
+
+test('should render captcha when RECAPTCHA_PUBLIC_KEY is set', () => {
+ mockGetBootstrapData.mockReturnValue({
+ common: {
+ conf: {
+ RECAPTCHA_PUBLIC_KEY: 'test-key-123',
+ },
+ },
+ });
+ renderRegister();
+ expect(screen.getByTestId('captcha-input')).toBeInTheDocument();
Review Comment:
**Suggestion:** This assertion queries `data-testid`, but the mocked captcha component in this file renders `data-test`, so the test will fail even when captcha is correctly rendered. Use a selector consistent with the mock (or update the mock attribute) so the test validates real behavior. [logic error]
<details>
<summary><b>Severity Level:</b> Critical 🚨</summary>
```mdx
- ❌ Register page tests fail in current Jest test suite.
- ⚠️ Recaptcha conditional rendering behavior not properly validated.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. In `superset-frontend/src/pages/Register/Register.test.tsx` lines 40–43, note the mock
for `react-google-recaptcha` returns `<div data-test="captcha-input" />`, i.e., it sets
`data-test`, not `data-testid`.
2. In the same file, lines 122–132 define `test('should render captcha when
RECAPTCHA_PUBLIC_KEY is set', ...)` and at line 131 call
`screen.getByTestId('captcha-input')` expecting the element to be present.
3. Run the front-end Jest test suite (e.g., `npm test` or `yarn test`), which executes
`Register.test.tsx` and renders the `Register` component with `RECAPTCHA_PUBLIC_KEY` set
in the mocked `getBootstrapData` (lines 122–129).
4. When the test runs, the mock reCAPTCHA component renders a `div` with
`data-test="captcha-input"`, but React Testing Library’s `getByTestId` searches for
`data-testid="captcha-input"`, cannot find it, and throws an error at line 131, causing
this test (and the suite) to fail even though the captcha mock is rendered.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=f50cd2b31c59496f8f4d131271ac54b4&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=f50cd2b31c59496f8f4d131271ac54b4&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/pages/Register/Register.test.tsx
**Line:** 131:131
**Comment:**
*Logic Error: This assertion queries `data-testid`, but the mocked captcha component in this file renders `data-test`, so the test will fail even when captcha is correctly rendered. Use a selector consistent with the mock (or update the mock attribute) so the test validates real behavior.
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%2F38033&comment_hash=a838f1968f779476a43f47c938438b158814c3c14bca3c178cc34b384cdec1e9&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38033&comment_hash=a838f1968f779476a43f47c938438b158814c3c14bca3c178cc34b384cdec1e9&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(superset_app_root): when used with oauth [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-3985959847
### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | d8d3025f975e66574f01fc72c203cd7169b7255f |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/69a5cdd8e6f54900087e9fce |
|<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-38033--superset-docs-preview.netlify.app](https://deploy-preview-38033--superset-docs-preview.netlify.app) |
|<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br /><br /><br />_Use your smartphone camera to open QR code link._</details> |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-38033--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(superset_app_root): when used with oauth [superset]
Posted by "hannespr (via GitHub)" <gi...@apache.org>.
hannespr commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-3985100381
Thanks for your quick reply! I have directly built your PR repository (I used `docker build`, no params) - so that should not be the issue here :see_no_evil:
--
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(superset_app_root): when used with oauth [superset]
Posted by "albundy83 (via GitHub)" <gi...@apache.org>.
albundy83 commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-3986171843
Can you show me how you pass brandLogoUrl and brandLogoHref please ?
--
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(superset_app_root): when used with oauth [superset]
Posted by "albundy83 (via GitHub)" <gi...@apache.org>.
albundy83 commented on code in PR #38033:
URL: https://github.com/apache/superset/pull/38033#discussion_r2883145446
##########
superset-frontend/src/features/home/RightMenu.tsx:
##########
@@ -503,7 +503,7 @@ const RightMenu = ({
key: 'logout',
label: (
<Typography.Link
- href={ensureAppRoot(navbarRight.user_logout_url)}
+ href={navbarRight.user_logout_url}
>
Review Comment:
No, as user_logout_url is already correctly prefixed by Flask in file superset/views/base.py.
Here the extract: "user_logout_url": appbuilder.get_url_for_logout,
--
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(superset_app_root): when used with oauth [superset]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #38033:
URL: https://github.com/apache/superset/pull/38033#discussion_r2874011032
##########
superset-frontend/src/pages/Login/Login.test.tsx:
##########
@@ -17,21 +17,45 @@
* under the License.
*/
import { render, screen } from 'spec/helpers/testing-library';
+import getBootstrapData from 'src/utils/getBootstrapData';
import Login from './index';
jest.mock('src/utils/getBootstrapData', () => ({
__esModule: true,
- default: () => ({
+ default: jest.fn(() => ({
common: {
conf: {
AUTH_TYPE: 1,
AUTH_PROVIDERS: [],
AUTH_USER_REGISTRATION: false,
},
},
- }),
+ })),
}));
+const mockMakeUrl = jest.fn((path: string) => path);
+jest.mock('src/utils/pathUtils', () => ({
+ makeUrl: (...args: string[]) => mockMakeUrl(...args),
Review Comment:
The test suite mocks `src/utils/pathUtils` to only provide `makeUrl`, but `Login` now imports and calls `ensureAppRoot`. With the current mock, `ensureAppRoot` will be `undefined` at runtime and the tests will fail. Update the mock to export `ensureAppRoot` (and/or stop mocking `pathUtils` and set up bootstrap data so the real `ensureAppRoot` works).
```suggestion
const mockMakeUrl = jest.fn((path: string) => path);
const mockEnsureAppRoot = jest.fn((path: string) => path);
jest.mock('src/utils/pathUtils', () => ({
makeUrl: (...args: string[]) => mockMakeUrl(...args),
ensureAppRoot: (path: string) => mockEnsureAppRoot(path),
```
##########
superset-frontend/src/pages/Login/Login.test.tsx:
##########
@@ -53,3 +77,232 @@ test('should render form instruction text', () => {
screen.getByText('Enter your login and password below:'),
).toBeInTheDocument();
});
+
+test('should call makeUrl for login endpoint on DB auth', () => {
+ render(<Login />, { useRedux: true });
+ expect(mockMakeUrl).toHaveBeenCalledWith('/login/');
+});
Review Comment:
This assertion (and several others below) expects `makeUrl` to be called for `/login/...` URLs, but `Login` no longer uses `makeUrl` (it uses `ensureAppRoot` directly). The expectations should be updated to match the new behavior (e.g., assert on the rendered `href`/endpoint after prefixing, or spy on `ensureAppRoot`).
--
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(superset_app_root): when used with oauth [superset]
Posted by "albundy83 (via GitHub)" <gi...@apache.org>.
albundy83 commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-3985694606
> Thanks for your quick reply! I have directly built your PR repository (I used `docker build`, no params) - so that should not be the issue here 🙈
I have just tried my code after the upgraded branch and I have the same behaviour than you for logout.
I am looking to see if I find what has changed :)
--
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(superset_app_root): when used with oauth [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 #38033:
URL: https://github.com/apache/superset/pull/38033#discussion_r2882885293
##########
superset-frontend/src/features/home/RightMenu.tsx:
##########
@@ -503,7 +503,7 @@ const RightMenu = ({
key: 'logout',
label: (
<Typography.Link
- href={ensureAppRoot(navbarRight.user_logout_url)}
+ href={navbarRight.user_logout_url}
>
Review Comment:
**Suggestion:** The logout link uses `navbarRight.user_logout_url` directly without `ensureAppRoot`, unlike other menu URLs, so when `SUPERSET_APP_ROOT` is configured the logout will point to an unprefixed path and may break or route to the wrong URL; wrapping it with `ensureAppRoot` makes the logout URL consistent and app-root aware. [logic error]
<details>
<summary><b>Severity Level:</b> Critical 🚨</summary>
```mdx
- ❌ Logout menu broken for SUPERSET_APP_ROOT deployments.
- ⚠️ Users may remain logged in after clicking logout.
- ⚠️ Inconsistent app-root handling versus other navbar links.
```
</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(superset_app_root): when used with oauth [superset]
Posted by "albundy83 (via GitHub)" <gi...@apache.org>.
albundy83 commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-4932865012
> Gave the branch update a shot and it won't rebase cleanly — #39925 reworked `ensureAppRoot` on master, so the `Login`/`Register` changes and their tests collide with what's there now.
>
> @albundy83 could you rebase and drop what master already covers? Looks like the `app.py` icon prefixing and the logout fix are the parts still uniquely yours.
Hello, so many changes, I hope I will not break things ...
--
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(superset_app_root): when used with oauth [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-4010209078
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(superset_app_root): when used with oauth [superset]
Posted by "hannespr (via GitHub)" <gi...@apache.org>.
hannespr commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-3986240997
Nice job, mate :rocket: - that will definitely do it :)
Looking very forward to get this merged!
--
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(superset_app_root): when used with oauth [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-3997814730
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(superset_app_root): when used with oauth [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-4932633446
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(superset_app_root): when used with oauth [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on code in PR #38033:
URL: https://github.com/apache/superset/pull/38033#discussion_r3558282293
##########
superset-frontend/src/pages/Login/Login.test.tsx:
##########
@@ -31,27 +31,26 @@ const defaultBootstrapData = {
},
};
-const mockApplicationRoot = jest.fn<string, []>(() => '');
+jest.mock('src/utils/getBootstrapData', () => ({
+ __esModule: true,
+ default: jest.fn(() => defaultBootstrapData),
+}));
-jest.mock('src/utils/getBootstrapData', () => {
- const actual = jest.requireActual<
- typeof import('src/utils/getBootstrapData')
- >('src/utils/getBootstrapData');
- return {
- __esModule: true,
- ...actual,
- default: jest.fn(() => defaultBootstrapData),
- applicationRoot: () => mockApplicationRoot(),
- };
-});
+const mockEnsureAppRoot = jest.fn((path: string) => path);
+jest.mock('src/utils/pathUtils', () => ({
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Mock targets wrong module path</b></div>
<div id="fix">
The mock targets `src/utils/pathUtils` but `Login/index.tsx:37` imports `ensureAppRoot` from `src/utils/navigationUtils` — these are two distinct modules. The mock will not intercept the component's import, causing `ensureAppRoot` calls to use the real implementation instead of the mock. This undermines all 13 `mockEnsureAppRoot` assertions in the diff.
</div>
</div>
<small><i>Code Review Run #6e5d9b</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
##########
superset-frontend/src/pages/Login/index.tsx:
##########
@@ -96,15 +96,19 @@ export default function Login() {
}, []);
const loginEndpoint = useMemo(
- () => (nextUrl ? `/login/?next=${encodeURIComponent(nextUrl)}` : '/login/'),
+ () =>
+ ensureAppRoot(
+ nextUrl ? `/login/?next=${encodeURIComponent(nextUrl)}` : '/login/',
+ ),
[nextUrl],
);
const buildProviderLoginUrl = (providerName: string) => {
- const base = `/login/${encodeURIComponent(providerName)}`;
- return ensureAppRoot(
- nextUrl ? `${base}?next=${encodeURIComponent(nextUrl)}` : base,
- );
+ const base = `/login/${providerName}`;
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>CWE-20: Missing URL encoding regression</b></div>
<div id="fix">
The change removes `encodeURIComponent(providerName)` which introduces a behavioral regression. Provider names with spaces or special characters (e.g., 'Okta SSO', 'Test&Dev') will produce malformed URLs. Compare line 109 which correctly encodes `nextUrl` — `providerName` encoding should be consistent with this pattern. This aligns with how the original code worked. (See also: [CWE-20](https://cwe.mitre.org/data/definitions/20.html))
</div>
</div>
<small><i>Code Review Run #6e5d9b</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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(superset_app_root): when used with oauth [superset]
Posted by "albundy83 (via GitHub)" <gi...@apache.org>.
albundy83 commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-3997461792
> I just checked locally:
>
> ```
> const nextUrl = useMemo(() => {
> try {
> const params = new URLSearchParams(window.location.search);
> return params.get('next') || '';
> } catch (_error) {
> return '';
> }
> }, []);
> ```
>
> works like a charm for me 👍
I also see the triple "/superset" in my navigation bar now, but the login works correctly so I never see it :)
Good catch, thanks a lot for your help (and hawkeye :) )
--
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(superset_app_root): when used with oauth [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on code in PR #38033:
URL: https://github.com/apache/superset/pull/38033#discussion_r2980655256
##########
superset-frontend/src/explore/exploreUtils/index.ts:
##########
@@ -373,7 +373,7 @@ export const exportChart = async ({
});
payload = formData;
} else {
- url = ensureAppRoot('/api/v1/chart/data');
+ url = '/api/v1/chart/data';
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>API URL missing app root prefix</b></div>
<div id="fix">
Removing ensureAppRoot from the API URL will cause chart data export to fail in subdirectory deployments where Superset is mounted under a path like /superset, since '/api/v1/chart/data' resolves to the wrong endpoint. The legacy API path correctly uses ensureAppRoot via getExploreUrl.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
````suggestion
url = ensureAppRoot('/api/v1/chart/data');
````
</div>
</details>
</div>
<small><i>Code Review Run #ee3956</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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(superset_app_root): when used with oauth [superset]
Posted by "vishal-chhatwani (via GitHub)" <gi...@apache.org>.
vishal-chhatwani commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-4567298680
@albundy83 Thanks for putting up the fix for this. We have also been seeing this issue on our end. Looks like enough people have tested this and is good to merge once we resolve the conflicts?
--
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(superset_app_root): when used with oauth [superset]
Posted by "hannespr (via GitHub)" <gi...@apache.org>.
hannespr commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-3984956664
As I am struggling with the same problem, @albundy83, I am thankful, that you created a PR. I have tried it out locally - but it did not work for me...
The generated URL of the SSO login button still misses the `SUPERSET_APP_ROOT` prefix. Instead, it broke (I have `SUPERSET_APP_ROOT=/superset`) `brandLogoHref` which I have set in my custom theme. This is now incorrectly also prefixed, so that it is `/superset/http://...` :see_no_evil:
It also broke the logout button, which links now to `/superset/superset/logout/`.
But what it also did was fixing the link to the link to Settings -> User -> Info and the `brandLogoUrl`, which is now correctly prefixed.
I am not proficient with the Superset code base, but AI suggested me to use `ensureAppRoot` from `src/utils/pathUtils` and use it like
```
const loginEndpoint = useMemo(
() =>
ensureAppRoot(
nextUrl
? `/login/?next=${encodeURIComponent(nextUrl)}`
: '/login/',
),
[nextUrl],
);
const buildProviderLoginUrl = (providerName: string) => {
const base = ensureAppRoot(`/login/${providerName}`);
return nextUrl
? `${base}${base.includes('?') ? '&' : '?'}next=${encodeURIComponent(nextUrl)}`
: base;
};
```
in `superset-frontend/src/pages/Login/index.tsx`. This actually worked!
What do you and the maintainers think?
--
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(superset_app_root): when used with oauth [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-4948169759
Looks like there's some failing CI... I'll update the branch to re-trigger it.
If you can assess and apply/refute the latest bot suggestions, that'll help... otherwise, we'll merge (or fix to merge) soon, and call it done.
Thanks for the help/patience here :D
--
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(superset_app_root): when used with oauth [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-4850719170
Looks like there are some bot comments to address, some pre-commit failures and other stuff to deal with. I'll update the branch for now to see if that helps some CI workflows along, but holler if you'd like me/us to push some commits to help get this across the finish line. @sadpandajoe is working on related efforts, so I'm not sure where this sits in with what he's up to, FWIW.
--
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(superset_app_root): when used with oauth [superset]
Posted by "albundy83 (via GitHub)" <gi...@apache.org>.
albundy83 commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-3985067494
Ah maybe it depends on which version you have applied my fix.
The `makeUrl` has been added in 6.0.1rc1, see [here](https://github.com/apache/superset/blob/6.0.1rc1/superset-frontend/src/utils/pathUtils.ts#L42C17-L42C24)
But, `makeUrl` and `ensureAppRoot` are exactly the same function, one return the other :)
And your modifications are exactly the same than the one in pull request but with `ensureAppRoot` :)
And if you want an improvement with your oauth, I have written a small doc with a more complete example [here](https://github.com/apache/superset/pull/38092/changes)
Enjoy :)
--
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(superset_app_root): when used with oauth [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-3986096510
@martyngigg mind taking a look as the app-root expert?
--
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(superset_app_root): when used with oauth [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-3986597191
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(superset_app_root): when used with oauth [superset]
Posted by "hannespr (via GitHub)" <gi...@apache.org>.
hannespr commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-4157366603
The problem still exists on the `master`, right? Would be really nice, if this could get merged.
Would be very nice to get some feedback from the maintainers. :blush:
--
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(superset_app_root): when used with oauth [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-4755039950
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/38033?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 55.66%. Comparing base ([`334b13c`](https://app.codecov.io/gh/apache/superset/commit/334b13c3d94c12681f3f66b11d2c56a415e662ce?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`6d10005`](https://app.codecov.io/gh/apache/superset/commit/6d10005d5154fed54135218e49c7a06913501503?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 4 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/38033?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/38033?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% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/38033?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
> :exclamation: There is a different number of reports uploaded between BASE (334b13c) and HEAD (6d10005). Click for more details.
>
> <details><summary>HEAD has 22 uploads less than BASE</summary>
>
>| Flag | BASE (334b13c) | HEAD (6d10005) |
>|------|------|------|
>|python|20|2|
>|presto|3|1|
>|hive|3|1|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #38033 +/- ##
==========================================
- Coverage 64.36% 55.66% -8.71%
==========================================
Files 2653 2653
Lines 144864 144864
Branches 33421 33421
==========================================
- Hits 93247 80638 -12609
- Misses 49946 63491 +13545
+ Partials 1671 735 -936
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/38033/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/38033/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `39.33% <0.00%> (-0.01%)` | :arrow_down: |
| [mysql](https://app.codecov.io/gh/apache/superset/pull/38033/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [postgres](https://app.codecov.io/gh/apache/superset/pull/38033/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/38033/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `40.91% <0.00%> (-0.01%)` | :arrow_down: |
| [python](https://app.codecov.io/gh/apache/superset/pull/38033/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `40.98% <0.00%> (-18.59%)` | :arrow_down: |
| [sqlite](https://app.codecov.io/gh/apache/superset/pull/38033/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit](https://app.codecov.io/gh/apache/superset/pull/38033/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/38033?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(superset_app_root): when used with oauth [superset]
Posted by "albundy83 (via GitHub)" <gi...@apache.org>.
albundy83 commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-4932903605
> > Gave the branch update a shot and it won't rebase cleanly — #39925 reworked `ensureAppRoot` on master, so the `Login`/`Register` changes and their tests collide with what's there now.
> > @albundy83 could you rebase and drop what master already covers? Looks like the `app.py` icon prefixing and the logout fix are the parts still uniquely yours.
>
> Hello, so many changes, I hope I will not break things ...
There is this new navigationUtils with `import { ensureAppRoot } from 'src/utils/navigationUtils';` or `import { ensureAppRoot } from 'src/utils/pathUtils';`
Which one do you prefer :) ?
--
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(superset_app_root): when used with oauth [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-4934455998
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(superset_app_root): when used with oauth [superset]
Posted by "albundy83 (via GitHub)" <gi...@apache.org>.
albundy83 commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-4009953793
> The `ensureAppRoot` function has been adjusted in a similar & compatible way on the `master` meanwhile 🚀.
Yes, I have seen this, I will remove the modification
Thanks a lot
--
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(superset_app_root): when used with oauth [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-3916443500
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(superset_app_root): when used with oauth [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-4046881715
## **Sequence Diagram**
This PR fixes authentication navigation when Superset is deployed under a subpath. Login, OAuth provider, register, and activation success links are generated with app root awareness, while logout now uses the backend-provided URL directly to avoid double prefixing.
```mermaid
sequenceDiagram
participant User
participant Frontend
participant PathUtils
participant Backend
participant OAuthProvider
User->>Frontend: Open login page
Frontend->>PathUtils: Build app root aware auth links
PathUtils-->>Frontend: Return prefixed login register provider links
User->>Frontend: Click sign in with provider
Frontend->>Backend: Request oauth login endpoint
Backend-->>OAuthProvider: Redirect to provider auth flow
User->>Frontend: Click logout in right menu
Frontend->>Backend: Navigate to backend logout URL without extra prefix
```
---
*Generated by [CodeAnt AI](https://codeant.ai)*
--
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(superset_app_root): when used with oauth [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-3986233440
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(superset_app_root): when used with oauth [superset]
Posted by "albundy83 (via GitHub)" <gi...@apache.org>.
albundy83 commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-4933693074
I have finalise... I hope it's ok :)
--
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(superset_app_root): when used with oauth [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-4933369444
navigationUtils — that's the barrel almost everything else on master imports `ensureAppRoot` from now (19 files vs. 1), pathUtils is more the internal implementation these days. Should be a drop-in swap.
For the rebase itself, I don't think you need to touch `pathUtils.ts`, `pathUtils.test.ts`, or the app-root-prefixing bits of `Login.test.tsx`/`Register.test.tsx` at all — master's #39925 already covers that. The parts still uniquely yours are the OAuth login/register button work, the `app.py` icon prefixing, and the logout url fix, so those should be the only real conflicts.
Holler if you get stuck on it, happy to jump in.
--
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(superset_app_root): when used with oauth [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 #38033:
URL: https://github.com/apache/superset/pull/38033#discussion_r3564748669
##########
superset/app.py:
##########
@@ -81,6 +81,12 @@ def create_app(
# value of app_root so things work out of the box
if not app.config["STATIC_ASSETS_PREFIX"]:
app.config["STATIC_ASSETS_PREFIX"] = app_root
+ # Prefix APP_ICON path with subdirectory root for subdirectory deployments
+ if (
+ app.config.get("APP_ICON", "").startswith("/static/")
+ and app_root != "/"
+ ):
+ app.config["APP_ICON"] = f"{app_root}{app.config['APP_ICON']}"
Review Comment:
**Suggestion:** This rewrite hardcodes `APP_ICON` to `app_root + /static/...`, which ignores `STATIC_ASSETS_PREFIX` when operators use a CDN or a dedicated static prefix. In subdirectory deployments with a non-empty static prefix, the login/logo URL will point to the wrong host/path and break icon loading. Build the rewritten icon URL from `STATIC_ASSETS_PREFIX` (or only rewrite when that prefix is empty) instead of always using `app_root`. [logic error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ Navbar/logo image broken under CDN static prefix deployment.
- ⚠️ MCP server logo_url inconsistent with CDN asset host.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Configure Superset to use a CDN static prefix by setting STATIC_ASSETS_PREFIX in
superset_config.py; this value is loaded into app.config via create_app at
superset/app.py:60-63.
2. Deploy Superset under a subdirectory by setting SUPERSET_APP_ROOT (or passing
superset_app_root) so that app_root is computed as a non-root path (for example
"/superset") in superset/app.py:65-78.
3. On app startup, create_app in superset/app.py:52-92 runs; because app_root != "/", the
block at lines 79-91 executes. STATIC_ASSETS_PREFIX remains the CDN host (the condition at
line 82-83 is false), but the APP_ICON rewrite at lines 85-89 sets app.config["APP_ICON"]
= f"{app_root}{app.config['APP_ICON']}", producing a subdirectory-relative path like
"/superset/static/assets/images/superset-logo-horiz.png" that ignores the CDN
STATIC_ASSETS_PREFIX.
4. The theme token brandLogoUrl is derived from APP_ICON in superset/config.py:1060-1074,
and sent to the frontend via bootstrap_data (views/base.py:570-37). Under a deployment
where static assets are served only from the CDN STATIC_ASSETS_PREFIX, the browser
requests "/superset/static/..." from the app host instead of the CDN, causing the logo
image to fail to load on the login/navbar UI.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=3559f9031c234420827bb2d4b825cb8f&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=3559f9031c234420827bb2d4b825cb8f&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset/app.py
**Line:** 85:89
**Comment:**
*Logic Error: This rewrite hardcodes `APP_ICON` to `app_root + /static/...`, which ignores `STATIC_ASSETS_PREFIX` when operators use a CDN or a dedicated static prefix. In subdirectory deployments with a non-empty static prefix, the login/logo URL will point to the wrong host/path and break icon loading. Build the rewritten icon URL from `STATIC_ASSETS_PREFIX` (or only rewrite when that prefix is empty) instead of always using `app_root`.
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%2F38033&comment_hash=80f27712de7b006bf5b57c844ddab6947896a4e4a85117ba2a2ac0b76cf392d1&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38033&comment_hash=80f27712de7b006bf5b57c844ddab6947896a4e4a85117ba2a2ac0b76cf392d1&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(superset_app_root): when used with oauth [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-5043274521
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(superset_app_root): when used with oauth [superset]
Posted by "hannespr (via GitHub)" <gi...@apache.org>.
hannespr commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-3986128769
Thank you very much, @albundy83! First of all: Apologies :see_no_evil: - I made a mistake in my local setup with your PR - thats why the login button did not work.
:heavy_check_mark: Login button works
:heavy_check_mark: User Info works
:heavy_check_mark: Logoutworks
:red_circle: `brandLogoHref` is still prefixed with the app root, even for external URLs, e.g. /superset/http://... 🙈 - any idea on this?
But great job, very nice!
--
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(superset_app_root): when used with oauth [superset]
Posted by "albundy83 (via GitHub)" <gi...@apache.org>.
albundy83 commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-3986236729
> I think I found the problem:
>
> The logo url is wrapped with `ensureAppRoot`
>
> ```
> <StyledBrandLink href={ensureAppRoot(theme.brandLogoHref)}>
> ```
>
> but this method is not suited for external URLs - it will just mess them up. I am from the Java/Spring world 😄 - there I recently saw code which handles such cases like that:
>
> ```
> export function ensureAppRoot(path: string): string {
> if(path.beginsWith("http")
> return path
> ...
> ```
>
> If we assume that no one will start their internal paths with http... this is an effective way to detect external URLs which could also be implemented here. Brand URL should be typically external URL (I guess?), so a separate check, not using `ensureAppRoot` would also be fine in my opinion, although I like the first variant better as it is harder to get wrong.
>
> Regarding your question, I have configured my theme like this:
>
> ```
> {
> "algorithm": "default",
> "token": {
> "brandLogoUrl": "/static/assets/my-custom-stuff/images/logo.svg",
> "brandLogoHref": "https://example.com"
> }
> }
> ```
>
> which makes the upper left logo a link to that URL and exchanges the default Superset logo.
You are right, fix done :)
--
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(superset_app_root): when used with oauth [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-4047411543
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(superset_app_root): when used with oauth [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-4754862476
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(superset_app_root): when used with oauth [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on code in PR #38033:
URL: https://github.com/apache/superset/pull/38033#discussion_r3627546725
##########
superset-frontend/src/pages/Login/Login.test.tsx:
##########
@@ -31,27 +31,26 @@ const defaultBootstrapData = {
},
};
-const mockApplicationRoot = jest.fn<string, []>(() => '');
+jest.mock('src/utils/getBootstrapData', () => ({
+ __esModule: true,
+ default: jest.fn(() => defaultBootstrapData),
+}));
-jest.mock('src/utils/getBootstrapData', () => {
- const actual = jest.requireActual<
- typeof import('src/utils/getBootstrapData')
- >('src/utils/getBootstrapData');
- return {
- __esModule: true,
- ...actual,
- default: jest.fn(() => defaultBootstrapData),
- applicationRoot: () => mockApplicationRoot(),
- };
-});
+const mockEnsureAppRoot = jest.fn((path: string) => path);
+jest.mock('src/utils/pathUtils', () => ({
Review Comment:
<!-- Bito Reply -->
The suggestion is valid. Mocking the module that the component directly imports is necessary for the mock to intercept the function call, as re-exports do not automatically redirect imports to the original module's mock.
**superset-frontend/src/pages/Login/Login.test.tsx**
```
const mockEnsureAppRoot = jest.fn((path: string) => path);
jest.mock('src/utils/pathUtils', () => ({
```
##########
superset-frontend/src/pages/Login/index.tsx:
##########
@@ -96,15 +96,19 @@ export default function Login() {
}, []);
const loginEndpoint = useMemo(
- () => (nextUrl ? `/login/?next=${encodeURIComponent(nextUrl)}` : '/login/'),
+ () =>
+ ensureAppRoot(
+ nextUrl ? `/login/?next=${encodeURIComponent(nextUrl)}` : '/login/',
+ ),
[nextUrl],
);
const buildProviderLoginUrl = (providerName: string) => {
- const base = `/login/${encodeURIComponent(providerName)}`;
- return ensureAppRoot(
- nextUrl ? `${base}?next=${encodeURIComponent(nextUrl)}` : base,
- );
+ const base = `/login/${providerName}`;
Review Comment:
<!-- Bito Reply -->
The restoration of `encodeURIComponent` on the provider name is appropriate. This change ensures that provider names containing special characters or spaces are correctly handled, preventing the generation of malformed URLs and maintaining consistency with the existing encoding pattern used for the `nextUrl` parameter.
**superset-frontend/src/pages/Login/index.tsx**
```
const buildProviderLoginUrl = (providerName: string) => {
const base = `/login/${encodeURIComponent(providerName)}`;
return ensureAppRoot(
nextUrl ? `${base}?next=${encodeURIComponent(nextUrl)}` : base,
);
```
--
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(superset_app_root): when used with oauth [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-4906301867
Gave the branch update a shot and it won't rebase cleanly — #39925 reworked `ensureAppRoot` on master, so the `Login`/`Register` changes and their tests collide with what's there now.
@albundy83 could you rebase and drop what master already covers? Looks like the `app.py` icon prefixing and the logout fix are the parts still uniquely yours.
--
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(superset_app_root): when used with oauth [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 #38033:
URL: https://github.com/apache/superset/pull/38033#discussion_r3503508962
##########
superset/app.py:
##########
@@ -74,6 +74,9 @@ def create_app(
# value of app_root so things work out of the box
if not app.config["STATIC_ASSETS_PREFIX"]:
app.config["STATIC_ASSETS_PREFIX"] = app_root
+ # Prefix APP_ICON path with subdirectory root for subdirectory deployments
+ if app.config.get("APP_ICON", "").startswith("/static/"):
+ app.config["APP_ICON"] = f"{app_root}{app.config['APP_ICON']}"
Review Comment:
**Suggestion:** The new prefixing logic only handles icons that start with `/static/`, so valid root-relative custom icon paths (for example `/assets/logo.svg`) are left unprefixed and will still break when the app runs under a non-root `SUPERSET_APP_ROOT`. Prefix all root-relative local icon paths (while avoiding already-prefixed values) instead of hard-coding `/static/`. [incomplete implementation]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
⚠️ Subpath deployments show broken logo in Superset UI.
⚠️ MCP hello page logo URL missing app_root prefix.
⚠️ AppRootMiddleware rejects logo requests not starting app_root.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. In `superset/config.py:14`, note the default `APP_ICON =
"/static/assets/images/superset-logo-horiz.png"` and the comment at
`superset/config.py:11-13` explaining users may override `APP_ICON` via
`superset_config.py`; configure `APP_ICON = "/assets/logo.svg"` (a root-relative but
non-`/static/` path) so at runtime `app.config["APP_ICON"]` is `"/assets/logo.svg"`.
2. Start Superset with a non-root application path, e.g. `SUPERSET_APP_ROOT=/superset`; in
`superset/app.py:64-71` `create_app()` resolves `app_root` to `"/superset"` from
`superset_app_root` / `SUPERSET_APP_ROOT` / `APPLICATION_ROOT`.
3. In `create_app()`, when `app_root != "/"`, the new icon prefixing logic at
`superset/app.py:75-79` runs: it prefixes `APP_ICON` only if `app.config.get("APP_ICON",
"").startswith("/static/")`; because `APP_ICON` is `"/assets/logo.svg"`, this condition is
false and the value remains unprefixed.
4. The UI and services then use this unprefixed icon path: the theme base in
`superset/config.py:10-15` sets `brandLogoUrl` to `APP_ICON`, and the MCP server in
`superset/mcp_service/server.py:10-27` builds `logo_url` from `APP_ICON` for root-relative
paths; when the browser requests `"/assets/logo.svg"` under
`SUPERSET_APP_ROOT="/superset"`, `AppRootMiddleware.__call__` at `superset/app.py:26-35`
only serves requests whose `PATH_INFO` starts with `"/superset"` and returns `NotFound`
for others, so the logo image fails to load for subpath deployments using such
root-relative custom icons.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=ec76c63126a1464ca51228adcabe2a8a&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=ec76c63126a1464ca51228adcabe2a8a&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset/app.py
**Line:** 77:79
**Comment:**
*Incomplete Implementation: The new prefixing logic only handles icons that start with `/static/`, so valid root-relative custom icon paths (for example `/assets/logo.svg`) are left unprefixed and will still break when the app runs under a non-root `SUPERSET_APP_ROOT`. Prefix all root-relative local icon paths (while avoiding already-prefixed values) instead of hard-coding `/static/`.
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%2F38033&comment_hash=14835c608fed3b66a2820127ab09c0accba41719836b5f49bb384124344dbb27&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38033&comment_hash=14835c608fed3b66a2820127ab09c0accba41719836b5f49bb384124344dbb27&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(superset_app_root): when used with oauth [superset]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-4861164426
<!-- translation-regression-bot -->
## ⚠️ Translation Regression Detected
A source change in this PR renamed or reworded strings, invalidating existing translations (they are now `#, fuzzy`) in `fi`, `ru`, `th`. Please resolve the affected `.po` files before merging.
_Note: neither intentionally **deleting** a translatable string nor filling a previously-**untranslated** entry with a fuzzy guess (e.g. an AI backfill) is a regression — only a confirmed translation that a renamed/reworded source string turned fuzzy is flagged here._
| Language | Invalidated translations |
|----------|-------------------------:|
| `fi` | 1 |
| `ru` | 1 |
| `th` | 1 |
### How to fix
**1. Install dependencies** (if not already set up):
```bash
pip install -r superset/translations/requirements.txt
sudo apt-get install gettext # or: brew install gettext
```
**2. Re-extract strings and sync `.po` files:**
```bash
./scripts/translations/babel_update.sh
```
This rewrites `superset/translations/messages.pot` from the current source files and merges the changes into every `.po` file. Strings whose `msgid` changed will be marked `#, fuzzy`.
**3. Resolve the fuzzy entries** in the affected language files (`fi`, `ru`, `th`):
```bash
grep -n '#, fuzzy' superset/translations/<lang>/LC_MESSAGES/messages.po
```
For each fuzzy entry, either rewrite the `msgstr` to match the new string and remove the `#, fuzzy` line, or clear the `msgstr` to `""` if you cannot provide a translation.
**4. Commit your changes to the `.po` files.**
--
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