feat(Header): add link to shared DB for serverless - #4254
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 55a82fc3e4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5a122139dc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c542f1878a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 58f70b9fa1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
astandrik
left a comment
There was a problem hiding this comment.
Requesting changes for the storage-heavy shared-name lookup and the proxy-mode error path. Please restore focused hook coverage for loading/error, ID/name selection, and runtime identity while fixing them.
| const isMetaDatabasesAvailable = useDatabasesV2(); | ||
| const {settings, isResolved: isClusterBaseInfoResolved} = useClusterBaseInfo(); | ||
|
|
||
| const useDatabaseId = uiFactory.useDatabaseId && settings?.use_meta_proxy !== false; |
There was a problem hiding this comment.
Do not treat a failed settings request as a resolved proxy mode.
Repro:
- Configure a package consumer with
useDatabaseId: truewhile the cluster hasuse_meta_proxy: false. - Let the Serverless database request succeed, but make cluster-base-info fail.
- Open the database menu.
The cluster hook counts isError as resolved. settings stays undefined, so this expression selects ID mode. The link then uses ResourceId, which direct Viewer cannot resolve.
Keep the action hidden on this error path, or expose enough query state to distinguish success/no-fetch from failure. Add a hook test for the error case.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 589b574026
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 88a7ec0d60
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return ( | ||
| sharedDatabaseNameFromViewer ?? | ||
| databases?.find(({Id}) => Id === databaseData?.ResourceId)?.Name | ||
| ); |
There was a problem hiding this comment.
Derive the backend from the shared database
When meta-proxy routing is disabled and “Use cluster balancer as backend” is off, prepareTenantBackend needs a node ID belonging to the destination database. The lookup finds the shared tenant but retains only its Name, and line 152 subsequently prepares the link from the serverless databaseData; database metadata fetched individually commonly has no shared node IDs, so this falls back to the current serverless backend and can route the shared-database URL through the wrong node. Preserve the matched shared tenant (or its NodeIds) and derive the target backend from it.
AGENTS.md reference: AGENTS.md:L89-L89
Useful? React with 👍 / 👎.
Greptile Summary
This change adds a viewer-only header action that lets users navigate from a serverless database to its shared database.
The shared-database target is selected as a resource ID while cluster settings are unresolved. When
use_meta_proxylater resolves tofalse, the target switches to the shared database name. The action can therefore expose an ID-based route during loading for clusters that ultimately require name-based routing.T-Rex validation blocked
The focused UI test exercised the loading and resolved-settings states, but a live YDB viewer backend service was unavailable to open the transient resource-ID route and observe its backend response.
Confidence Score: 4/5
The header action should wait for the proxy configuration before choosing a route representation, so viewers are not directed to an unsupported shared-database URL.
A focused rendered-component test confirmed that unresolved settings produce a resource-ID URL and that resolving
use_meta_proxyto false changes the route to the shared database name. The backend response for the transient route could not be observed without a live viewer service.Files Needing Attention: src/containers/Header/HeaderActionsMenu.tsx
What T-Rex did
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "feat(Header): add link to shared DB for ..." | Re-trigger Greptile
CI Results
Test Status:⚠️ FLAKY
📊 Full Report
Test Changes Summary ✨3
✨ New Tests (3)
Bundle Size: 🔺
Current: 65.58 MB | Main: 65.56 MB
Diff: +0.02 MB (0.03%)
ℹ️ CI Information