-
Notifications
You must be signed in to change notification settings - Fork 17
feat: use environment in paths #3020
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
66 files reviewed, no comments
artemmufazalov
requested changes
Oct 28, 2025
artemmufazalov
requested changes
Oct 30, 2025
artemmufazalov
previously approved these changes
Oct 30, 2025
artemmufazalov
approved these changes
Oct 30, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #2935
Stand - only this one cluster is supported for now.
Greptile Overview
Updated On: 2025-10-28 10:47:53 UTC
Greptile Summary
This PR introduces environment-based routing to support different authentication services based on cluster environment. The implementation adds an optional
environmentparameter to all major routes (/:environment?/cluster,/:environment?/tenant, etc.) and extracts the environment from the URL's first path segment.Key Changes:
/cloud-prod/cluster)allowedEnvironmentslistuseVDiskPagePath,useStorageGroupPath,useTabletPagePath) to ensure database context is properly included in generated pathsArchitecture:
getUrlDatacreateHrefto maintain consistent routingThe changes are well-structured and include comprehensive test coverage for environment extraction logic.
Confidence Score: 4/5
src/routes.tsfor route matching logic with optional environment parameterImportant Files Changed
File Analysis
Sequence Diagram
sequenceDiagram participant App as App Init participant URL as getUrlData participant Store as configureStore participant Routes as Route Handler participant API as MetaAPI participant Component as React Component App->>URL: Extract URL data Note over URL: Parse pathname<br/>Check first segment<br/>against allowedEnvironments URL-->>Store: {environment, basename, backend, clusterName} Store->>Store: Set global environment variable Store->>Store: window.environment = environment Note over Component: User navigates to page Component->>Component: useVDiskPagePath() hook Note over Component: Hook captures database<br/>from query params Component->>Routes: createHref(route, params, query) Routes->>Routes: Add environment to params if set Routes->>Routes: Add database to query Routes-->>Component: /environment/vDisk?nodeId=X&vDiskId=Y&database=Z Component->>API: API request with path API->>API: getPath(path, clusterName) Note over API: Prepend environment<br/>if proxyMeta enabled API-->>API: /environment/api/meta3/proxy/cluster/name/path API->>API: Make HTTP request API-->>Component: Response dataCI Results
Test Status:⚠️ FLAKY
📊 Full Report
Test Changes Summary ⏭️2
⏭️ Skipped Tests (2)
Bundle Size: 🔺
Current: 47.08 MB | Main: 47.08 MB
Diff: +6.20 KB (0.01%)
ℹ️ CI Information