-
-
Notifications
You must be signed in to change notification settings - Fork 371
fix: kube-core::Schema hoisting logic #1839
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
base: main
Are you sure you want to change the base?
Conversation
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 <nick.larsen@stackable.tech> Co-authored-by: Sebastian Bernauer <sebastian.bernauer@stackable.tech> Co-authored-by: Techassi <git@techassi.dev> Signed-off-by: Nick Larsen <nick.larsen@stackable.tech>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1839 +/- ##
=======================================
+ Coverage 74.6% 75.2% +0.6%
=======================================
Files 84 90 +6
Lines 7910 8083 +173
=======================================
+ Hits 5900 6071 +171
- Misses 2010 2012 +2
🚀 New features to boost your workflow:
|
|
I'm unsure what to do about the CI error: For me, I get home@0.5.9. Should I pin the dependency? Line 50 in 7c63f56
|
|
Created #1840 to address the |
|
I've just synced this PR branch to include the CI fixes (done in #1840). This PR should now be ready for review. |
|
(Also a small draft PR with a fix popped up: #1841) |
|
Heyyy, sorry not had much time to deeply look at things the last month. This is definitely on the larger size, so only done a quick pass now, but the testing rigor is definitely super helpful! Thanks a lot for all this. One thing that stands out as different in the approaches here is the use of As a quick check first. Would you be OK with rebasing (possibly also splitting to expedite) this if I were to merge #1853 first? That's a pretty digestible PR, although it does seem to clash with your |
Fixes #1821
This updates the kube Schema hoisting since schemars Schema's have changed.
This also fixes other issues that appeared along the way:
nullentry added to enums.See also: stackabletech#1, where this work was originally done.
Motivation
Since kube 1.0.0, schemas became invalid when optional enums contained comments on the variants.
Solution