Skip to content

Merge config objects #37

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

Merged
merged 3 commits into from
May 6, 2025
Merged

Merge config objects #37

merged 3 commits into from
May 6, 2025

Conversation

eedorenko
Copy link
Collaborator

No description provided.

@eedorenko eedorenko requested a review from Copilot May 6, 2025 22:01
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 aims to merge config objects while upgrading the YAML library. Key changes include:

  • Upgrading the YAML library version in scheduler/templater.go from v2 to v3.
  • Changing the array merging logic in controllers/assignment_controller.go to iterate through new array values and merge maps with matching "name" keys.

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
scheduler/templater.go Upgraded YAML dependency to v3 for improved YAML processing
controllers/assignment_controller.go Revised merge logic to merge matching map objects by "name" key
Files not reviewed (1)
  • go.mod: Language not supported

@eedorenko eedorenko requested a review from Copilot May 6, 2025 22:03
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 aims to merge configuration objects by updating dependency versions and refining the object merging logic. Key changes include:

  • Upgrading the YAML library from v2 to v3 in scheduler/templater.go.
  • Revising the merge algorithm in controllers/assignment_controller.go to handle merging of array elements based on their "name" key.

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
scheduler/templater.go Upgraded YAML library from v2 to v3, which may affect output formatting.
controllers/assignment_controller.go Replaced simple array appending with a merge strategy for map elements by "name".
Files not reviewed (1)
  • go.mod: Language not supported
Comments suppressed due to low confidence (1)

scheduler/templater.go:30

  • Ensure the migration from yaml.v2 to yaml.v3 is fully validated against expected YAML output, as v3 may introduce changes in formatting or handling edge cases compared to v2.
"gopkg.in/yaml.v3"

@eedorenko eedorenko requested a review from Copilot May 6, 2025 22:06
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 pull request updates the YAML library version in the templater and refines the merge logic for config arrays by merging map entries based on a matching "name" key.

  • Update YAML import from v2 to v3 in scheduler/templater.go
  • Replace simple array appending with an iterative merge approach in controllers/assignment_controller.go

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
scheduler/templater.go Updated YAML library from v2 to v3
controllers/assignment_controller.go Modified merge logic to iteratively merge array elements based on "name" keys
Files not reviewed (1)
  • go.mod: Language not supported
Comments suppressed due to low confidence (1)

controllers/assignment_controller.go:406

  • Since yaml.v3 may produce maps with string keys rather than interface{} keys, please verify that the type assertions and comparisons for the "name" key are robust against potential mismatches. Consider adding explicit type conversions (e.g., casting to string) before comparison.
if existingValueMap["name"] == valueMap["name"] {

@eedorenko eedorenko merged commit 7719445 into main May 6, 2025
3 checks passed
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.

1 participant