feat(Segment membership inspection): Add segment members read endpoint#7861
feat(Segment membership inspection): Add segment members read endpoint#7861khvn26 wants to merge 3 commits into
Conversation
Add GET /projects/{id}/segments/{id}/members, listing the identities
matching a segment in an environment, cursor-paginated against the
ClickHouse IDENTITIES snapshot the membership backfill maintains.
- Reuses the count-refresh SQL predicate against FROM IDENTITIES FINAL,
env-scoped, ordered by identifier ASC; limit capped at 200 (400 above).
- RBAC: MANAGE_SEGMENTS on the project plus VIEW_IDENTITIES on the
environment; gated on the segment_membership_inspection flag (404 when off).
- Emits flagsmith_segment_membership_read_duration_seconds and tags every
query with a :read: log_comment for ClickHouse spend attribution.
beep boop
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Docker builds report
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7861 +/- ##
==========================================
+ Coverage 98.59% 98.60% +0.01%
==========================================
Files 1472 1476 +4
Lines 57362 57853 +491
==========================================
+ Hits 56556 57047 +491
Misses 806 806 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
|
Visual Regression19 screenshots compared. See report for details. |
… no more rows At an exact page boundary (matches == limit) the endpoint returned a next_cursor, so paging through it yielded an empty trailing page. Fetch one extra row (limit + 1) to detect a real next page, and only set next_cursor when that probe row exists. beep boop
…ment members endpoint (#7866)
emyller
left a comment
There was a problem hiding this comment.
Looks great. One product-related question.
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Closes #7408.
Adds a read endpoint that lists the identities currently matching a segment, cursor-paginated.
GET /api/v1/projects/{project_id}/segments/{id}/members?environment={env_id}&cursor={identifier}&limit={N}How did you test this code?
Added integration and unit tests.
Will test extensively in staging.