• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Unleash / unleash / 34128047932
87%
master: 91%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 07 Sep 2026 01:37PM UTC
Jobs 1
Files 1216
Run time 3min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

07 Sep 2026 01:32PM UTC coverage: 87.401% (-0.05%) from 87.455%
34128047932

push

github

web-flow
perf: reduce feature search segment fan-out

## Why

GET /api/admin/search/features joins feature strategies to features by
feature name before pagination. For a feature with N environments, every
strategy row can therefore be paired with all N feature-environment
rows. Segment links increase that intermediate result further even
though the response ultimately deduplicates segment names.

This became visible during the September feature-search incident, where
one instance with 1,064 flags and 17 environments saturated its database
under sustained automated search traffic.

Incident context:
https://unleash-internal.slack.com/archives/C047QAPU5U5/p1788396840135459

## What changed

- Aggregate distinct segment names once per feature before joining them
into ranked_features.
- Return that pre-aggregated segment array directly instead of
rebuilding it from repeated result rows.
- Make positive segment filters use a feature-level subquery, consistent
with the existing negative and all-of segment filters.
- Add regression coverage for segments across environments and for
combined status and segment filters that match in different
environments.

A simpler feature-strategy join on feature plus environment was tested
first, but it changed existing behavior: a development status filter
could no longer be combined with a segment used in production. The
pre-aggregation approach removes the fan-out while preserving that
behavior. It also avoids relying on a composite feature-strategy to
feature-environment constraint that the database does not currently
enforce.

## Benchmark

The benchmark harness was used locally and is intentionally not
committed in this PR. It was tied to the feature-search schema and
fixture; a reusable endpoint load-test tool should be designed
separately as an HTTP-level runner with externally prepared data.

The temporary harness called the real FeatureSearchStore against a
freshly migrated PostgreSQL database with:

- 1,064 features
- 17... (continued)

3965 of 5163 branches covered (76.8%)

3 of 3 new or added lines in 1 file covered. (100.0%)

34 existing lines in 7 files now uncovered.

16177 of 18509 relevant lines covered (87.4%)

854.41 hits per line

Coverage Regressions

Lines Coverage ∆ File
20
15.63
-6.11% src/lib/features/metrics/client-metrics/fake-client-metrics-store-v2.ts
5
94.44
0.33% src/lib/features/metrics/client-metrics/client-metrics-store-v2.ts
3
80.51
-0.77% src/lib/metrics.ts
2
98.26
-0.87% src/lib/features/feature-search/feature-search-store.ts
2
88.89
0.08% src/lib/features/metrics/client-metrics/metrics-service-v2.ts
1
89.58
-2.08% src/lib/features/frontend-api/client-feature-toggle-read-model.ts
1
83.9
1.69% src/lib/features/playground/feature-evaluator/constraint.ts
Jobs
ID Job ID Ran Files Coverage
1 34128047932.1 07 Sep 2026 01:37PM UTC 1216
87.4
GitHub Action Run
Source Files on build 34128047932
  • Tree
  • List 1216
  • Changed 11
  • Source Changed 7
  • Coverage Changed 10
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #34128047932
  • 8b146279 on github
  • Prev Build on main (#34119709989)
  • Next Build on main (#34129177070)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc