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

Preventing retentionTime and retentionCount to be set to 0 #2790

Merged
merged 3 commits into from
May 24, 2024

Conversation

SophieGuo410
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented May 22, 2024

Codecov Report

Attention: Patch coverage is 89.47368% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 70.22%. Comparing base (52ba813) to head (b3cd46f).
Report is 16 commits behind head on master.

Files Patch % Lines
...rc/main/java/com/github/ambry/account/Dataset.java 85.71% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2790      +/-   ##
============================================
+ Coverage     64.24%   70.22%   +5.98%     
- Complexity    10398    11678    +1280     
============================================
  Files           840      840              
  Lines         71755    71920     +165     
  Branches       8611     8647      +36     
============================================
+ Hits          46099    50509    +4410     
+ Misses        23004    18775    -4229     
+ Partials       2652     2636      -16     

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

@SophieGuo410 SophieGuo410 force-pushed the Branch_do_not_allow_0 branch 2 times, most recently from df3f8e0 to ca2c50a Compare May 22, 2024 20:26
@SophieGuo410 SophieGuo410 marked this pull request as ready for review May 22, 2024 20:56
@SophieGuo410 SophieGuo410 changed the title Preventing retentionTime and retentionCount to be set to 0 for dataset Preventing retentionTime and retentionCount to be set to 0 May 22, 2024
Comment on lines 598 to 601
if (ttlFromHeader == 0) {
throw new RestServiceException(Headers.TTL + "[" + ttlFromHeader + "] should not be 0",
RestServiceErrorCode.InvalidArgs);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

we probably don't need this one here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove this part and updated to add test and filter out null(default) after serialization as we discussed.

field.setAccessible(true);
Object value = field.get(dataset);
if (value != null) {
gen.writeObjectField(field.getName(), value);
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should probably use annotation value here. something like

gen.writeObjectField(field.getAnnotation(JsonProperty.class).value(), value);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, updated it.

@SophieGuo410 SophieGuo410 merged commit 8c473bb into linkedin:master May 24, 2024
5 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

3 participants