Skip to content

fix(project): change config merge priority#556

Merged
Soner (shyim) merged 3 commits intoshopware:mainfrom
jankal:fix/config-merge
Jun 4, 2025
Merged

fix(project): change config merge priority#556
Soner (shyim) merged 3 commits intoshopware:mainfrom
jankal:fix/config-merge

Conversation

@jankal
Copy link
Copy Markdown
Contributor

Having the following configurations:

File: shopware-project.staging.yml

url: https://xyz.nuonic.dev
include:
    - .shopware-project.base.yml
sync:
    config:
        - settings:
              core.store.licenseHost: xyz.nuonic.dev

File: shopware-project.base.yml

admin_api:
    client_id: ${SHOPWARE_CLI_CLIENT_ID}
    client_secret: ${SHOPWARE_CLI_CLIENT_SECRET}
dump:
    where:
        customer: "email LIKE '%@nuonic.de' OR email LIKE '%@xyz.com'"
    nodata:
        - promotion
        - promotion_cart_rule
        - promotion_discount
        - promotion_discount_prices
        - promotion_discount_rule
        - promotion_individual_code
        - promotion_order_rule
        - promotion_persona_customer
        - promotion_persona_rule
        - promotion_sales_channel
        - promotion_setgroup
        - promotion_setgroup_rule
        - promotion_translation
        - newsletter_recipient
        - order
        - order_address
        - order_customer
        - order_delivery
        - order_delivery_position
        - order_line_item
        - order_line_item_download
        - order_tag
        - order_transaction
        - order_transaction_capture
        - order_transaction_capture_refund
        - order_transaction_capture_refund_position
    rewrite:
        product_review:
            email: "faker.Internet.Email()"
        log_entry:
            provider: ""

Running any shopware-cli project ... --project-config shopware-project.staging.yml

The current merging order removes sync.config[0] from the merged config as it was nil in my shopware-project.base.yml. Changing the config merging order fixes this behavior and gives the topmost config precedence.

Soner (@shyim) maybe there is a better fix for this (smth like mergo.WithOverwriteWithEmptyValue)

@jankal Alex Jank (jankal) changed the title fix(project): change merge priority fix(project): change config merge priority May 28, 2025
@shyim Soner (shyim) merged commit 1a1bb88 into shopware:main Jun 4, 2025
4 checks passed
@shyim
Copy link
Copy Markdown
Member

Thank you!

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