Skip to content

fix: serve latest feature flag schema version after republishing a feature subgraph - #2930

Merged
JivusAyrus merged 2 commits into
mainfrom
suvij/eng-9691-controlplane-fix-feature-flag-serving-stale-schema-version
Jun 8, 2026
Merged

fix: serve latest feature flag schema version after republishing a feature subgraph#2930
JivusAyrus merged 2 commits into
mainfrom
suvij/eng-9691-controlplane-fix-feature-flag-serving-stale-schema-version

Conversation

@JivusAyrus

@JivusAyrus JivusAyrus commented Jun 8, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes

    • Corrected feature flag schema version selection to consistently use the most recent schema version available.
  • Tests

    • Added integration test verifying that feature flags correctly reflect and apply schema changes when underlying subgraphs are republished with new field definitions.

Checklist

…ly and enhance tests for feature subgraph republishing
@JivusAyrus
JivusAyrus requested a review from a team as a code owner June 8, 2026 14:30

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6a1b27e0-4962-4485-823c-1b7717a8fca5

📥 Commits

Reviewing files that changed from the base of the PR and between 8636572 and ccd4720.

📒 Files selected for processing (2)
  • controlplane/src/core/repositories/FeatureFlagRepository.ts
  • controlplane/test/feature-flag/recompose-feature-flag.test.ts

Walkthrough

This PR updates the feature-flag repository's schema version retrieval to consistently select the latest version by joining and ordering on the schemaVersion creation timestamp, then adds an integration test that validates feature-flag supergraphs correctly reflect schema changes when subgraphs are republished.

Changes

Feature Flag Schema Version and Recomposition

Layer / File(s) Summary
Latest schema version query
controlplane/src/core/repositories/FeatureFlagRepository.ts
getFeatureFlagSchemaVersionByBaseSchemaVersion joins schemaVersion, orders by createdAt descending, and limits to 1 to ensure the latest version is retrieved. The desc import from drizzle-orm enables the descending sort.
Schema recomposition integration test
controlplane/test/feature-flag/recompose-feature-flag.test.ts
Adds SDL fixtures modeling base and feature-variant subgraph schemas, then introduces an integration test verifying that feature-flag supergraph SDL initially excludes new fields, then includes them after subgraph republication.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: fixing feature flag schema serving to use the latest version after subgraph republishing, which aligns with the actual code modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@wilsonrivera wilsonrivera left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.10%. Comparing base (a3c48a2) to head (20712e7).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2930      +/-   ##
==========================================
+ Coverage   64.95%   65.10%   +0.14%     
==========================================
  Files         327      327              
  Lines       47076    47082       +6     
  Branches     5218     5225       +7     
==========================================
+ Hits        30578    30651      +73     
+ Misses      16474    16407      -67     
  Partials       24       24              
Files with missing lines Coverage Δ
...ane/src/core/repositories/FeatureFlagRepository.ts 88.54% <100.00%> (+1.96%) ⬆️

... and 2 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.

@JivusAyrus
JivusAyrus merged commit 111e98f into main Jun 8, 2026
13 of 14 checks passed
@JivusAyrus
JivusAyrus deleted the suvij/eng-9691-controlplane-fix-feature-flag-serving-stale-schema-version branch June 8, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants