Skip to content

fix: improve test index filter loading - #3337

Draft
knudtty wants to merge 1 commit into
mainfrom
aaron/improve-text-index-filter-loading
Draft

knudtty wants to merge 1 commit into
mainfrom
aaron/improve-text-index-filter-loading

Conversation

@knudtty

@knudtty knudtty commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Screenshots or video

Before After

How to test on Vercel preview

Preview routes:

Steps:

References

  • Linear Issue:
  • Related PRs:

@changeset-bot

changeset-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f929c0e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@vercel

vercel Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
hyperdx-oss Ready Ready Preview Oct 8, 2026 9:51pm UTC
hyperdx-storybook Ready Ready Preview Oct 8, 2026 9:51pm UTC

Request Review

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Duplicate code analysis

1 new clone introduced by this PR.

  • packages/common-utils/src/core/metadata.ts:1610-1625 ↔ packages/common-utils/src/core/metadata.ts:1865-1880 — 16 lines

If one of these duplicates a helper that already exists, import it instead
of redefining it. If the duplication is deliberate, ignore this comment —
the check is advisory and never fails the build.


jscpd compared this branch against origin/main
across app, api and common-utils. Only new clones are listed; the codebase
currently holds 125 in total (1.75%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

@greptile-apps

greptile-apps Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium impact] Adds a new parameter to control how map column text indices load values.

Fix the failing unit assertion and satisfy the typing and changeset requirements before merging.

Fix All in Claude CodeFindings

  1. P1 New unit assertion fails ▶
  2. P2 All-mode test misses the difference ▶
  3. P2 Query checks lose type checks ▶
  4. P2 Filter fix lacks release entry ▶

Summary

The PR uses a keys-only text index to choose which parts to read for Map values. Loading more filter values requests all listed parts.

  • A new unit assertion contradicts the query settings and fails.
  • The integration test does not distinguish 'all' from the default.
  • The new tests need proper callback types, and the behavior change needs a changeset.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[getAllKeyValues] --> B{Map has a keys-only index?}
  B -->|Yes| C[Find parts containing each requested key]
  C --> D{partsPerKey}
  D -->|Number| E[Read largest parts plus newest]
  D -->|all| F[Read all listed parts]
  B -->|No| G[Scan values index across overlapping parts]
  E --> H[Return values]
  F --> H
  G --> H
Loading

Reviews (1) · Last reviewed commit: "fix: improve test index filter loading" · Reviewed by Greptile

Comment on lines +1820 to +1822
expect(call.clickhouse_settings).not.toHaveProperty(
'enable_filesystem_cache',
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 New unit assertion fails

This test requires enable_filesystem_cache to be absent, but readMapTextIndexValuesFromBestParts always sets it to 0. The mock records those settings unchanged, so the assertion fails and breaks the unit test suite. Make the test and the intended query settings agree.

Fix in Claude Code Fix in Conductor Fix in Cursor Fix in Codex

Comment on lines +1683 to +1688
const values = byKey(await getValues('all'));

expect(values["LogAttributes['shared']"]?.sort()).toEqual([
'from-big',
'from-new',
]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 All-mode test misses the difference

The 'all' integration test uses only two indexed parts. The default path already selects both: the largest and the newest. Both tests therefore expect the same values, so this test would still pass if 'all' accidentally used the default path. Add a third indexed part with a unique value, and check that only 'all' returns it.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code Fix in Conductor Fix in Cursor Fix in Codex

Comment on lines +1762 to +1763
(mockClickhouseClient.query as jest.Mock).mock.calls.find((c: any[]) =>
(c[0].query as string).includes('keys_catalog_'),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Query checks lose type checks

The new mock-call callbacks explicitly use any[]. The repository guide says “Avoid any — use proper typing.” Give these calls a named query-argument type, or use the mock's inferred callback types. The same pattern appears in the new query-list callback. This typing requirement must be satisfied before merging.

Context Used: AGENTS.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code Fix in Conductor Fix in Cursor Fix in Codex

maxValuesPerKey: LOAD_MORE_LOAD_LIMIT,
// One key, so reading every part that holds it stays cheap, and
// the best part alone may hold far fewer values than requested.
mapTextIndexPartsPerKey: 'all',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Filter fix lacks release entry

This changes how users load filter values, but the PR has no changeset. AGENTS.md requires a changeset for behavior changes to @hyperdx/app. Add a patch changeset before merging so the fix is included in the release.

Context Used: AGENTS.md (source)

Fix in Claude Code Fix in Conductor Fix in Cursor Fix in Codex

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 406 passed • 1 skipped • 1451s

Status Count
✅ Passed 406
❌ Failed 0
⚠️ Flaky 1
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

This branch was successfully deployed

2 active deployments
Preview – hyperdx-oss — f929c0ec Deployed Oct 8, 2026 by vercel[bot]
Preview – hyperdx-storybook — f929c0ec Deployed Oct 8, 2026 by vercel[bot]
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.

1 participant