feat: add file-based override source (ldoverrides)#412
Merged
kinyoklion merged 1 commit intoJul 7, 2026
Conversation
This was referenced Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the public
ldoverridespackage withFileSource(), the file-based override source defined by the OVERRIDE spec, completing the user-facing feature:flags,flagValues,segments; JSON and YAML), withflagValuesentries expanded into full flag definitions. Multiple files merge in configured order under the configured duplicate-key handling.internal/filedatamachinery, so every reload is serialized, debounced, all-or-nothing with last-good retention, retried after failures, and skipped when file contents are unchanged. A malformed or mid-write edit can never empty the override layer or stall the source; missing files at startup just mean no overrides until they appear.ldfilewatch/fsnotify, which already handles rename-replace editors by watching the parent directory), with an optional stat-basedPollmode for filesystems where notifications are unreliable — network mounts, some containers, Kubernetes ConfigMap symlink swaps. Both may run together; the poll interval defaults to one second and is clamped to a one-second minimum.Package tests cover initial load, YAML, multi-file ordering and duplicate handling, missing-file startup and recovery, watch and poll reload modes, malformed-edit retention and recovery, interval clamping, and close semantics. A client-level test drives the whole loop end-to-end: an uninitialized client picks up an operator's file edits — add, change, remove — with evaluations, the
isOverridereason, and the restored short-circuit following along, no restart involved.This PR targets the
rlamb/overridesintegration branch because it is the junction of the two in-flight stacks: theinternal/filedatareload machinery (#405–#407) and the override system (#404, #408–#411).SDK-2656