Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run interpolation after merge, but for required attributes #651

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

ndeloof
Copy link
Collaborator

@ndeloof ndeloof commented Jul 1, 2024

interpolation is ran after merge, so that a required missing variable, which is actually overridden, won't produce an error.

This is an alternative implementation based on #644:
This PR always run interpolation applying extends and include, but only on the relevant configuration structures. Global interpolation eventually takes places after merge

This has a minor impact on the loading process and schema: as we don't interpolate, we can't rely on a canonical model to enforce unicity after compose file merge, and doing so compose-spec schema uniqueItem constraint must be removed. This one anyway is just a syntactic sugar AFAICT that has no real impact on usability. From an IDE point of view, while obvious duplicate can be detected by schema, the non-obvious ones (like ports: ["8080", "${PORT}"] can't, and we still have to implement unicity check by the code

close docker/compose#11925

@ndeloof
Copy link
Collaborator Author

ndeloof commented Jul 1, 2024

see #652

@ndeloof
Copy link
Collaborator Author

ndeloof commented Jul 3, 2024

checked by docker/compose#11961

Copy link
Collaborator

@jhrotko jhrotko left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof ndeloof enabled auto-merge (rebase) July 8, 2024 09:47
@ndeloof ndeloof merged commit 65600ce into compose-spec:main Jul 8, 2024
8 checks passed
@ndeloof ndeloof deleted the interpolate_after_merge branch July 8, 2024 10:11
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.

[BUG] Merge does not work properly with required variables
2 participants