Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 4, 2025

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

This PR adds a Network tab to the individual node page, displaying connectivity data that helps users understand network topology and relationships between nodes.

Changes Made

New Network Tab

  • Added a "Network" tab to the node page (alongside Storage, Tablets, Threads tabs) that displays:
    • Current node visualization on the left side
    • Network peers connectivity on the right side
    • Problem filtering capabilities to show all nodes or only problematic connections
    • Toggle options for displaying node IDs and rack information

UI Components

  • Created NodeNetwork component that follows the same pattern as the database network tab
  • Reuses existing NodeNetwork component from the database diagnostics for consistent visualization
  • Integrates seamlessly with existing node page tab navigation
  • Shows current node and filters network data specifically for that node

Tab Configuration

  • Added "network" to NODE_TABS_IDS and NODE_TABS configuration
  • Updated node page routing to handle the network tab
  • Added network tab case to the renderTabContent switch in Node.tsx

Internationalization

  • Added network tab label following project i18n conventions:
    • "Network" tab title

Technical Implementation

The implementation leverages the existing network API (networkApi.useGetNetworkInfoQuery) and filters the results to focus on the current node and its peers. The network tab uses the same visual components and interaction patterns as the database network tab, providing a consistent user experience.

The network information is fetched only when a tenant name is available, and the component gracefully handles cases where no network data or peers are found.

Visual Impact

The network tab provides users with:

  • Visual representation of the current node and its network peers
  • Interactive problem filtering to focus on connectivity issues
  • Consistent styling and behavior with other node page tabs
  • Clear separation between current node and peer nodes

This enhancement improves the monitoring and debugging experience for YDB cluster administrators by making network relationships more visible and accessible at the individual node level.

Fixes #2428.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Greptile Overview

Greptile Summary

This PR adds a Network tab to the individual node page, displaying the current node and its network peers with connectivity visualization.

Key Changes:

  • Created new NodeNetwork component that filters network data to show current node and its peers
  • Added network tab to node page configuration with proper i18n support
  • Reuses existing NodeNetwork component from database diagnostics for consistent visualization
  • Implements problem filtering and display options (node IDs, rack information)

The implementation follows established patterns from the tenant diagnostics Network component and correctly integrates with the existing node page tab system.

Confidence Score: 4/5

  • This PR is safe to merge with low risk - it adds a new feature following established patterns
  • The implementation correctly follows existing patterns from the tenant diagnostics Network component. Previous comments about missing useMemo optimizations are inconsistent with the codebase - the similar Network.tsx implementation in Tenant/Diagnostics also doesn't use useMemo for groupNodesByField calls (lines 61-62). While AGENTS.md recommends memoization for expensive computations, the groupNodesByField operations on small peer arrays are not expensive enough to require memoization in this context, matching the pattern used throughout the codebase. The feature adds proper error handling, loading states, and integrates cleanly with existing tab navigation.
  • No files require special attention - all changes follow established patterns

Important Files Changed

File Analysis

Filename Score Overview
src/containers/Node/Network/NodeNetwork.tsx 4/5 New component that displays network connectivity for individual node, filtering network data to show current node and its peers
src/containers/Node/Node.tsx 5/5 Added network tab case to renderTabContent switch statement
src/containers/Node/NodePages.ts 5/5 Extended NODE_TABS_IDS and NODE_TABS to include network tab with proper i18n support

Sequence Diagram

