Skip to content

Conversation

pkazi
Copy link
Contributor

@pkazi pkazi commented Jul 21, 2025

Fix #1056

Test

To test this pull request, you can run the following commands:

cd <to_package_directory>
go test

Additional Information

Checklist

  • I have updated the documentation via pull request in website repository.

Tradeoff

Potential improvement

Note - This code is generated by GitHub Copilot

@pkazi pkazi changed the title Support multiple yaml keys for 1 target Fixes #1056 Support multiple yaml keys for 1 target #1056 Jul 21, 2025
@olblak
Copy link
Member

olblak commented Jul 22, 2025

Thanks for the PR.
At a first look, it looks good but I would like to spend more time to reviewing it.
Code generated by AI is usually pretty good a looking good but with wrong logic

@olblak olblak added enhancement New feature or request resource-yaml Resource of kind YAML labels Jul 22, 2025
@olblak olblak requested a review from Copilot July 22, 2025 15:08
Copilot

This comment was marked as outdated.

@olblak olblak requested a review from Copilot July 28, 2025 19:38
Copilot

This comment was marked as outdated.

@olblak olblak requested a review from Copilot July 29, 2025 06:43
Copilot

This comment was marked as outdated.

@olblak olblak requested a review from Copilot July 29, 2025 07:05
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements support for multiple YAML keys in targets, allowing users to update multiple paths in YAML files with a single value. This addresses issue #1056 by introducing a new Keys field that accepts an array of key paths.

Key changes include:

  • Added Keys field to the Spec struct as an alternative to the single Key field
  • Modified target logic to process multiple keys sequentially for each file
  • Enhanced validation to ensure Key and Keys are mutually exclusive and prevent duplicates

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/plugins/resources/yaml/main.go Added Keys field, validation logic, and helper methods
pkg/plugins/resources/yaml/target.go Modified target functions to iterate over multiple keys
pkg/plugins/resources/yaml/target_test.go Added comprehensive test cases for multiple key scenarios
pkg/plugins/resources/yaml/main_test.go Added validation tests for the new Keys field
pkg/plugins/resources/yaml/source_test.go Added missing Key field to fix existing test
pkg/plugins/resources/yaml/condition_test.go Added missing Key field to fix existing test

@olblak olblak enabled auto-merge (squash) July 30, 2025 14:32
@olblak olblak changed the title Support multiple yaml keys for 1 target #1056 feat: support multiple yaml keys for 1 target Jul 30, 2025
@olblak olblak merged commit 482daa2 into updatecli:main Jul 30, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request resource-yaml Resource of kind YAML
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: update multiple yaml keys with one target
2 participants