Skip to content

feat(Header): add link to shared DB for serverless - #4254

Open
Raubzeug wants to merge 10 commits into
mainfrom
show-shared
Open

feat(Header): add link to shared DB for serverless#4254
Raubzeug wants to merge 10 commits into
mainfrom
show-shared

Conversation

@Raubzeug

@Raubzeug Raubzeug commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

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_proxy later resolves to false, 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_proxy to 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

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex attempted a focused rendered-component test with settings undefined, then settings.use_meta_proxy = false, using different resource-ID and shared-name values; the test observed the initial ID route /database?clusterName=main&database=shared-resource-id and the resolved name route /database?clusterName=main&database=%2FRoot%2Fshared, but a live YDB viewer backend was unavailable, so opening the transient ID route and observing the claimed backend resolution failure could not be completed.
  • The test outcome was blocked / inconclusive on the claimed backend usability, while the premature ID-link state was supported by the executed focused UI test, and the test logged the initial ID href, the transient hidden state after use_meta_proxy:false, and the final shared-name href, with a recommended next action to run the same browser flow against a viewer fixture or live viewer backend and capture the actual request/response, deferring if useClusterProxySettingResolved() is not true.

View all artifacts

T-Rex Ran code and verified through T-Rex

Fix all with Greploop Fix All in Codex Fix All in Claude Code

Prompt To Fix All With AI
### Issue 1
src/containers/Header/HeaderActionsMenu.tsx:48
**Unresolved proxy mode selects IDs**

When `uiFactory.useDatabaseId` is enabled and cluster settings are still loading before resolving `use_meta_proxy` to false, this expression selects `ResourceId` mode prematurely, causing the menu to expose a database-ID URL that the active viewer backend does not resolve.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "feat(Header): add link to shared DB for ..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
950 949 0 1 0
Test Changes Summary ✨3

✨ New Tests (3)

  1. resolves the shared database with describe for a monitoring user (tenant/headerActions.test.ts)
  2. uses a storage-free tenant lookup for a viewer-only user (tenant/headerActions.test.ts)
  3. falls back to a storage-free tenant lookup when describe fails (tenant/headerActions.test.ts)

Bundle Size: 🔺

Current: 65.58 MB | Main: 65.56 MB
Diff: +0.02 MB (0.03%)

⚠️ Bundle size increased. Please review.

ℹ️ 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.

@Raubzeug
Raubzeug marked this pull request as ready for review August 20, 2026 09:28
Copilot AI lite review requested due to automatic review settings August 20, 2026 09:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread src/containers/Header/HeaderActionsMenu.tsx Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/containers/Header/hooks/useSharedDatabasePath.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/containers/Header/hooks/useSharedDatabasePath.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/containers/Header/hooks/useSharedDatabasePath.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/containers/Header/hooks/useSharedDatabasePath.ts Outdated
Comment thread src/containers/Header/hooks/useSharedDatabasePath.ts

@astandrik astandrik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not treat a failed settings request as a resolved proxy mode.

Repro:

  1. Configure a package consumer with useDatabaseId: true while the cluster has use_meta_proxy: false.
  2. Let the Serverless database request succeed, but make cluster-base-info fail.
  3. 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/containers/Header/hooks/useSharedDatabasePath.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +140 to +143
return (
sharedDatabaseNameFromViewer ??
databases?.find(({Id}) => Id === databaseData?.ResourceId)?.Name
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants