Skip to content

Conversation

@artemmufazalov
Copy link
Member

@artemmufazalov artemmufazalov commented Sep 18, 2025

Closes #2589

Stand: https://nda.ya.ru/t/dghhH4d_7K8SVn

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
378 373 0 3 2
Test Changes Summary ⏭️2

⏭️ Skipped Tests (2)

  1. Scroll to row, get shareable link, navigate to URL and verify row is scrolled into view (tenant/diagnostics/tabs/queries.test.ts)
  2. Copy result button copies to clipboard (tenant/queryEditor/queryEditor.test.ts)

Bundle Size: 🔺

Current: 85.40 MB | Main: 85.39 MB
Diff: +7.11 KB (0.01%)

⚠️ 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.
## Greptile Summary

Updated On: 2025-09-19 09:23:03 UTC

This PR introduces comprehensive support for YDB system views throughout the embedded UI. System views are dynamically generated database objects that provide access to system information (like partition statistics, node data, query metrics) and differ fundamentally from regular tables - they don't have physical storage, partitions, or tablets since data is computed on-the-fly.

The implementation adds a new path type EPathTypeSysView to the schema system and creates dedicated UI components for displaying system view information. Key changes include:

  • Type definitions: New TSysViewDescription interface and comprehensive ESysViewType union type covering 34 different system view types
  • Schema integration: System views are now recognized throughout the schema browser with appropriate column configurations (id, name, type, notNull) similar to external tables
  • Diagnostics customization: System views get a tailored diagnostics experience with only relevant tabs (overview, schema, nodes, describe, access) while hiding inapplicable tabs like tablets, hot keys, and data shards
  • UI components: New SystemViewInfo component displays system view metadata, and ObjectSummary shows system view type information
  • Navigation support: System views appear in navigation trees with 'system_table' icons and proper entity classification

The changes follow existing architectural patterns by extending type mappings, column configurations, and component routing to handle the new entity type. The implementation leverages the existing prepareRowTableSchema function for system views since they share similar column structure characteristics with row tables.

Important Files Changed

Changed Files
Filename Score Overview
src/containers/Tenant/Diagnostics/DiagnosticsPages.ts 5/5 Adds SYSTEM_VIEW_PAGES configuration with tailored diagnostic tabs for system views
src/utils/schema.ts 4/5 Introduces prepareSystemViewType utility function for formatting system view enum values
src/types/api/schema/sysView.ts 5/5 Defines comprehensive TypeScript types for system views including 34 different view types
src/containers/Tenant/Schema/SchemaViewer/columns.tsx 5/5 Adds getSystemViewColumns function for displaying system view schema information
src/containers/Tenant/Schema/SchemaViewer/SchemaViewer.tsx 5/5 Integrates system view column configuration into the schema viewer component
src/types/api/schema/schema.ts 5/5 Adds EPathTypeSysView path type and TSysViewDescription to core schema types
src/containers/Tenant/Schema/SchemaViewer/prepareData.ts 5/5 Extends schema data preparation to handle system views using existing row table logic
src/containers/Tenant/Diagnostics/Overview/Overview.tsx 5/5 Maps system view path type to SystemViewInfo component for diagnostics overview
src/containers/Tenant/Info/SystemView/SystemView.tsx 4/5 New component for displaying system view information with proper error handling
src/containers/Tenant/utils/schema.ts 4/5 Comprehensive system view support across all type mappings and utility functions
src/containers/Tenant/ObjectSummary/ObjectSummary.tsx 4/5 Adds system view type display to object summary overview with proper formatting

Confidence score: 4/5

  • This PR is safe to merge with well-structured implementation following established patterns
  • Score reflects solid architectural decisions and comprehensive coverage, but some i18n consistency issues need attention
  • Pay close attention to i18n key naming consistency and translation file completeness across system view components

Sequence Diagram

sequenceDiagram
    participant User
    participant DiagnosticsPages
    participant Overview
    participant overviewApi
    participant SystemViewInfo
    participant ObjectSummary
    participant SchemaViewer

    User->>DiagnosticsPages: "Navigate to system view"
    DiagnosticsPages->>DiagnosticsPages: "getPagesByType(EPathTypeSysView)"
    DiagnosticsPages->>DiagnosticsPages: "Returns SYSTEM_VIEW_PAGES"
    
    User->>Overview: "View system view overview"
    Overview->>overviewApi: "useGetOverviewQuery({path, database, databaseFullPath})"
    overviewApi-->>Overview: "Returns system view data"
    Overview->>Overview: "pathTypeToComponent[EPathTypeSysView]"
    Overview->>SystemViewInfo: "Render SystemViewInfo component"
    SystemViewInfo->>SystemViewInfo: "prepareSystemViewItems(data)"
    SystemViewInfo->>SystemViewInfo: "prepareSystemViewType(systemViewType)"
    SystemViewInfo-->>Overview: "YDBDefinitionList with system view type"
    
    User->>ObjectSummary: "View system view summary"
    ObjectSummary->>ObjectSummary: "getPathTypeOverview[EPathTypeSysView]()"
    ObjectSummary->>ObjectSummary: "prepareSystemViewType(PathDescription?.SysViewDescription?.Type)"
    ObjectSummary-->>User: "Display system view type field"
    
    User->>SchemaViewer: "View system view schema"
    SchemaViewer->>SchemaViewer: "isSystemViewType(type)"
    SchemaViewer->>SchemaViewer: "prepareSchemaData(type, tableSchemaData)"
    SchemaViewer->>SchemaViewer: "getSystemViewColumns(tableData)"
    SchemaViewer-->>User: "Display system view columns with id, name, type, notNull"
Loading

Context used:

Style Guide - description of repository for agents (link)

@artemmufazalov artemmufazalov force-pushed the 2589-support-system-views branch from 2ba9f6a to 9c0016c Compare September 19, 2025 07:55
Copy link
Contributor

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 adds first-class support for “System view” entities across types, schema visualization, diagnostics pages, and summary/info panels.

  • Introduces a new EPathTypeSysView and TSysViewDescription types and wires them into existing mappings.
  • Extends SchemaViewer (data + columns) and Diagnostics pages to render System views similarly to row tables.
  • Adds UI labels and info panel for System view type.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/utils/schema.ts Adds prepareSystemViewType to format ESysViewType for display.
src/types/api/schema/sysView.ts Introduces TSysViewDescription and ESysViewType union.
src/types/api/schema/schema.ts Adds SysViewDescription to TPathDescription and EPathTypeSysView.
src/containers/Tenant/utils/schema.ts Maps EPathTypeSysView to node type, entity name, and boolean classifiers.
src/containers/Tenant/Schema/SchemaViewer/prepareData.ts Treats System view like a row table for schema preparation.
src/containers/Tenant/Schema/SchemaViewer/columns.tsx Adds getSystemViewColumns.
src/containers/Tenant/Schema/SchemaViewer/SchemaViewer.tsx Chooses System view columns when type is EPathTypeSysView.
src/containers/Tenant/ObjectSummary/i18n/en.json Adds i18n key for “System view type” in Object Summary.
src/containers/Tenant/ObjectSummary/ObjectSummary.tsx Shows System view type in summary via prepareSystemViewType.
src/containers/Tenant/Info/i18n/en.json Adds i18n keys for System view info panel and generic “no data” message.
src/containers/Tenant/Info/SystemView/SystemView.tsx New info panel for System view with type display.
src/containers/Tenant/Diagnostics/Overview/Overview.tsx Renders SystemViewInfo in Overview for system views.
src/containers/Tenant/Diagnostics/DiagnosticsPages.ts Defines SYSTEM_VIEW_PAGES and maps EPathTypeSysView to these pages.

Copy link
Contributor

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

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Copy link
Contributor

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

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

@artemmufazalov artemmufazalov marked this pull request as ready for review September 19, 2025 09:13
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

11 files reviewed, 3 comments

Edit Code Review Bot Settings | Greptile

if (!type) {
return undefined;
}
if (type.startsWith('E')) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

That looks fragile - would be great if you left some comment what and why is 'E'

Copy link
Member Author

Choose a reason for hiding this comment

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

Added comment

@ydb-platform ydb-platform deleted a comment from greptile-apps bot Sep 19, 2025
@ydb-platform ydb-platform deleted a comment from greptile-apps bot Sep 19, 2025
const entityName = getEntityName(data?.PathDescription);

if (!data) {
return <div className="error">{i18n('no-entity-data', {entityName})}</div>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

As far as I know we use b() for classes usually

Copy link
Member Author

Choose a reason for hiding this comment

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

Replaced with <Text color='danger'>

astandrik
astandrik previously approved these changes Sep 19, 2025
@artemmufazalov artemmufazalov added this pull request to the merge queue Sep 19, 2025
Merged via the queue into main with commit b4e749a Sep 19, 2025
7 checks passed
@artemmufazalov artemmufazalov deleted the 2589-support-system-views branch September 19, 2025 11:21
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.

Display system views

3 participants