sequenceDiagram
    participant User
    participant NodePage as Node.tsx
    participant NodeNetwork as NodeNetwork.tsx
    participant NetworkAPI as networkApi
    participant Redux as Redux Store
    participant Components as UI Components

    User->>NodePage: Navigate to node page with network tab
    NodePage->>NodePage: Parse activeTabId from URL
    NodePage->>NodePage: Filter available tabs based on node capabilities
    
    alt Network tab selected
        NodePage->>NodeNetwork: Render NodeNetwork component
        NodeNetwork->>Redux: Get auto refresh interval
        NodeNetwork->>Redux: Get problem filter state
        NodeNetwork->>NetworkAPI: useGetNetworkInfoQuery(tenantName)
        NetworkAPI-->>NodeNetwork: Return network data or loading state
        
        alt Data loading
            NodeNetwork->>Components: Show loader
            Components-->>User: Display loading spinner
        else Data loaded successfully
            NodeNetwork->>NodeNetwork: Find current node from allNodes by nodeId
            NodeNetwork->>NodeNetwork: Extract peers from current node
            NodeNetwork->>NodeNetwork: Group current node by NodeType
            NodeNetwork->>NodeNetwork: Group peers by NodeType
            NodeNetwork->>Components: Render controls (ProblemFilter, checkboxes)
            NodeNetwork->>Components: Render current node section with Nodes component
            NodeNetwork->>Components: Render network peers section with Nodes component
            Components-->>User: Display network visualization
        else No current node found
            NodeNetwork->>Components: Show error message
            Components-->>User: Display 'No network data found for node'
        else No nodes data
            NodeNetwork->>Components: Show error message
            Components-->>User: Display 'No nodes data'
        else Error occurred
            NodeNetwork->>Components: Show ResponseError
            Components-->>User: Display error message
        end
    end

    User->>NodeNetwork: Toggle problem filter
    NodeNetwork->>Redux: Dispatch changeFilter action
    Redux-->>NodeNetwork: Update filter state
    NodeNetwork->>Components: Re-render Nodes with new filter
    Components-->>User: Update display based on filter

    User->>NodeNetwork: Toggle show ID checkbox
    NodeNetwork->>NodeNetwork: Update showId state
    NodeNetwork->>Components: Re-render Nodes with updated prop
    Components-->>User: Toggle node ID visibility

    User->>NodeNetwork: Toggle show racks checkbox
    NodeNetwork->>NodeNetwork: Update showRacks state
    NodeNetwork->>Components: Re-render Nodes with rack grouping
    Components-->>User: Toggle rack visualization

    User->>Components: Hover over node
    Components->>Redux: Dispatch showTooltip action
    Redux-->>User: Display node tooltip

    User->>Components: Mouse leave node
    Components->>Redux: Dispatch hideTooltip action
    Redux-->>User: Hide tooltip
Loading

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: 66.15 MB | Main: 66.11 MB
Diff: +0.04 MB (0.05%)

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

Copilot AI changed the title [WIP] return node network information on node page feat: add network peer information to node page Sep 4, 2025
Copilot AI requested a review from adameat September 4, 2025 07:16
Copilot finished work on behalf of adameat September 4, 2025 07:16
@adameat
Copy link
Member

adameat commented Sep 12, 2025

@copilot no, you needed to add another tab on the node page. like storage, tablets, threads - there is should be a network tab, very similar to database's network tab. but with filter by current node.

Copy link
Contributor Author

Copilot AI commented Sep 12, 2025

@copilot no, you needed to add another tab on the node page. like storage, tablets, threads - there is should be a network tab, very similar to database's network tab. but with filter by current node.

You're absolutely right! I've corrected the implementation to add a proper "Network" tab to the node page (alongside Storage, Tablets, Threads tabs) instead of just adding network info to the node information panel.

The new Network tab shows:

  • Current node visualization on the left
  • Network peers connectivity on the right
  • Problem filtering capabilities
  • ID and Rack display options
  • Reuses existing network components for consistency

This matches the database network tab pattern but filtered specifically for the current node. Changes in commit d420599.

Copilot AI changed the title feat: add network peer information to node page feat: add network tab to node page with peer connectivity visualization Sep 12, 2025
Copilot finished work on behalf of adameat September 12, 2025 04:26
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.

2 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

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.

4 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

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.

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@DaryaVorontsova DaryaVorontsova self-assigned this Nov 14, 2025
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.

return node network information on node page

3 participants