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

Generate mutation die helpers for fields #149

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

scothis
Copy link
Collaborator

@scothis scothis commented Jun 25, 2024

Many more common mutation methods are now generated. These methods require additional metadata since they use dies backing a field value within the current die. Typically the required metadata is the name of the field on the current die, and the type for the Die backing the nested field's type. Additional metadata is required for fields backed by slices.

See updates to the README for details.

Where possible, existing mutation methods are updated to use the new code generation. In cases where the generated method name is different, the previous method was deprecated in favor of the new method. Where there is a discrepancy, the new names are more consistent.

Remaining mutation methods are mostly custom one-off methods that will likely never be generated. Adding additional methods in the future will be much easier as all applicable dies will get the new behavior.

Future enhancements can reduce the amount of metadata that the user must provide for each field by looking up type information and existing doc tags about the target field.

Many more common mutation methods are now generated. These methods
require additional metadata since they use dies backing a field value
within the current die. Typically the required metadata is the name of
the field on the current die, and the type for the Die backing the
nested field's type. Additional metadata is required for fields backed
by slices.

See updates to the README for details.

Where possible, existing mutation methods are updated to use the new
code generation. In cases where the generated method name is different,
the previous method was deprecated in favor of the new method. Where
there is a discrepancy, the new names are more consistent.

Remaining mutation methods are mostly custom one-off methods that will
likely never be generated. Adding additional methods in the future will
be much easier as all applicable dies will get the new behavior.

Future enhancements can reduce the amount of metadata that the user must
provide for each field by looking up type information and existing doc
tags about the target field.

Signed-off-by: Scott Andrews <[email protected]>
Copy link

codecov bot commented Jun 25, 2024

Codecov Report

Attention: Patch coverage is 1.03093% with 96 lines in your changes missing coverage. Please review.

Project coverage is 22.33%. Comparing base (04fcf15) to head (e9958b3).

Files Patch % Lines
apis/meta/v1/typemeta.go 1.09% 90 Missing ⚠️
...issionregistration/v1/validatingadmissionpolicy.go 0.00% 1 Missing ⚠️
apis/apiserver/flowcontrol/v1beta1/flowschema.go 0.00% 1 Missing ⚠️
apis/core/v1/node.go 0.00% 1 Missing ⚠️
apis/core/v1/persistantvolume.go 0.00% 1 Missing ⚠️
apis/core/v1/service.go 0.00% 1 Missing ⚠️
apis/node/v1/runtimeclass.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #149       +/-   ##
===========================================
+ Coverage   10.78%   22.33%   +11.54%     
===========================================
  Files          74       46       -28     
  Lines        3283     1236     -2047     
===========================================
- Hits          354      276       -78     
+ Misses       2918      950     -1968     
+ Partials       11       10        -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@mamachanko mamachanko left a comment

Choose a reason for hiding this comment

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

😲 lgmt!

@scothis scothis merged commit 1b2f39f into reconcilerio:main Jun 25, 2024
3 of 4 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.

None yet

2 participants