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 behavior for default-only tagged entity fields #102

Merged

Conversation

aiven-anton
Copy link
Collaborator

This enables the Java tests for the last non-record entity: FetchRequest. This was previously failing because on the Java side, the ReplicaState field tagged field is omitted when all of the nested fields are equal to defaults.

Because our logic already has the correct behavior in general for tagged fields, all that was needed here was to make such parent fields have a default value. We detect when we can set a default by checking if the nested entity has default values for all of its fields.

Partially addresses #100.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (04455db) 96.69% compared to head (b097bc9) 96.69%.

Additional details and impacted files
@@                          Coverage Diff                           @@
##           aiven-anton/fix-nullable-entity-field     #102   +/-   ##
======================================================================
  Coverage                                  96.69%   96.69%           
======================================================================
  Files                                         14       14           
  Lines                                        997      997           
  Branches                                     141      141           
======================================================================
  Hits                                         964      964           
  Misses                                        29       29           
  Partials                                       4        4           

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

Base automatically changed from aiven-anton/fix-nullable-entity-field to main December 5, 2023 13:29
This enables the Java tests for the last non-record entity:
FetchRequest. This was previously failing because on the Java side, the
ReplicaState field tagged field is omitted when all of the nested fields
are equal to defaults.

Because our logic already has the correct behavior in general for tagged
fields, all that was needed here was to make such parent fields have a
default value. We detect when we can set a default by checking if the
nested entity has default values for all of its fields.
@aiven-anton aiven-anton force-pushed the aiven-anton/fix-tagged-entity-field-all-defaults branch from b097bc9 to f1d25de Compare December 5, 2023 13:32
@aiven-anton aiven-anton marked this pull request as ready for review December 5, 2023 13:33
@giuseppelillo giuseppelillo merged commit cc3ec0a into main Dec 11, 2023
12 checks passed
@giuseppelillo giuseppelillo deleted the aiven-anton/fix-tagged-entity-field-all-defaults branch December 11, 2023 10:58
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