Skip to content

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

Merged
merged 5 commits into from
Apr 18, 2025

Conversation

artemmufazalov
Copy link
Member

@artemmufazalov artemmufazalov commented Apr 15, 2025

Single-cluster: https://nda.ya.ru/t/oDJve8ZJ7DegLK
Single-cluster with different node/nodeId in basename: https://nda.ya.ru/t/caHorlkS7DekGY
Embedded multi-cluster: https://nda.ya.ru/t/nrYduBdV7DegaP

Closes #2106

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
318 315 0 3 0

😟 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
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

@artemmufazalov artemmufazalov force-pushed the 2106-basename-for-multi-cluster branch from 59f6d10 to a7ee12d Compare April 15, 2025 18:49
@@ -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",
Copy link
Member Author

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

@artemmufazalov artemmufazalov marked this pull request as ready for review April 16, 2025 07:57
Copy link
Contributor

@Copilot Copilot AI left a 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},

@artemmufazalov artemmufazalov requested a review from Copilot April 16, 2025 09:52
Copy link
Contributor

@Copilot Copilot AI left a 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

@artemmufazalov artemmufazalov added this pull request to the merge queue Apr 18, 2025
Merged via the queue into main with commit 91963b9 Apr 18, 2025
7 checks passed
@artemmufazalov artemmufazalov deleted the 2106-basename-for-multi-cluster branch April 18, 2025 16:15
@artemmufazalov artemmufazalov mentioned this pull request Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Build]: enable UI to work from folder other than monitoring
2 participants