Skip to content

Added the removed LabelApplicationRuleDataDeserializationConfig.java file #189

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

Merged
merged 4 commits into from
Jun 20, 2023

Conversation

sanket-mundra
Copy link
Contributor

Added the removed file from this PR: #185

Description

Please include a summary of the change, motivation and context.

Testing

Please describe the tests that you ran to verify your changes. Please summarize what did you test and what needs to be tested e.g. deployed and tested helm chart locally.

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

Documentation

Make sure that you have documented corresponding changes in this repository or hypertrace docs repo if required.

@sanket-mundra sanket-mundra requested a review from a team as a code owner June 20, 2023 06:09
@github-actions
Copy link

github-actions bot commented Jun 20, 2023

Test Results

25 tests  ±0   25 ✔️ ±0   13s ⏱️ -3s
11 suites ±0     0 💤 ±0 
11 files   ±0     0 ±0 

Results for commit 4785fa5. ± Comparison against base commit 544b610.

♻️ This comment has been updated with latest results.

@codecov
Copy link

codecov bot commented Jun 20, 2023

Codecov Report

Merging #189 (4785fa5) into main (544b610) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##               main     #189   +/-   ##
=========================================
  Coverage     22.31%   22.31%           
  Complexity       75       75           
=========================================
  Files            68       68           
  Lines          1788     1788           
  Branches         54       54           
=========================================
  Hits            399      399           
  Misses         1380     1380           
  Partials          9        9           
Flag Coverage Δ
unit 22.31% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

skjindal93
skjindal93 previously approved these changes Jun 20, 2023
@@ -133,6 +133,9 @@ StringCondition convertStringCondition(
StringCondition.Builder stringConditionBuilder =
StringCondition.newBuilder()
.setOperator(convertStringConditionOperator(stringCondition.operator()));
if (stringCondition.stringConditionValueType() == null) {
Copy link
Contributor Author

@sanket-mundra sanket-mundra Jun 20, 2023

Choose a reason for hiding this comment

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

When stringCondition.stringConditionValueType() was null, the below switch case was throwing NPE. Earlier I thought default will handle null case as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than duplicating the return here, use something like Type type = Optional.ofNullable(condition.stringConditionValueType()).orElse(VALUE);, and then send it into the switch. Also make sure the valueType is annotated @Nullable, we do that so the IDE should have flagged the existing code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Gotcha - make sure your IDE is set up to highlight the issue. We really need to update our CI-run static analysis to check things like this too.

public List<Module> jacksonModules() {
return List.of(
new SimpleModule()
.addAbstractTypeMapping(
Copy link
Contributor

Choose a reason for hiding this comment

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

Sloppy review on my part - we can't get rid of the whole file since the arg name/schema mapping is still needed above, but all the jackson mappings are unnecessary if they're already declared elsewhere.

@@ -133,6 +133,9 @@ StringCondition convertStringCondition(
StringCondition.Builder stringConditionBuilder =
StringCondition.newBuilder()
.setOperator(convertStringConditionOperator(stringCondition.operator()));
if (stringCondition.stringConditionValueType() == null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than duplicating the return here, use something like Type type = Optional.ofNullable(condition.stringConditionValueType()).orElse(VALUE);, and then send it into the switch. Also make sure the valueType is annotated @Nullable, we do that so the IDE should have flagged the existing code.

@sanket-mundra sanket-mundra merged commit cec635a into main Jun 20, 2023
@sanket-mundra sanket-mundra deleted the fixLabelApplicationRule branch June 20, 2023 17:31
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