Skip to content

Conversation

@Raubzeug
Copy link
Contributor

@Raubzeug Raubzeug commented Dec 4, 2025

Greptile Overview

Greptile Summary

This PR fixes URL generation in calculateClusterPath for clusters that have an external clusterDomain configured. Previously, when generating links to external cluster domains, the function incorrectly included the current instance's backend query parameter and environment path parameter. This would cause the target domain to receive irrelevant configuration from the source instance.

Key changes:

  • When clusterDomain is set, environment param is now omitted (was always using settings?.auth_service)
  • When clusterDomain is set, backend query param is now omitted (was always using backend)

This is a follow-up fix to the recent cluster_domain support (#3158) and cluster_external_name feature (#3174), ensuring that external cluster links are clean and don't carry over the current instance's configuration.

Confidence Score: 5/5

  • This PR is safe to merge - it's a targeted bug fix with minimal scope and clear intent.
  • The change is a straightforward fix that correctly addresses an oversight in the recent cluster domain feature. The logic is sound: when linking to an external domain, the current instance's backend and environment should not be included in the URL.
  • No files require special attention.

Important Files Changed

File Analysis

Filename Score Overview
src/containers/Clusters/utils.ts 5/5 Fixed URL generation for external cluster domains by omitting instance-specific backend and environment parameters when clusterDomain is present.

Sequence Diagram

sequenceDiagram
    participant User
    participant ClustersList as Clusters List UI
    participant calculateClusterPath as calculateClusterPath()
    participant getClusterPath as getClusterPath()
    participant ExternalDomain as External Cluster Domain

    User->>ClustersList: Click cluster link
    ClustersList->>calculateClusterPath: row (with clusterDomain)
    
    alt clusterDomain exists
        calculateClusterPath->>getClusterPath: environment=undefined, backend=undefined, domain=clusterDomain
        getClusterPath-->>calculateClusterPath: https://external-domain.com/cluster
    else no clusterDomain
        calculateClusterPath->>getClusterPath: environment=auth_service, backend=backend
        getClusterPath-->>calculateClusterPath: /env/cluster?backend=...
    end
    
    calculateClusterPath-->>ClustersList: Cluster URL
    ClustersList->>ExternalDomain: Navigate (if external)
Loading

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
378 374 0 2 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: 62.34 MB | Main: 62.34 MB
Diff: +0.11 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.

Copilot AI review requested due to automatic review settings December 4, 2025 13:33
@Raubzeug Raubzeug enabled auto-merge December 4, 2025 13:33
@Raubzeug Raubzeug added this pull request to the merge queue Dec 4, 2025
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.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copilot finished reviewing on behalf of Raubzeug December 4, 2025 13:36
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 fixes the calculateClusterPath function to properly handle external clusters with a clusterDomain. The fix prevents global backend and environment values from being incorrectly included in URLs for external clusters.

Key Changes:

  • When clusterDomain is present, explicitly set environment to undefined instead of using settings?.auth_service
  • When clusterDomain is present, explicitly set backend to undefined instead of using the cluster's backend value
  • This ensures external cluster URLs are constructed using only the clusterDomain without global fallback values

Merged via the queue into main with commit 91829ad Dec 4, 2025
13 checks passed
@Raubzeug Raubzeug deleted the fix-links branch December 4, 2025 13:38
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.

3 participants