Skip to content

override: sequence merge ignores strictly-identical duplicate entries - #924

Merged
glours merged 1 commit into
compose-spec:mainfrom
ndeloof:merge-dedup-identical
Aug 31, 2026
Merged

glours merged 1 commit into
compose-spec:mainfrom
ndeloof:merge-dedup-identical

Conversation

@ndeloof

@ndeloof ndeloof commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Merging sequences appended blindly: the same env_file declared in base + override was applied twice, an identical mount or device entry was duplicated and rejected by the engine at create time. Two strictly identical entries never carry more meaning than one.

Both merge regimes now drop an override entry deeply equal to one already present — the registered sequence merges and the default list merge — which folds mergeExtraHosts (the one merger that already deduplicated) into mergeToSequence. Entries that differ in form (short vs long syntax of the same declaration) are not equal and are kept: the rule is strict identity, never equivalence.

Property pinned by test: merging a value over an already-merged result is idempotent — the guarantee needed to resolve pre_start inheritance at load time (#866 follow-up) without breaking config round-trips.

🤖 Generated with Claude Code

…ntries

Merging sequences appended blindly: the same env_file declared in the
base file and an override was applied twice, an identical mount or
device entry was duplicated and rejected by the engine at create time.
Two strictly identical entries never carry more meaning than one.

Both merge regimes now drop an override entry deeply equal to one
already present — the registered sequence merges and the default list
merge — which also folds mergeExtraHosts (the one merger that already
deduplicated) into mergeToSequence. Entries that differ in form (short
vs long syntax of the same declaration) are not equal and are kept:
the rule is strict identity, never equivalence.

Consequence pinned by test: merging a value over an already-merged
result is idempotent, so a resolved model can be reloaded and merged
again without duplicating accumulated entries.

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof
ndeloof requested a review from glours as a code owner August 31, 2026 08:03
@ndeloof ndeloof mentioned this pull request Aug 31, 2026

@glours glours left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sounds good to me 👍

@glours
glours merged commit d7125ef into compose-spec:main Aug 31, 2026
8 checks passed
@ndeloof
ndeloof deleted the merge-dedup-identical branch August 31, 2026 12:41
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