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

Breaking change in v4.40.1 pre-release - explode (merge using anchors) no longer works #1861

Closed
kirici opened this issue Nov 13, 2023 · 2 comments
Labels

Comments

@kirici
Copy link

kirici commented Nov 13, 2023

Describe the bug
A clear and concise description of what the bug is.

Note that any how to questions should be posted in the discussion board and not raised as an issue.

Version of yq: 4.40.1
Operating system: Linux 6.5.6-300.fc39.x86_64
Installed via: go install github.com/mikefarah/yq/v4@v4.40.1 (also tested using latest (currently 79a50b9))

Input Yaml

template.yaml:

.defaults: &defaults
  pantry: [sauce]
options:
- &lunch
  protein: meat
- &dinner
  protein: eggs
---
# 1.
<<: *defaults
buy:
- *lunch
---
# 2.
<<: *defaults
buy:
- *lunch
- *dinner

Command
The command you ran:

yq 'explode(.) | select(di == 2)' template.yaml

Actual behavior

buy:
  - *lunch
  - *dinner

Expected behavior

pantry: [sauce]
buy:
  - protein: meat
  - protein: eggs

Additional context
Working up until v4.35.2

@mikefarah
Copy link
Owner

Hey thanks for raising, I'm looking into this

mikefarah added a commit that referenced this issue Nov 14, 2023
@kirici
Copy link
Author

kirici commented Nov 16, 2023

Just noticed that I forgot to paste the actual bug description, sorry 😅
Tested the fix in my actual project via go install github.com/mikefarah/yq/v4@c7ef94603155dee1f1a73c20f2350a989b726bd9 and it seems to be all fixed.
Thanks for the immediate response.

@kirici kirici closed this as completed Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants