feat(config): add .shopware-project.local.yml override support#908
Merged
Soner (shyim) merged 4 commits intomainfrom Mar 13, 2026
Merged
feat(config): add .shopware-project.local.yml override support#908Soner (shyim) merged 4 commits intomainfrom
Soner (shyim) merged 4 commits intomainfrom
Conversation
… !override tags Support local config overrides similar to Docker Compose's compose.override.yaml. When a .shopware-project.local.yml file exists alongside .shopware-project.yml, it is automatically merged on top with the following semantics: - Scalars: local value wins - Maps: deep-merged - Slices: appended - !reset tag: clears a field (e.g., `cleanup_paths: !reset []`) - !override tag: replaces entirely instead of deep-merging
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for automatically loading a per-user local override config file (e.g. .shopware-project.local.yml) and merging it on top of the main project config, with YAML tags to control merge semantics (!reset, !override).
Changes:
- Adds YAML node scanning + map-merge utilities to implement
!resetand!overridesemantics for local overrides. - Updates
ReadConfigto detect and apply<config>.local.(yml|yaml)overrides. - Adds unit tests covering filename derivation and merge behaviors (scalar overrides, slice append/reset, map override, include interaction, and empty local file).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/shop/config_override.go | Implements local override filename derivation and YAML merge logic with !reset/!override. |
| internal/shop/config.go | Integrates local override detection + merged-config loading into ReadConfig. |
| internal/shop/config_override_test.go | Adds tests for local override filename derivation and merge semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
- Warn when os.Stat on local config file fails with non-NotExist error - Standardize error message format to ReadConfig(%s) without space
- Use tagged switch instead of if-else chains (staticcheck QF1003) - Add missing cases for ScalarNode and AliasNode (exhaustive)
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.
Summary
.shopware-project.local.ymlfiles that are automatically merged on top of.shopware-project.yml, similar to how Docker Compose handlescompose.override.yaml!resetYAML tag to clear fields (e.g.,cleanup_paths: !reset []empties the list instead of appending)!overrideYAML tag to fully replace fields instead of deep-merging (e.g.,dump: !override { nodata: [cart] }replaces the entire dump section)Merge semantics
!reset!overrideExample
Test plan
localConfigFileNamederivation!resetclears slices to empty!resetwith new values replaces list entirely!overridereplaces entire map section!reseton nested fields preserves siblingsinclude:mechanism