Skip to content

Conversation

@astandrik
Copy link
Collaborator

@astandrik astandrik commented Nov 12, 2025

Closes #3073

greptile-review

Greptile Overview

Greptile Summary

Extended the monitoring link generator to accept ControlPlane and UserAttributes from tenant data, enabling external implementations to customize monitoring URLs based on these additional database properties.

Key Changes:

  • Added controlPlane and userAttributes parameters to GetMonitoringLinkProps interface in src/utils/monitoring.ts:4-11
  • Updated Header.tsx:102-103 to pass databaseData.ControlPlane and databaseData.UserAttributes to uiFactory.getMonitoringLink
  • Type imports extended to include TTenant for proper typing of new parameters

Issue Found:

  • The getMonitoringLink function signature accepts the new parameters but doesn't use them in the implementation (src/utils/monitoring.ts:15-20). This suggests the PR provides the interface extension for external implementations (via uiFactory.getMonitoringLink) but the default implementation doesn't need these values yet.

Confidence Score: 3/5

  • PR is mostly safe but has incomplete implementation where parameters are passed but unused
  • The changes correctly extend the interface and pass additional database metadata to the monitoring link generator. However, the implementation is incomplete - controlPlane and userAttributes are added to the function signature but never used in the function body. This could be intentional (for external implementations) but suggests either incomplete work or missing documentation explaining the intended usage pattern.
  • Review src/utils/monitoring.ts - ensure the unused parameters are intentional or complete the implementation

Important Files Changed

File Analysis

Filename Score Overview
src/containers/Header/Header.tsx 5/5 Passes controlPlane and userAttributes from database data to monitoring link generator
src/utils/monitoring.ts 2/5 Added interface parameters for controlPlane and userAttributes, but function doesn't use them

Sequence Diagram

sequenceDiagram
    participant Header as Header Component
    participant TenantAPI as Tenant API
    participant UIFactory as UI Factory
    participant MonitoringUtil as getMonitoringLink
    
    Header->>TenantAPI: getTenantInfo(database, clusterName)
    TenantAPI-->>Header: databaseData (TTenant)
    
    Note over Header: Extract fields from databaseData:<br/>Name, Type, ControlPlane, UserAttributes
    
    Header->>UIFactory: uiFactory.getMonitoringLink({<br/>monitoring, clusterName, dbName,<br/>dbType, controlPlane, userAttributes})
    
    UIFactory->>MonitoringUtil: getMonitoringLink(params)
    
    Note over MonitoringUtil: ⚠️ controlPlane and userAttributes<br/>parameters accepted but unused
    
    MonitoringUtil->>MonitoringUtil: parseMonitoringData(monitoring)
    MonitoringUtil->>MonitoringUtil: Build URL with dbName,<br/>dbType, clusterName
    
    MonitoringUtil-->>UIFactory: monitoringUrl (string)
    UIFactory-->>Header: monitoringUrl
    
    Header->>Header: Render monitoring button<br/>with external link
Loading

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
378 375 0 1 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.08 MB | Main: 66.08 MB
Diff: +0.36 KB (0.00%)

✅ Bundle size unchanged.

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

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 extends the getMonitoringLink function interface to accept controlPlane and userAttributes parameters, enabling custom monitoring link implementations to utilize additional tenant metadata from the Control Plane and User Attributes fields.

Key changes:

  • Extended GetMonitoringLinkProps interface with optional controlPlane and userAttributes parameters
  • Updated Header component to pass Control Plane and User Attributes data when generating monitoring links

Reviewed Changes

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

File Description
src/utils/monitoring.ts Added optional controlPlane and userAttributes parameters to GetMonitoringLinkProps interface
src/containers/Header/Header.tsx Updated monitoring link generation to pass ControlPlane and UserAttributes from database data

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.

Additional Comments (1)

  1. src/utils/monitoring.ts, line 15-20 (link)

    logic: controlPlane and userAttributes parameters are destructured but never used in function body

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@astandrik astandrik added this pull request to the merge queue Nov 12, 2025
Merged via the queue into main with commit 44c82d9 Nov 12, 2025
17 checks passed
@astandrik astandrik deleted the astandrik.3073 branch November 12, 2025 10:10
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.

feat: pass ControlPlane and UserAttributes to get links

3 participants