Skip to content

Conversation

@sbernauer
Copy link
Member

@sbernauer sbernauer commented Oct 8, 2025

Fixes kube Schema conversion since schemars Schema's have changed.

  • Add tests for a variety of enum use-cases:
    • Tagged vs Untagged
    • Unit vs Tuple vs Structural variants
    • With and without doc-comments (descriptions)
  • Rewrite the hoisting logic
    • This is annotated with dev-comments to help understand intend and to ease future schemars changes.

This also fixes other issues:

  • Untagged enum variant doc-comments were being applied to field descriptions.
  • Additional null entry added to enums.

@sbernauer sbernauer self-assigned this Oct 8, 2025
@sbernauer sbernauer moved this to Development: In Progress in Stackable Engineering Oct 8, 2025
@sbernauer sbernauer closed this Oct 9, 2025
@sbernauer sbernauer reopened this Oct 9, 2025
Note: As described on the function, it is overly documented to express intent where it can be a little unclear. Ideally where would be some clearer official Kubernetes documentation on the differences between regular OpenAPI 3 schemas, and what Kubernetes accepts.
… there are no oneOfs at the top level of the schema
Note: At this point, there is some strange interaction with the new hoisting functions and the existing code whereby "properties" disappear.
…l as enum

All tests in this PR are passing

Note: The function should be renamed, but it needs some work to not only do optional things.
@NickLarsenNZ

This comment was marked as outdated.

@stackable-cla
Copy link

stackable-cla bot commented Oct 28, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@Techassi Techassi left a comment

Choose a reason for hiding this comment

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

Mostly looks good to me, just a few questions and comments.

@NickLarsenNZ NickLarsenNZ merged commit 6938fad into fix/schema-hoisting Oct 28, 2025
13 of 16 checks passed
@NickLarsenNZ NickLarsenNZ moved this from Development: In Review to Development: Done in Stackable Engineering Oct 28, 2025
sbernauer added a commit that referenced this pull request Oct 29, 2025
Fixes kube Schema conversion since schemars Schema's have changed.

- Add tests for a variety of enum use-cases:
  - Tagged vs Untagged
  - Unit vs Tuple vs Structural variants
  - With and without doc-comments (descriptions)
- Rewrite the hoisting logic
  - This is annotated with dev-comments to help understand intend and to ease future schemars changes.

This also fixes other issues:
- Untagged enum variant doc-comments were being applied to field descriptions.
- Additional `null` entry added to enums.

---------

Co-authored-by: Nick Larsen <[email protected]>
Co-authored-by: Sebastian Bernauer <[email protected]>
Co-authored-by: Techassi <[email protected]>
NickLarsenNZ added a commit that referenced this pull request Oct 29, 2025
Fixes kube Schema conversion since schemars Schema's have changed.

- Add tests for a variety of enum use-cases:
  - Tagged vs Untagged
  - Unit vs Tuple vs Structural variants
  - With and without doc-comments (descriptions)
- Rewrite the hoisting logic
  - This is annotated with dev-comments to help understand intend and to ease future schemars changes.

This also fixes other issues:
- Untagged enum variant doc-comments were being applied to field descriptions.
- Additional `null` entry added to enums.

---------

Co-authored-by: Nick Larsen <[email protected]>
Co-authored-by: Sebastian Bernauer <[email protected]>
Co-authored-by: Techassi <[email protected]>
Signed-off-by: Nick Larsen <[email protected]>
sbernauer added a commit that referenced this pull request Oct 29, 2025
Fixes kube Schema conversion since schemars Schema's have changed.

- Add tests for a variety of enum use-cases:
  - Tagged vs Untagged
  - Unit vs Tuple vs Structural variants
  - With and without doc-comments (descriptions)
- Rewrite the hoisting logic
  - This is annotated with dev-comments to help understand intend and to ease future schemars changes.

This also fixes other issues:
- Untagged enum variant doc-comments were being applied to field descriptions.
- Additional `null` entry added to enums.

---------

Co-authored-by: Nick Larsen <[email protected]>
Co-authored-by: Sebastian Bernauer <[email protected]>
Co-authored-by: Techassi <[email protected]>
Signed-off-by: Nick Larsen <[email protected]>
@lfrancke lfrancke moved this from Development: Done to Done in Stackable Engineering Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

4 participants