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

Changed default description to empty string instead of null #438

Merged
merged 1 commit into from
Mar 15, 2022

Conversation

amitgalitz
Copy link
Member

@amitgalitz amitgalitz commented Mar 15, 2022

Signed-off-by: Amit Galitzky amgalitz@amazon.com

Description

Changed the default description field to be set to an empty string instead of a null field. This means that description should also be changed from a required field as listed in documentation to an optional field since if detector description is missing then it will be filled as an empty string.

Currently if there is a missing description field, the backend still creates the detector even though it is listed as required which causes issues on the frontend which tries to parse a null a value unsuccessfully when getting the relevant detector.

Other option is to throw an exception if description is missing and hence enforce the required description which we don't enforce on the backend today and we also let users know it is optional on the frontend, where we just have it as empty if not filled out. For this reason, it makes more sense to just keep it consistent as an 'optional' field from UX point of view.

Reproduced the bug stated in the issue before change was made and tested that bug doesn't occur after this change

Issues Resolved

resolves #437

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@amitgalitz amitgalitz requested a review from a team March 15, 2022 03:44
@codecov-commenter
Copy link

codecov-commenter commented Mar 15, 2022

Codecov Report

Merging #438 (b09bbcf) into main (8550816) will decrease coverage by 0.13%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #438      +/-   ##
============================================
- Coverage     77.70%   77.57%   -0.14%     
+ Complexity     4111     4109       -2     
============================================
  Files           296      296              
  Lines         17657    17657              
  Branches       1879     1879              
============================================
- Hits          13720    13697      -23     
- Misses         3032     3058      +26     
+ Partials        905      902       -3     
Flag Coverage Δ
plugin 77.57% <100.00%> (-0.14%) ⬇️

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

Impacted Files Coverage Δ
.../java/org/opensearch/ad/model/AnomalyDetector.java 91.92% <100.00%> (ø)
...port/SearchAnomalyDetectorInfoTransportAction.java 60.00% <0.00%> (-4.45%) ⬇️
...rch/ad/transport/ForwardADTaskTransportAction.java 94.06% <0.00%> (-3.39%) ⬇️
...va/org/opensearch/ad/feature/SearchFeatureDao.java 84.56% <0.00%> (-2.08%) ⬇️
...ain/java/org/opensearch/ad/task/ADTaskManager.java 75.69% <0.00%> (-0.99%) ⬇️
...java/org/opensearch/ad/task/ADBatchTaskRunner.java 81.76% <0.00%> (+0.15%) ⬆️
...opensearch/ad/indices/AnomalyDetectionIndices.java 72.28% <0.00%> (+0.18%) ⬆️
...ava/org/opensearch/ad/task/ADHCBatchTaskCache.java 90.12% <0.00%> (+1.23%) ⬆️

ohltyler
ohltyler previously approved these changes Mar 15, 2022
Copy link
Member

@ohltyler ohltyler left a comment

Choose a reason for hiding this comment

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

@amitgalitz thanks for the quick work and owning this issue!

ylwu-amzn
ylwu-amzn previously approved these changes Mar 15, 2022
Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
@amitgalitz
Copy link
Member Author

rebased with main @ohltyler @ylwu-amzn

@amitgalitz amitgalitz merged commit 124a269 into opensearch-project:main Mar 15, 2022
@amitgalitz amitgalitz added bug Something isn't working backport 1.x labels Mar 22, 2022
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 22, 2022
Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
(cherry picked from commit 124a269)
amitgalitz added a commit that referenced this pull request Mar 22, 2022
Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
(cherry picked from commit 124a269)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.x bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle missing description fields in create detector API
4 participants