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

Improve MergeYaml recipe #5036

Merged

Conversation

jevanlingen
Copy link
Contributor

@jevanlingen jevanlingen commented Feb 13, 2025

What's changed?

  • Support comments for the insert before option
  • Support insert before for sequences
  • Add support to insert after.

What's your motivation?

was written a little to fast. Lot's of edge cases were missing.

Any additional context

There are still bugs left:

  • Adding comments in the YAML snippet option does not really work; all cases where it does work are just by luck.
  • Comments in sequences do not work very well either. To fix this with current LST model, the same kind of code written inside the mergeMapping function should be written inside the mergeSequence too.

@jevanlingen jevanlingen requested a review from sambsnyd February 13, 2025 16:19
@jevanlingen jevanlingen self-assigned this Feb 13, 2025
@jevanlingen jevanlingen added bug Something isn't working recipe Requested Recipe labels Feb 13, 2025
github-actions[bot]

This comment was marked as off-topic.

github-actions[bot]

This comment was marked as off-topic.

github-actions[bot]

This comment was marked as off-topic.

Copy link
Contributor

@greg-at-moderne greg-at-moderne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, didn't read the test cases.

github-actions[bot]

This comment was marked as off-topic.

github-actions[bot]

This comment was marked as off-topic.

Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved apart from the earlier comments. Thanks again! Great to see the quick turnaround on this.

github-actions[bot]

This comment was marked as off-topic.

@jevanlingen jevanlingen merged commit 2c6cfda into main Feb 18, 2025
2 checks passed
@jevanlingen jevanlingen deleted the improve-merge-yaml-with-comment-support-on-insert-before-option branch February 18, 2025 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working recipe Requested Recipe
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants