Move Java Agent search to the index and add a slim list type#683
Conversation
Search now reads index.json (precomputed search_terms) instead of the list bundle, which drops the telemetry and config fields search needs. Adds InstrumentationListEntry so the list and config-builder consumers type-check against the slim bundle shape.
✅ Deploy Preview for otel-ecosystem-explorer ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR updates the Java Agent data model and search pipeline in ecosystem-explorer so global search uses data/javaagent/index.json (with precomputed search_terms) instead of relying on the per-version list bundle shape, and introduces a dedicated slim list entry type to make bundle-vs-detail shape mismatches compile-time errors.
Changes:
- Add
InstrumentationIndex/InstrumentationIndexEntryforindex.json, and switch the Java Agent global search source to load/search from the index instead of the list bundle. - Introduce
InstrumentationListEntryfor the slim list-bundle shape and update list/config-builder consumers + tests to use it. - Extend the explorer DB builder to precompute deterministic, sorted/deduped
search_termsfor index entries, with test coverage.
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ecosystem-explorer/src/types/javaagent.ts | Adds index/list entry types and updates module typing to use the slim list shape. |
| ecosystem-explorer/src/test/integration/database-structure.integration.test.ts | Adds integration assertions for index.json contract and search source behavior. |
| ecosystem-explorer/src/lib/search/sources/java-agent.ts | Switches Java Agent global search to loadIndex() + uses precomputed search_terms. |
| ecosystem-explorer/src/lib/search/sources/java-agent.test.ts | Updates unit tests for the new index-entry-driven search keywords/facets behavior. |
| ecosystem-explorer/src/lib/search/search-index.test.ts | Updates search orchestration mocks to use loadIndex() instead of list fan-out. |
| ecosystem-explorer/src/lib/normalize-instrumentation.ts | Updates module grouping helpers to operate on InstrumentationListEntry. |
| ecosystem-explorer/src/lib/normalize-instrumentation.test.ts | Adjusts normalization snapshot tests to the slim list entry type. |
| ecosystem-explorer/src/lib/configurations-aggregate.test.ts | Updates configuration aggregation fixtures/types to the slim list entry shape. |
| ecosystem-explorer/src/lib/api/javaagent-data.ts | Adds loadIndex() and makes loadAllInstrumentations() return the slim list shape (bundle or projected fallback). |
| ecosystem-explorer/src/lib/api/javaagent-data.test.ts | Adds tests for loadIndex() and updates expectations for slim list-entry returns. |
| ecosystem-explorer/src/hooks/use-javaagent-data.ts | Updates useInstrumentations() to return InstrumentationListEntry[]. |
| ecosystem-explorer/src/features/java-agent/utils/group-instrumentations.ts | Updates grouping utilities to accept slim list entries. |
| ecosystem-explorer/src/features/java-agent/utils/group-instrumentations.test.ts | Updates grouping tests to use InstrumentationListEntry fixtures. |
| ecosystem-explorer/src/features/java-agent/utils/format.ts | Narrows getInstrumentationDisplayName input type for wider reuse with slim entries. |
| ecosystem-explorer/src/features/java-agent/utils/badge-info.ts | Simplifies badges computation to rely on precomputed has_spans/has_metrics in list entries. |
| ecosystem-explorer/src/features/java-agent/utils/badge-info.test.ts | Updates badge tests to use has_spans/has_metrics flags instead of telemetry scanning. |
| ecosystem-explorer/src/features/java-agent/java-instrumentation-list-page.tsx | Removes telemetry scanning in filters; relies on list-entry precomputed flags. |
| ecosystem-explorer/src/features/java-agent/java-instrumentation-list-page.test.tsx | Updates list page tests to the slim list-entry shape and precomputed flags. |
| ecosystem-explorer/src/features/java-agent/configuration/components/instrumentation-row.test.tsx | Updates configuration builder row tests to use slim list entries/modules. |
| ecosystem-explorer/src/features/java-agent/configuration/components/instrumentation-browser.tsx | Updates configuration browser prop typing to accept slim list entries. |
| ecosystem-explorer/src/features/java-agent/configuration/components/instrumentation-browser.test.tsx | Updates configuration browser tests/fixtures to use slim list entries. |
| ecosystem-explorer/src/features/java-agent/components/sub-instrumentation-item.tsx | Updates component prop typing to use InstrumentationListEntry. |
| ecosystem-explorer/src/features/java-agent/components/instrumentation-group-card.test.tsx | Updates group card tests to rely on precomputed flags instead of telemetry blocks. |
| ecosystem-explorer/src/features/java-agent/components/instrumentation-filter-bar.tsx | Updates filter bar typing to accept slim list entries. |
| ecosystem-explorer/src/features/java-agent/components/instrumentation-card.tsx | Updates card prop typing to use InstrumentationListEntry. |
| ecosystem-explorer/src/features/java-agent/components/instrumentation-card.test.tsx | Updates card tests to use has_spans/has_metrics rather than telemetry fixtures. |
| ecosystem-automation/explorer-db-builder/tests/test_instrumentation_transformer.py | Adds unit tests for search-term collection + index entry extraction. |
| ecosystem-automation/explorer-db-builder/tests/test_database_writer.py | Extends index writer tests to validate search_terms presence and determinism. |
| ecosystem-automation/explorer-db-builder/src/explorer_db_builder/instrumentation_transformer.py | Implements deterministic _collect_search_terms() and includes it in index entry generation. |
has_spans, has_metrics and _is_custom are always set by both the bundle producer and the fan-out projection, so mark them required on InstrumentationListEntry. This removes undefined handling at consumers and keeps the library/custom split from silently misclassifying.
|
|
||
| add(instrumentation.get("library_link")) | ||
| add(instrumentation.get("source_path")) | ||
| add(instrumentation.get("minimum_java_version")) |
There was a problem hiding this comment.
I think we can probably limit this to only distinctive, identifier-like strings like config name/declarative_name, metric name, scope.name, the maven coordinate (range stripped), semantic_conventions, features, and descriptions. We can probably drop the individual attribute names, types etc and everything else
Keep only the high-signal terms worth searching on: scope name, semantic conventions, features, the maven coordinate with its version range stripped, config name/declarative_name/description and metric name/description. Drop the attribute names and types, metric instrument/unit/data_type, span kinds and the link/path fields, which were just noise in the index.
Java Agent global search now reads index.json (with precomputed search_terms) instead of the list bundle, so it no longer depends on fields the slim bundle drops. Also adds a dedicated InstrumentationListEntry type for the bundle/list path (mirrors the collector IndexComponent) so list and config-builder consumers type-check against the slim shape.
search_terms is populated by a db rebuild. Until then the search source falls back to name/display_name/description, so nothing breaks at merge.
Closes #657