-
Notifications
You must be signed in to change notification settings - Fork 13
feat: enable basename for multi cluster version #2153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
59f6d10
to
a7ee12d
Compare
@@ -69,6 +69,7 @@ | |||
"build": "rm -rf build && DISABLE_ESLINT_PLUGIN=true CI=true react-app-rewired build", | |||
"//build:embedded": "echo 'PUBLIC_URL is a setting for create-react-app. Embedded version is built and hosted as is on ydb servers, with no way of knowing the final URL pattern. PUBLIC_URL=. keeps paths to all static relative, allowing servers to handle them as needed'", | |||
"build:embedded": "GENERATE_SOURCEMAP=false PUBLIC_URL=. REACT_APP_BACKEND=http://localhost:8765 REACT_APP_META_BACKEND=undefined npm run build", | |||
"build:embedded-mc": "GENERATE_SOURCEMAP=false PUBLIC_URL=. REACT_APP_BACKEND= REACT_APP_META_BACKEND= npm run build", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build embedded multi-cluster version - app host is used as meta backend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enables support for a basename in multi-cluster environments and updates URL generation utilities used throughout the application. Key changes include calculating a dynamic basename from the URL, propagating the basename through route generation via an optional parameter, and updating tenant and cluster link creation to include this basename when needed.
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/store/getUrlData.ts | Adds logic to extract basename and adjust backend selection logic. |
src/routes.ts | Updates createHref to support a withBasename option and adjusts routing. |
src/containers/Tenant/TenantPages.tsx | Updates getTenantPath usage to pass basename options. |
src/containers/Clusters/columns.tsx | Adjusts getClusterPath calls to include withBasename option. |
src/containers/Cluster/utils.tsx | Extends getClusterPath signature to accept an options parameter. |
src/components/TenantNameWrapper/TenantNameWrapper.tsx | Forwards the basename flag via getTenantPath using isExternalLink. |
Files not reviewed (1)
- package.json: Language not supported
Comments suppressed due to low confidence (1)
src/components/TenantNameWrapper/TenantNameWrapper.tsx:75
- The variable 'isExternalLink' is used without a visible declaration in this diff. Ensure that 'isExternalLink' is defined or imported appropriately to avoid runtime issues.
{withBasename: isExternalLink},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- package.json: Language not supported
Single-cluster: https://nda.ya.ru/t/oDJve8ZJ7DegLK
Single-cluster with different
node/nodeId
in basename: https://nda.ya.ru/t/caHorlkS7DekGYEmbedded multi-cluster: https://nda.ya.ru/t/nrYduBdV7DegaP
Closes #2106
CI Results
Test Status:⚠️ FLAKY
📊 Full Report
😟 No changes in tests. 😕
Bundle Size: ✅
Current: 83.36 MB | Main: 83.36 MB
Diff: +1.88 KB (0.00%)
✅ Bundle size unchanged.
ℹ️ CI Information