Skip to content

feat(entity-caching-3): feature flag percentage based rollout router changes#2829

Draft
SkArchon wants to merge 4 commits intomilinda/entity-caching-2-control-plane-ff-rolloutfrom
milinda/entity-caching-3-feature-flag-rollout-router
Draft

feat(entity-caching-3): feature flag percentage based rollout router changes#2829
SkArchon wants to merge 4 commits intomilinda/entity-caching-2-control-plane-ff-rolloutfrom
milinda/entity-caching-3-feature-flag-rollout-router

Conversation

@SkArchon
Copy link
Copy Markdown
Contributor

@SkArchon SkArchon commented May 6, 2026

@coderabbitai summary

Checklist

  • I have discussed my proposed changes in an issue and have received approval to proceed.
  • I have followed the coding standards of the project.
  • Tests or benchmarks have been added or updated.
  • Documentation has been updated on https://github.com/wundergraph/docs-website.
  • I have read the Contributors Guide.

Open Source AI Manifesto

This project follows the principles of the Open Source AI Manifesto. Please ensure your contribution aligns with its principles.

SkArchon and others added 4 commits May 6, 2026 16:16
…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>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9e3861aa-0676-4020-88aa-c334de691c54

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the router label May 6, 2026
@SkArchon SkArchon changed the title feat: ff percentage based rollout router feat(entity-caching-3): feature flag percentage based rollout router changes May 6, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

aws-lambda-router - uncommitted changes detected

Seems like you forgot to commit some code. Possible causes:

  • Generated code not part of the PR, fix with: make generate and commit the changes
  • Dependency mismatch for tools (protoc, etc). Ensure your local machine has same versions of tools as CI does
  • Formatting drift, fix with make format aws-lambda-router / pnpm format aws-lambda-router

Dirty files
  • graphqlmetrics/gen/proto/wg/cosmo/cacheevents/v1/cacheevents.pb.go
  • graphqlmetrics/gen/proto/wg/cosmo/cacheevents/v1/cacheeventsv1connect/cacheevents.connect.go
  • router/gen/proto/wg/cosmo/cacheevents/v1/cacheevents.pb.go
  • router/gen/proto/wg/cosmo/cacheevents/v1/cacheeventsv1connect/cacheevents.connect.go

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

connect-go - uncommitted changes detected

Seems like you forgot to commit some code. Possible causes:

  • Generated code not part of the PR, fix with: make generate and commit the changes
  • Dependency mismatch for tools (protoc, etc). Ensure your local machine has same versions of tools as CI does
  • Formatting drift, fix with make format connect-go / pnpm format connect-go

Dirty files
  • graphqlmetrics/gen/proto/wg/cosmo/cacheevents/v1/cacheevents.pb.go
  • graphqlmetrics/gen/proto/wg/cosmo/cacheevents/v1/cacheeventsv1connect/cacheevents.connect.go
  • router/gen/proto/wg/cosmo/cacheevents/v1/cacheevents.pb.go
  • router/gen/proto/wg/cosmo/cacheevents/v1/cacheeventsv1connect/cacheevents.connect.go

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

router - uncommitted changes detected

Seems like you forgot to commit some code. Possible causes:

  • Generated code not part of the PR, fix with: make generate and commit the changes
  • Dependency mismatch for tools (protoc, etc). Ensure your local machine has same versions of tools as CI does
  • Formatting drift, fix with make format router / pnpm format router

Dirty files
  • graphqlmetrics/gen/proto/wg/cosmo/cacheevents/v1/cacheevents.pb.go
  • graphqlmetrics/gen/proto/wg/cosmo/cacheevents/v1/cacheeventsv1connect/cacheevents.connect.go
  • router/gen/proto/wg/cosmo/cacheevents/v1/cacheevents.pb.go
  • router/gen/proto/wg/cosmo/cacheevents/v1/cacheeventsv1connect/cacheevents.connect.go

@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.49%. Comparing base (3294faa) to head (3ba5c01).

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     

see 431 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@SkArchon SkArchon force-pushed the milinda/entity-caching-2-control-plane-ff-rollout branch from 3294faa to 1af9b5f Compare May 6, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant