feat(entity-caching-3): feature flag percentage based rollout router changes#2829
Conversation
…ig + proposal-rollout RPCs
Adds the wire contract for percentage-based feature flag rollouts driven from
proposals. node.proto carries traffic_percentage on each feature flag's
execution config so the router can route a configured share of unpinned
traffic to that flag's variant. platform.proto adds the rollout-side RPCs:
- BulkUpdateProposalRolloutPercentages (atomic create-or-update of one or
more proposal rollouts on the same federated graph; deploys feature
subgraphs + flag if no rollout exists yet, otherwise updates the
percentage)
- TeardownProposalRollout (deletes the linked feature flag + feature
subgraphs)
- rolloutFeatureFlagId / rolloutPercentage fields on the Proposal message
Includes regenerated TS bindings (connect/src). Go bindings are regenerated
locally but not committed — those will land alongside the consuming code.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds the controlplane-side machinery for percentage-based feature flag rollouts
driven from proposals.
DB schema (migration 0137_rollout_feature_flags):
- feature_flags.traffic_percentage int (null → preview-only flag)
- feature_flags.proposal_id uuid FK → proposals.id ON DELETE SET NULL
- ff_proposal_id_idx for the linked-flag lookup
Composition wiring carries trafficPercentage through composeGraphs (types,
worker) into routerConfigToFeatureFlagExecutionConfig so the router config
proto's FeatureFlagRouterExecutionConfig.traffic_percentage is populated.
Bufservices:
- BulkUpdateProposalRolloutPercentages (new): atomic create-or-update of one
or more proposal rollouts on the same federated graph. Deploys feature
subgraphs + flag if no rollout exists yet, otherwise updates the
percentage. Single transaction + single composeAndDeployGraphs.
Cumulative-budget check across the whole graph (router fails closed at
>100%).
- TeardownProposalRollout (new): deletes the linked feature flag.
- getProposal / updateProposal: surface rolloutFeatureFlagId +
rolloutPercentage on the Proposal DTO; auto-teardown the linked rollout
when the proposal transitions to PUBLISHED (idempotent).
Repositories:
- FeatureFlagRepository: thread trafficPercentage through subgraphsToCompose
+ the FF DTO surface so composition can carry it onto the proto.
- FederatedGraphRepository: small touch to surface rollout flags.
- ProposalRepository: getLinkedRolloutFlag, setLinkedRolloutFlag,
updateRolloutPercentage helpers backing the rollout RPCs.
Includes integration tests under test/proposal/caching-rollout.test.ts.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… feature subgraphs When a feature flag composition replaces a base subgraph with its feature subgraph, sibling subgraphs that have an @OverRide(from: "<baseName>") directive get orphaned by the swap. The FF composition then fails with a @Shareable collision and the router config silently produces no featureFlagConfigs entry, so the router falls back to baseMux and the rollout no-ops. This adds rewriteOverrideTargets, a small SDL-level helper that walks the field directives in a subgraph SDL and renames @OverRide(from:) targets according to a baseName -> featureSubgraphName map. FeatureFlagRepository applies it to every sibling DTO at compose-list construction time so the post-swap composition sees a coherent override graph. Worker re-parses each DTO from `schemaSDL` (composeGraphs.worker.ts), so the write back to schemaSDL is what counts; the parallel compositionSubgraphs AST is dead in this code path. Includes unit tests covering the empty-map no-op, single rewrite, multi- field rewrite, and unmatched-target behavior. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
aws-lambda-router - uncommitted changes detectedSeems like you forgot to commit some code. Possible causes:
Dirty files
|
connect-go - uncommitted changes detectedSeems like you forgot to commit some code. Possible causes:
Dirty files
|
router - uncommitted changes detectedSeems like you forgot to commit some code. Possible causes:
Dirty files
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## milinda/entity-caching-2-control-plane-ff-rollout #2829 +/- ##
======================================================================================
+ Coverage 9.59% 40.49% +30.90%
======================================================================================
Files 445 14 -431
Lines 56997 1521 -55476
Branches 905 0 -905
======================================================================================
- Hits 5468 616 -4852
+ Misses 51122 790 -50332
+ Partials 407 115 -292 🚀 New features to boost your workflow:
|
3294faa to
1af9b5f
Compare
@coderabbitai summary
Checklist
Open Source AI Manifesto
This project follows the principles of the Open Source AI Manifesto. Please ensure your contribution aligns with its principles.