Skip to content

feat: support saved query/filter values in external api#1814

Merged
kodiakhq[bot] merged 2 commits intomainfrom
fleon/HDX-3519
Mar 4, 2026
Merged

feat: support saved query/filter values in external api#1814
kodiakhq[bot] merged 2 commits intomainfrom
fleon/HDX-3519

Conversation

@fleon
Copy link
Copy Markdown
Contributor

@fleon fleon commented Feb 26, 2026

In #1584 we added saved default query/filter values support to dashboards. This PR extends that support to the external API.

Fixes HDX-3519

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 26, 2026

🦋 Changeset detected

Latest commit: d5bcb38

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/api Patch
@hyperdx/app Patch
@hyperdx/otel-collector Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hyperdx-oss Ready Ready Preview, Comment Mar 4, 2026 4:44pm
hyperdx-v2-oss-app Ready Ready Preview, Comment Mar 4, 2026 4:44pm

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 26, 2026

PR Review

⚠️ Response schema / type mismatch: convertToExternalDashboard returns savedFilterValues as-is from MongoDB without validation. The common-utils FilterSchema supports type: 'lucene' and type: 'sql_ast' (in addition to sql), so dashboards with UI-created saved filter values could return non-sql types in the response despite the OpenAPI spec only documenting type: 'sql'. Consider filtering to only return sql-type entries, or expand the response schema.

⚠️ Partial update inconsistency on PUT: The superRefine validation prevents savedQueryLanguage: null when savedQuery is provided, but doesn't prevent the inverse: providing savedQueryLanguage without savedQuery in a PUT body will update the language independently (via resolveSavedQueryLanguage returning early on line if (savedQueryLanguage !== undefined) return savedQueryLanguage), leaving stored state where language and query are potentially mismatched.

✅ Otherwise looks solid — good test coverage, clean schema refactor, consistent null→[] normalization for savedFilterValues.

Copy link
Copy Markdown
Contributor

@pulpdrew pulpdrew left a comment

Choose a reason for hiding this comment

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

Unrelated to this PR, but since I was poking around with saved filters in the UI - should we create a ticket to include saved filters in dashboard exports?

Comment thread packages/api/src/routers/external-api/v2/dashboards.ts
Comment thread packages/api/src/routers/external-api/v2/dashboards.ts Outdated
Comment thread packages/api/src/routers/external-api/v2/dashboards.ts Outdated
@fleon
Copy link
Copy Markdown
Contributor Author

fleon commented Feb 27, 2026

@pulpdrew Thanks for the review. Ready for you to take another look. :)

Created issue https://linear.app/clickhouse/issue/HDX-3530/include-saved-dashboard-filters-in-dashboard-exports to handle it in exports as well.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 27, 2026

E2E Test Results

All tests passed • 78 passed • 4 skipped • 861s

Status Count
✅ Passed 78
❌ Failed 0
⚠️ Flaky 0
⏭️ Skipped 4

Tests ran across 4 shards in parallel.

View full report →

@fleon fleon added the automerge label Mar 4, 2026
@kodiakhq kodiakhq Bot merged commit daab2ca into main Mar 4, 2026
13 of 14 checks passed
@kodiakhq kodiakhq Bot deleted the fleon/HDX-3519 branch March 4, 2026 16:45
knudtty pushed a commit that referenced this pull request Apr 16, 2026
In #1584 we added saved default query/filter values support to dashboards. This PR extends that support to the external API.

Fixes HDX-3519
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants