Fix: Process includes before extends for proper attribute inheritance#853
Open
infraAnchor wants to merge 1 commit intocompose-spec:mainfrom
Open
Fix: Process includes before extends for proper attribute inheritance#853infraAnchor wants to merge 1 commit intocompose-spec:mainfrom
infraAnchor wants to merge 1 commit intocompose-spec:mainfrom
Conversation
Fixes issue where services using 'extends' don't inherit environment variables from the base service when that base service gets attributes from an 'include' directive. The bug occurred because 'extends' was processed before 'includes', meaning extended services couldn't access attributes that came from included files. By processing includes first, we ensure all service attributes are fully merged before extends resolution happens, allowing proper inheritance across include+extends combinations. Signed-off-by: infraanchor <olaitanfalolu02@gmail.com>
ndeloof
approved these changes
Mar 6, 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.
Relates to docker/compose#13606
Services using 'extends' don't inherit environment variables from the base service when that base service gets attributes from an 'include' directive.
Root Cause:
'extends' was processed before 'includes', meaning extended services couldn't access attributes that came from included files.
Solution:
Process includes first, ensuring all service attributes are fully merged before extends resolution happens.
Testing:
Regression test added in docker/compose to verify environment variable inheritance across include+extends combinations.