feat(reconcile): add a Preference kind#1762
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
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: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Coverage Report for CI Build 29475048848Coverage increased (+0.1%) to 45.593%Details
Uncovered Changes
Coverage Regressions1 previously-covered line in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
71e95c2 to
a226f47
Compare
…to their defaults
…, matching the server
59b3ac4 to
aa8a7e4
Compare
Stacked on #1737; will rebase onto main once #1731 and #1737 squash-merge.
What
A
Preferencekind forfrontier reconcileandfrontier export, for platform settingslike
disable_orgs_on_createand the invite mail template.How it behaves (per the RFC's rules)
desired state. A preference you list is set to your value; a preference you leave out is
written back to its trait default. This is the first kind to use reset-to-default.
its default is what removal means here.
default, sorted by name, so reconciling an export plans no changes.
Values are strings end to end, so a yes/no setting compares as
"true"or"false".Unknown names and duplicate names fail the plan. A stored value whose trait no longer
exists is left alone — the file cannot name it, so nothing manages it.
API use
ListPreferences(AdminService) reads the stored platform preferences.DescribePreferences(FrontierService) gives the valid platform traits and theirdefaults — both the source of defaults and the set of valid names.
CreatePreferences(AdminService) upserts a value; a reset writes the default back.Values are read from the DB on every call, so a write reaches all pods. There is a
standing TODO in
core/preference/service.goto cache platform preferences; if that landsas a boot-lifetime map, pods would serve stale values after a write. It needs a TTL or
read-through. Flagging it here so the cache is not added without that.
Tests
resets, unknown trait, duplicate name, empty name, and a stored value whose trait is
gone.
applying, export returns only overrides and round-trips, and an all-default export is
empty.