Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

fix null user in detector #301

Merged
merged 1 commit into from
Oct 30, 2020

Conversation

ylwu-amzn
Copy link
Contributor

Issue #, if available:

Description of changes:
Detector has null user as we can't get user from thread context and we don't set user in detector when create/update detector.

Test locally and on test cluster.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov
Copy link

codecov bot commented Oct 30, 2020

Codecov Report

Merging #301 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #301      +/-   ##
============================================
+ Coverage     71.26%   71.28%   +0.01%     
- Complexity     1868     1869       +1     
============================================
  Files           194      194              
  Lines          9018     9020       +2     
  Branches        766      766              
============================================
+ Hits           6427     6430       +3     
+ Misses         2227     2224       -3     
- Partials        364      366       +2     
Flag Coverage Δ Complexity Δ
#cli 79.27% <ø> (ø) 0.00 <ø> (ø)
#plugin 70.59% <100.00%> (+0.01%) 1869.00 <3.00> (+1.00)

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

Impacted Files Coverage Δ Complexity Δ
...est/handler/IndexAnomalyDetectorActionHandler.java 51.75% <ø> (+0.22%) 31.00 <0.00> (ø)
...transport/IndexAnomalyDetectorTransportAction.java 76.00% <100.00%> (-0.48%) 6.00 <1.00> (ø)
...ransport/SearchAnomalyDetectorTransportAction.java 48.38% <100.00%> (-1.62%) 4.00 <1.00> (ø)
.../transport/SearchAnomalyResultTransportAction.java 48.38% <100.00%> (-1.62%) 4.00 <1.00> (ø)
...sticsearch/ad/indices/AnomalyDetectionIndices.java 50.67% <0.00%> (+0.33%) 40.00% <0.00%> (ø%)
...transport/StatsAnomalyDetectorTransportAction.java 10.52% <0.00%> (+0.72%) 1.00% <0.00%> (ø%)
...ransport/DeleteAnomalyDetectorTransportAction.java 57.95% <0.00%> (+4.54%) 16.00% <0.00%> (+1.00%)

@@ -448,7 +448,7 @@ private void indexAnomalyDetector(String detectorId) throws IOException {
anomalyDetector.getSchemaVersion(),
Instant.now(),
anomalyDetector.getCategoryField(),
anomalyDetector.getUser()
user
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We didn’t put new user from thread context to detector, so the save will store null value

@ylwu-amzn ylwu-amzn merged commit 746360b into opendistro-for-elasticsearch:master Oct 30, 2020
@weicongs-amazon weicongs-amazon added the bug Something isn't working label Nov 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants