Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 19, 2025

This PR adds the internal_call=true parameter to /viewer/query requests for UI-generated queries to distinguish them from user-executed queries.

Problem

The backend needed a way to identify which query requests were generated internally by the UI (for fetching system data, statistics, etc.) versus queries executed by users through the query editor. This distinction is important for monitoring, logging, and resource management purposes.

Solution

Added an optional internal_call boolean parameter to the SendQueryParams interface and updated all appropriate UI-generated query calls to include internal_call: true.

Changes

Type System

  • Added internal_call?: boolean to SendQueryParams<Action> interface
  • The parameter is automatically inherited by StreamQueryParams through extension

UI-Generated Queries (with internal_call: true)

Updated 8 internal query locations across the codebase:

  • Top Queries & Running Queries (executeTopQueries.ts) - System query monitoring
  • Query Cancellation (cancelQuery.ts) - Administrative operations
  • Cluster Statistics (cluster.ts) - System metrics collection
  • Shards Workload (shardsWorkload.ts) - Performance monitoring
  • Tenant Overview Tables (executeTopTables.ts) - Dashboard data
  • Top Shards (tenantOverviewTopShards.ts) - System analytics
  • View Schema (viewSchema.ts) - Metadata queries

User-Initiated Queries (without internal_call)

The following queries do not include the internal_call parameter as they are user-initiated:

  • User queries in the query editor (both regular sendQuery and streaming streamQuery)
  • Table Preview (preview.ts) - User-initiated table data viewing

Validation

  • ✅ TypeScript compilation passes
  • ✅ All existing tests pass
  • ✅ Linting passes with zero errors
  • ✅ All 8 UI-generated query calls properly marked
  • ✅ User queries and table previews confirmed to not include the parameter

Fixes #2730.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
378 372 0 4 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.37 MB | Main: 85.37 MB
Diff: +0.68 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 changed the title [WIP] Mark UI-generated queries with internal_call=true feat: mark UI-generated queries with internal_call=true parameter Aug 19, 2025
Copilot AI requested a review from adameat August 19, 2025 07:52
Copilot finished work on behalf of adameat August 19, 2025 07:52
@adameat
Copy link
Member

adameat commented Aug 19, 2025

@copilot good job! let's remove this internal_call parameter for preview - it doesn't sound like an internal call to me.

Copy link
Contributor Author

Copilot AI commented Aug 19, 2025

@copilot good job! let's remove this internal_call parameter for preview - it doesn't sound like an internal call to me.

Done! Removed the internal_call parameter from table preview queries since they are user-initiated actions for viewing table data rather than internal system calls. Change committed in cde0d4d.

Copilot finished work on behalf of adameat August 19, 2025 13:21
@adameat adameat marked this pull request as ready for review August 20, 2025 06:52
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!


@ydb-platform ydb-platform deleted a comment from claude bot Aug 20, 2025
@adameat adameat added this pull request to the merge queue Aug 20, 2025
Merged via the queue into main with commit 62cc324 Aug 20, 2025
8 checks passed
@adameat adameat deleted the copilot/fix-2730 branch August 20, 2025 09:14
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.

Mark UI-generated queries with internal_call=true

3 participants