Skip to content

Add filedb feature flag, cleanup code and add tests#541

Merged
satyakigh merged 3 commits intomainfrom
filedbff
Apr 27, 2026
Merged

Add filedb feature flag, cleanup code and add tests#541
satyakigh merged 3 commits intomainfrom
filedbff

Conversation

@satyakigh
Copy link
Copy Markdown
Collaborator

@satyakigh satyakigh commented Apr 26, 2026

Summary

Introduces a FileDb feature flag to control the persistence backend. When enabled, the language server uses FileStoreFactory instead of LMDBStoreFactory. This enables a gradual migration away from LMDB via fleet percentage rollout.
The DataStore is selected based on the feature flag and operating system ONCE on startup - we can't hot swap the database even if the feature flag flips.

Key Changes

Area Change
Feature flag Added FileDb to alpha (on, 100%), beta (off, 100%), prod (off, 0%)
DataStore MultiDataStoreFactoryProvider now takes a FeatureFlag and uses it to pick FileStoreFactory vs LMDBStoreFactory
Ownership move FeatureFlagProvider moved from CfnExternalCfnInfraCore (core now depends on it for datastore init)
Type safety FeatureFlagSupplier loops use as const satisfies for proper typed keys instead of Record<string, ...>
Extracted helpers featureFlagLocalFile() and relationshipLocalFile() — testable path builders
Minor readBufferIfExists return type NonSharedBufferBuffer; sleep exported from Retry.ts
Tests New tests for AndFeatureFlag, LocalHostTargetedFeatureFlag, buildLocalHost, featureFlagLocalFile, File utils, sleep

Feature Flag settings until we test

alpha  → enabled: true,  fleetPercentage: 100  (fully on)
beta   → enabled: false, fleetPercentage: 100  (ready to flip)
prod   → enabled: false, fleetPercentage: 0    (completely off)

@satyakigh satyakigh marked this pull request as ready for review April 26, 2026 07:30
@satyakigh satyakigh requested a review from a team as a code owner April 26, 2026 07:30
@satyakigh satyakigh marked this pull request as draft April 26, 2026 07:30
@satyakigh satyakigh marked this pull request as ready for review April 27, 2026 00:02
kddejong
kddejong previously approved these changes Apr 27, 2026
Base automatically changed from keyeddb to main April 27, 2026 17:52
@satyakigh satyakigh dismissed kddejong’s stale review April 27, 2026 17:52

The base branch was changed.

@satyakigh satyakigh merged commit 645a70b into main Apr 27, 2026
15 of 16 checks passed
@satyakigh satyakigh deleted the filedbff branch April 27, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants