Skip to content

Add ConfDict operations + Preserve ConfDict order in yaml - #310

Merged
jrapin merged 18 commits into
mainfrom
confdict-ops
Jul 28, 2026
Merged

Add ConfDict operations + Preserve ConfDict order in yaml#310
jrapin merged 18 commits into
mainfrom
confdict-ops

Conversation

@jrapin

@jrapin jrapin commented Jul 22, 2026

Copy link
Copy Markdown
Contributor
  • Added operations ConfDict.ops.DELETE, ConfDict.ops.BEFORE, and ConfDict.ops.AFTER; ConfDict.ops.REPLACE replaces ConfDict.OVERRIDE.
  • ConfDict patches apply top to bottom: mapping entries merge content, then move if their anchor exists; unresolved ops remain visible.
  • UID generation rejects unresolved ConfDict ops to avoid cache keys from incomplete configs.
  • Config YAML dumps preserve key order, while cache uid.yaml checks tolerate key-order-only changes for compatibility.
  • Discriminator fields serialize first for more stable/readable config YAML.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 22, 2026
@jrapin jrapin changed the title Add ConfDict operations [WIP] Add ConfDict operations Jul 22, 2026
@jrapin jrapin changed the title [WIP] Add ConfDict operations Add ConfDict operations + Preserve ConfDict order in yaml Jul 27, 2026
@jrapin
jrapin requested review from hubertjb and sdascoli July 27, 2026 13:04

@hubertjb hubertjb 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, thanks @jrapin! The only thing that I find less clear from the code is the utility of AFTER/BEFORE, not sure you'd want to add a sentence on this in the docstring.

@jrapin
jrapin merged commit 47c3c42 into main Jul 28, 2026
6 checks passed
@jrapin
jrapin deleted the confdict-ops branch July 28, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants