Skip to content

Fix config 'extends' option processing #6873

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lxa
Copy link

@lxa lxa commented Aug 19, 2025

Fix: extends handling in config files (global + suite)

Fixes #6872

Problem

  • extends was expanded too late in the load process:
    • Defaults were merged into the “inherited” config before extends was resolved.
      → Result: scalar values from parent configs were lost (arrays still merged).
    • params from parent configs were ignored (see also #6799).
  • For suite configs, extends resolution was missing completely for .suite.dist.yml files.
    → Result: extends in suite dist configs was silently ignored.

Fix

  • Moved extends expansion into getConfFromContents(), which is used for both global and suite config resolution.
  • Now an entire chain of inheritance is expanded immediately when a config is loaded from file.
  • Only after expansion, the normal config merge order applies:
    codeception.dist.yml → codeception.yml → acceptance.suite.dist.yml → acceptance.suite.yml
  • Added check for circular extends references with a clear error message.

Result

  • Scalars and arrays from parent configs are inherited correctly.
  • params from base configs are preserved.
  • extends works in .suite.dist.yml files (not ignored anymore).
  • Behavior is now consistent across global and suite configs.

Notes

  • This matches what the docs currently say about extends.
  • If merged, docs might be updated to clarify that the full inheritance chain is expanded first, then the normal config precedence rules apply.

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.

extends option in config files not working as expected
1 participant