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

Fix deep_merge function to correctly handle nil arrays #11636

Merged
merged 1 commit into from
Sep 4, 2024
Merged

Conversation

roaks3
Copy link
Contributor

@roaks3 roaks3 commented Sep 4, 2024

This was discovered on https://cloud-internal-review.git.corp.google.com/c/cloud-graphite-eng/magic-modules-private-overrides/+/47770.

Previously, we could have a state where a new array field was added in the overrides (like conflicts), and this would cause a build failure. This occurred because string_array? assumes the array is not nil.

This fix checks both arrays for nil, and instead of failing when the array from magic-modules is nil, it returns the other array, which is what the caller likely expects.

Release Note Template for Downstream PRs (will be copied)


@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

1 similar comment
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

@roaks3 roaks3 requested a review from c2thorn September 4, 2024 19:11
Copy link
Member

@c2thorn c2thorn left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants