-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat(dashboard): enabling multi region setup from single dashboard and clerk #9262
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
…ket hostnames - Introduced a new `RegionProvider` to manage region selection and API hostname updates. - Added `RegionSelector` component for users to select their region. - Integrated `apiHostnameManager` to handle API and WebSocket hostnames based on selected region. - Updated various components and pages to utilize the new region context and hostname management. - Implemented region detection from organization metadata for improved user experience.
- Added URL-based region detection to replace localStorage approach for improved reliability. - Introduced new constants for dashboard URLs specific to regions. - Updated `RegionProvider` to utilize URL detection for initial region selection and organization switching. - Enhanced `findOrganizationForRegion` and `getDashboardUrlForRegion` functions to support new detection logic. - Improved logging for better debugging and user feedback during region changes.
- Updated region handling to redirect users to the correct dashboard URL if the URL region does not match the organization's region. - Improved logging for clarity on region mismatches and redirection actions. - Simplified the logic for updating the selected region state when the URL and organization match.
…on creation flow - Eliminated unnecessary console logs in `create-organization.tsx` and `region-context.tsx` for cleaner code and improved performance. - Updated organization creation flow to focus on telemetry tracking without logging sensitive information. - Enhanced region handling logic to ensure consistent URL redirection during organization creation and selection.
- Improved debug logging in `RegionProvider` to provide better insights during region switching and organization creation. - Updated logic to prevent redirection during organization creation when selecting existing organizations, ensuring a smoother user experience. - Clarified comments and streamlined the handling of region mismatches for better maintainability.
- Removed fallback logic for `API_HOSTNAME_SG` and `WEBSOCKET_HOSTNAME_SG`, directly assigning values from environment variables. - Streamlined configuration for better clarity and maintainability.
- Removed fallback logic for `DASHBOARD_URL_SG`, directly assigning the value from environment variables for improved clarity and maintainability.
- Introduced a new `region-config.ts` file to manage multi-region setup, allowing dynamic loading of region-specific configurations from environment variables. - Updated `RegionSelector` to dynamically generate region options based on the configured regions. - Refactored region-related utility functions to utilize the new configuration system, enhancing maintainability and flexibility. - Improved region detection logic to support multiple regions and fallback mechanisms.
- Updated region parsing to dynamically determine the base region from the VITE_REGIONS environment variable. - Simplified the assignment of environment variables for dashboard URLs, API hostnames, and region flags based on whether the region is the base region or not. - Improved comments for clarity on the configuration logic and fallback mechanisms for non-base regions. - Enhanced logging to provide better insights when essential configuration is missing.
✅ Deploy Preview for dashboard-v2-novu-staging canceled.
|
Hey there and thank you for opening this pull request! 👋 We require pull request titles to follow specific formatting rules and it looks like your proposed title needs to be adjusted. Your PR title is: Requirements:
Expected format: Details: PR title must end with 'fixes TICKET-ID' (e.g., 'fixes NOV-123') or include ticket ID in branch name |
- Introduced environment variables for multi-region support, allowing configuration for both US and Singapore regions. - Added detailed comments to guide users on how to extend the configuration for additional regions. - Defined base and additional region-specific URLs, API hostnames, and AWS regions for improved deployment flexibility.
- Eliminated comments regarding the localStorage-based region initialization in `region-context.tsx` and `region-utils.ts`, as the logic has been updated to rely solely on URL-based detection for improved reliability and clarity.
- Removed outdated comments in `region-config.ts`, `region-context.tsx`, and `region-utils.ts` to enhance clarity and maintainability. - Simplified comments related to environment variable usage and region mapping for better understanding of the configuration logic. - Improved overall readability of the region handling code by eliminating unnecessary explanations.
- Updated the API client to wait for region switching to complete before making API calls, enhancing reliability during transitions. - Removed outdated comments in the organization creation flow to streamline the code and focus on telemetry tracking. - Refined region switching logic in the RegionProvider to ensure accurate state management during region changes.
…ontext - Eliminated the region switching checks from the API client, streamlining API call handling. - Removed redundant region switching state management from the RegionProvider to enhance clarity and maintainability. - Cleaned up the HostnameManager by removing the region switching state, simplifying the overall logic.
- Renamed identification flags for clarity and separated user and organization identification states. - Enhanced user identification logic to ensure proper tracking with LaunchDarkly. - Streamlined organization identification process, ensuring accurate monitoring and telemetry tracking. - Cleaned up unused variables and improved overall readability of the IdentityProvider component.
This pull request introduces support for region-aware API and WebSocket endpoints throughout the dashboard application, including the addition of a region selector to the authentication and navigation flows. It refactors several components to use a new
apiHostnameManager
utility for dynamic hostname resolution, ensures telemetry captures region metadata during organization creation, and updates the deployment workflow to support a newstaging-apse1
environment. Minor code style improvements (such as consistent use of double quotes) are also included.Region-aware API and WebSocket endpoints:
api.client.ts
,inbox-preview-content.tsx
,inbox-button.tsx
,configuration-group.tsx
,simple-prompt-getter.ts
) to useapiHostnameManager
for dynamic selection of API and WebSocket hostnames, enabling region switching and improved reliability during region changes. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Region selector integration:
RegionSelector
component to the organization creation flow (create-organization.tsx
), header navigation (header-navigation.tsx
), and telemetry tracking, allowing users to select their region during onboarding and navigation. [1] [2] [3] [4] [5] [6]Deployment workflow enhancements:
.github/workflows/deploy.yml
to add support for thestaging-apse1
environment, including input options and environment matrix logic, and standardized YAML quoting for improved consistency. [1] [2] [3] [4] [5] [6] [7]Miscellaneous improvements:
SECRET_NAME
environment variable for improved flexibility..source
file.These changes collectively improve the dashboard's support for multi-region deployments and user experience around region selection and API reliability.