fix: Restore Lucene autocomplete - #2902
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: cd797a7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
Greptile SummaryThis PR restores Lucene autocomplete by supplying source and date-range context at missing call sites and falling back to explicit table connections when a source does not identify a concrete table.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/app/src/hooks/useAutoCompleteOptions.tsx | Adds table-connection fallback resolution while retaining source-derived tables as the default. |
| packages/app/src/components/DBSearchPageFilters/hooks.ts | Routes resolved table metadata through facet field and value discovery. |
| packages/app/src/DBDashboardPage.tsx | Builds concrete tile table connections and provides the searched date range to dashboard autocomplete. |
| packages/app/src/components/KubernetesFilters.tsx | Selects the metric gauge table explicitly for Kubernetes filter autocomplete. |
| packages/app/tests/e2e/utils/lucene-autocomplete.ts | Introduces shared Playwright helpers for asserting Lucene field and value suggestions. |
Reviews (6): Last reviewed commit: "Merge branch 'main' into drew/fix-lucene..." | Re-trigger Greptile
E2E Test Results✅ All tests passed • 289 passed • 1 skipped • 968s
Tests ran across 4 shards in parallel. |
| // The window the events query itself uses, so autocomplete discovers the | ||
| // same fields and values the event list can actually match on. | ||
| const eventsDateRange = useMemo( | ||
| () => [start, end] as DateRange['dateRange'], | ||
| [start, end], | ||
| ); | ||
|
|
| tableConnection={tcFromSource(traceTrace)} | ||
| // The WHERE runs against the trace source | ||
| sourceId={traceTrace?.id} | ||
| dateRange={searchedTimeRange} |
| sourceId={sourceId} | ||
| dateRange={searchedTimeRange} |
| > | ||
| <SearchWhereInput | ||
| tableConnection={tableConnection} | ||
| sourceId={sourceId} |
| > | ||
| <SearchWhereInput | ||
| tableConnections={tableConnections} | ||
| dateRange={searchedTimeRange} |
| tableConnection={gaugeTableConnection} | ||
| sourceId={metricSource.id} | ||
| dateRange={dateRange} |
| <SearchWhereInput | ||
| tableConnection={tcFromSource(logTableSource)} | ||
| sourceId={logTableSource.id} | ||
| dateRange={dateRange} |
| <SearchWhereInput | ||
| tableConnection={tcFromSource(source)} | ||
| sourceId={source.id} | ||
| dateRange={newDateRange} |
443521e to
ebd2131
Compare
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
Deep Review✅ No critical issues found. This PR restores autocomplete by threading 🟡 P2 -- recommended
🔵 P3 nitpicks (5)
Reviewers (6): correctness, testing, maintainability, kieran-typescript, julik-frontend-races, learnings-researcher. (correctness, kieran-typescript, and julik-frontend-races were dispatched but had not returned findings at synthesis time; the orchestrator's own read of the diff surfaced no additional correctness, type-safety, or async-race defects — the Testing gaps:
|
44c7e77 to
8819d99
Compare
|
Great catch here. Thank you for adding the additional tests around autocomplete! |








Summary
This PR restores lucene auto-complete across the app, which was broken in #2643 for inputs other than the search page WHERE input.
The problem was that in #2643 sourceId became the source of truth for where auto complete suggestions should be queried from, instead of the given tableConnection. However sourceId was not always provided, so when it wasn't no suggestions were queried.
The fix has two parts:
A better solution in the future would be to make source id required in these input components, but that is a larger refactor saved for a later day.
Screenshots or video
How to test on Vercel preview
Test lucene Auto-complete across the app
References