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 bugs in OneOf to Object conversion #4555

Merged
merged 5 commits into from
Feb 4, 2025

Conversation

theunrepentantgeek
Copy link
Member

@theunrepentantgeek theunrepentantgeek commented Feb 2, 2025

What this PR does

Fixes a few small errors that I uncovered while troubleshooting issues with Kusto resources.

Leaf Merging

Previously we've always merged object properties into the root of a one-of, then pushed them down to the leaves. Due to the way Kusto resources are structured, we now also need to support merging object properties directly into leaves. (Instead of embedding a OneOf directly into an AllOff, the Kusto resources instead refer to a separate type definition, triggering the change in behaviour.)

Avoid lost updates

In two locations, the synthesizer was looking up an unmodified type definition when that type had already been modified, resulting in the previous updates being lost. All type lookup now goes through a helper method (lookupType) that avoids this propblem.

OneOf Equality

We hadn't updated equality of one-of types, causing lost object updates when additional properties were added. (Two one-of objects, one containing three object-property types, the other four, were comparing as equal.)

Special notes

Also updates CRD documentation for ContainerRegistry - now that documentation has been merged, the code generator has introduced linkes.

How does this PR make you feel?

gif

Checklist

  • this PR contains tests

Choose a reason for hiding this comment

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

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

@theunrepentantgeek theunrepentantgeek added this pull request to the merge queue Feb 4, 2025
Merged via the queue into main with commit fbd6ed7 Feb 4, 2025
8 checks passed
@theunrepentantgeek theunrepentantgeek deleted the fix/one-of-conversion branch February 4, 2025 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Recently Completed
Development

Successfully merging this pull request may close these issues.

2 participants