Add list value filtering across experiments, feature flags, and segments - #3286
Add list value filtering across experiments, feature flags, and segments#3286zackcl wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds list-value filtering to experiments, feature flags, and segments, resolving #3284.
Changes:
- Adds
List Valuesearch options and API enums. - Implements partial, case-insensitive recursive list matching.
- Adds unit and integration coverage.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/types/src/Experiment/enums.ts |
Adds shared search keys. |
packages/frontend/.../segment-root-section-card.component.ts |
Adds segment filter option. |
packages/frontend/.../feature-flag-root-section-card.component.ts |
Adds feature-flag filter option. |
packages/frontend/.../experiment-root-section-card.component.ts |
Adds experiment filter option. |
packages/backend/src/api/services/listValueSearchHelpers.ts |
Builds recursive list-value predicates. |
packages/backend/src/api/services/SegmentService.ts |
Applies segment list-value filtering. |
packages/backend/src/api/services/FeatureFlagService.ts |
Applies feature-flag filtering. |
packages/backend/src/api/services/ExperimentService.ts |
Applies experiment filtering. |
packages/backend/src/api/controllers/validators/SegmentPaginatedParamsValidator.ts |
Accepts segment search key. |
packages/backend/src/api/controllers/validators/FeatureFlagsPaginatedParamsValidator.ts |
Accepts feature-flag search key. |
packages/backend/src/api/controllers/SegmentController.ts |
Documents the new filter. |
packages/backend/src/api/controllers/FeatureFlagController.ts |
Documents the new filter. |
packages/backend/src/api/controllers/ExperimentController.ts |
Documents the new filter. |
packages/backend/test/unit/services/SegmentService.test.ts |
Tests segment search clauses. |
packages/backend/test/unit/services/FeatureFlagService.test.ts |
Tests feature-flag search clauses. |
packages/backend/test/unit/services/ExperimentService.test.ts |
Tests experiment search clauses. |
packages/backend/test/unit/services/listValueSearchHelpers.test.ts |
Tests shared query helpers. |
packages/backend/test/integration/ListValueFiltering/index.ts |
Tests end-to-end filtering behavior. |
packages/backend/test/integration/index.test.ts |
Registers the integration scenario. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated no new comments.
Suppressed comments (2)
packages/backend/src/api/controllers/FeatureFlagController.ts:246
- The updated OpenAPI enum is still incomplete:
idis accepted byFLAG_SEARCH_KEYand exposed by the feature-flag page, but is omitted here. Add it so generated API documentation accurately describes the endpoint.
* enum: [all, name, key, status, tag, context, listValue]
packages/backend/src/api/services/listValueSearchHelpers.ts:14
- These leading-wildcard
ILIKEpredicates cannot use the existing primary-key B-tree indexes, and no trigram indexes exist for these columns. Consequently, everyList Valuesearch—and now everyAllsearch—sequentially scans both membership tables (once for data and again for counts), which will become expensive on large lists. Add a migration enablingpg_trgmand GIN trigram indexes forindividual_for_segment."userId"andgroup_for_segment."groupId".
WHERE "userId" ILIKE :${LIST_VALUE_SEARCH_PATTERN_PARAMETER} ESCAPE '\\'
UNION
SELECT "segmentId" AS "id"
FROM "group_for_segment"
WHERE "groupId" ILIKE :${LIST_VALUE_SEARCH_PATTERN_PARAMETER} ESCAPE '\\'
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated no new comments.
Suppressed comments (1)
packages/backend/src/api/services/listValueSearchHelpers.ts:14
- These leading-wildcard
ILIKEchecks are executed on every keyup for bothList ValueandAll, but the membership tables only have their composite primary-key indexes and no trigram indexes. PostgreSQL therefore must scan both complete value tables for each data and count query before running the recursive traversal, so root-page searches will scale with total list membership. Addpg_trgmindexes forindividual_for_segment.userIdandgroup_for_segment.groupIdin a migration; also gate or debounce very short searches, for which trigram indexes cannot help effectively.
WHERE "userId" ILIKE :${LIST_VALUE_SEARCH_PATTERN_PARAMETER} ESCAPE '\\'
UNION
SELECT "segmentId" AS "id"
FROM "group_for_segment"
WHERE "groupId" ILIKE :${LIST_VALUE_SEARCH_PATTERN_PARAMETER} ESCAPE '\\'
Resolves #3284
Changes
List Valuefilter to the Experiments, Feature Flags, and Segments pages.Allsearch.Include Allbehavior while searching applicable inclusion and exclusion lists.