Skip to content

fix: disable streaming by default for some clusters #2566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 14, 2025
Merged

Conversation

astandrik
Copy link
Collaborator

@astandrik astandrik commented Jul 14, 2025

Closes #2565

Stand

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
354 350 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: 85.12 MB | Main: 85.11 MB
Diff: +0.01 MB (0.02%)

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

@astandrik astandrik requested a review from Copilot July 14, 2025 14:22
@astandrik
Copy link
Collaborator Author

bugbot run

Copy link
Contributor

@Copilot 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 customizes the default query streaming setting based on cluster backend, disabling streaming for legacy clusters.

  • Introduced useQueryStreamingSetting hook to pick the right toggle key per cluster
  • Updated settings, services, and components (QueryExecution, TimeoutLabel, QueryEditor) to use the new hook
  • Added constants, default values, and UI logic (applyClusterSpecificQueryStreamingSetting, NavigationWrapper) for cluster-specific behavior

Reviewed Changes

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

Show a summary per file
File Description
src/utils/hooks/useQueryStreamingSetting.ts New hook that chooses streaming setting key based on cluster name
src/utils/hooks/useQueryExecutionSettings.ts Switched to use useQueryStreamingSetting instead of raw useSetting
src/utils/hooks/index.ts Exported newly created useQueryStreamingSetting
src/utils/constants.ts Added SETTING_KEYS, OLD_BACKEND_CLUSTER_NAMES, and key mappings
src/services/settings.ts Set default streaming disabled for old-backend clusters
src/containers/UserSettings/settings.tsx Added UI definition and applyClusterSpecificQueryStreamingSetting
src/containers/Tenant/Query/QuerySettingsDialog/TimeoutLabel.tsx Updated to use useQueryStreamingSetting
src/containers/Tenant/Query/QueryEditor/QueryEditor.tsx Updated to use useQueryStreamingSetting
src/containers/App/NavigationWrapper.tsx New wrapper applying cluster-specific settings
src/containers/App/App.tsx Replaced Navigation with NavigationWrapper
Comments suppressed due to low confidence (4)

src/containers/UserSettings/settings.tsx:154

  • [nitpick] Accessing the experiments section by a hard-coded index is brittle. Consider finding the section by its id (e.g., section.id === SECTION_IDS.EXPERIMENTS) to guard against future reordering.
    const isOldBackendCluster = clusterName && OLD_BACKEND_CLUSTER_NAMES.includes(clusterName);

src/utils/hooks/useQueryStreamingSetting.ts:10

  • This new hook isn’t covered by unit tests. Add tests to verify it selects the correct setting key and default value for both old-backend and standard clusters.
export const useQueryStreamingSetting = (): [boolean, (value: boolean) => void] => {

src/containers/UserSettings/settings.tsx:150

  • The applyClusterSpecificQueryStreamingSetting function is new and lacks tests. Consider adding unit tests to ensure settings are correctly overridden based on clusterName.
export function applyClusterSpecificQueryStreamingSetting(

src/utils/hooks/useQueryStreamingSetting.ts:1

  • [nitpick] Add a JSDoc comment above useQueryStreamingSetting to describe its behavior, return values, and how it chooses keys based on cluster names.
import {

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ BugBot reviewed your changes and found no bugs!


BugBot free trial expires on July 22, 2025
Learn more in the Cursor dashboard.

Was this report helpful? Give feedback by reacting with 👍 or 👎

@astandrik astandrik added this pull request to the merge queue Jul 14, 2025
Merged via the queue into main with commit a9670eb Jul 14, 2025
8 checks passed
@astandrik astandrik deleted the astandrik.2565 branch July 14, 2025 15:06
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.

fix: disable streaming by default for some clusters
2 participants