Conversation
… FeatureSegment in env Feature-specific segments (Segment.feature_id IS NOT NULL) reach evaluation only via a FeatureSegment in the target environment. Without one they have no evaluation path, but their rules still shipped in the environment document and inflated its size. beep boop
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, reopen this pull request to trigger a review.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Docker builds report
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7346 +/- ##
=======================================
Coverage 98.43% 98.43%
=======================================
Files 1395 1395
Lines 52495 52510 +15
=======================================
+ Hits 51672 51687 +15
Misses 823 823 ☔ View full report in Codecov by Sentry. 🚀 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-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
|
Visual Regression16 screenshots compared. See report for details. |
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Closes #7333
map_environment_to_engineloaded every canonical project segment into every environment document, including feature-specific segments (Segment.feature_id IS NOT NULL) that had noFeatureSegmentpointing at them in that environment._get_segment_feature_statesalready env-scopes each segment's feature-states list, so those segments ended up as{id, name, rules, feature_states: []}— but theirrulespayload stayed, and that's what drove per-env document size.After computing the per-env feature-states dict, drop feature-specific segments with no entry in it. Project-wide segments (
feature_id IS NULL) remain unfiltered.Feature-specific segments are schema-scoped to one feature and reach evaluation only via
FeatureSegment(feature=F, segment=S, environment=E). If no such row exists for env E, S has no evaluation path in E.On one project we measured (178 envs, substantial feature-level targeting), this drops per-env feature-specific-segment count from ~8,270 to ~46 — large enough to fit a project that currently overflows DynamoDB's 400 KB
BatchWriteItemlimit.How did you test this code?
Red-green TDD:
test_map_environment_to_engine__feature_specific_segment_not_in_env__excludes_segment— feature-specific segment with noFeatureSegmentin the env is dropped from the document.test_map_environment_to_engine__feature_specific_segment_in_env__includes_segment— feature-specific segment with aFeatureSegmentin the env is retained.test_map_environment_to_engine__project_wide_segment_not_in_env__includes_segment— project-wide segments remain in the document regardless.Full mapper test suite passes (25/25);
make typecheckclean.