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

Adding RestActions support Create/Update Detector API #243

Merged
merged 9 commits into from
Oct 13, 2020

Conversation

saratvemulapalli
Copy link
Contributor

@saratvemulapalli saratvemulapalli commented Oct 10, 2020

*Issue #195 *

Description of changes:
Adding RestActions support Create/Update Detector API which is needed to support AD FGAC

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

@saratvemulapalli saratvemulapalli self-assigned this Oct 10, 2020
@saratvemulapalli saratvemulapalli marked this pull request as ready for review October 10, 2020 00:10
@codecov
Copy link

codecov bot commented Oct 10, 2020

Codecov Report

Merging #243 into master will increase coverage by 0.08%.
The diff coverage is 42.23%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #243      +/-   ##
============================================
+ Coverage     71.60%   71.68%   +0.08%     
- Complexity     1352     1367      +15     
============================================
  Files           153      157       +4     
  Lines          6406     6513     +107     
  Branches        490      493       +3     
============================================
+ Hits           4587     4669      +82     
- Misses         1587     1609      +22     
- Partials        232      235       +3     
Flag Coverage Δ Complexity Δ
#cli 79.27% <ø> (ø) 0.00 <ø> (ø)
#plugin 70.74% <42.23%> (+0.11%) 1367.00 <16.00> (+15.00)

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

Impacted Files Coverage Δ Complexity Δ
...stroforelasticsearch/ad/AnomalyDetectorPlugin.java 93.54% <ø> (ø) 10.00 <0.00> (ø)
...search/ad/rest/RestIndexAnomalyDetectorAction.java 42.55% <0.00%> (-11.51%) 3.00 <0.00> (ø)
.../ad/rest/handler/AnomalyDetectorActionHandler.java 6.66% <0.00%> (ø) 1.00 <0.00> (ø)
...est/handler/IndexAnomalyDetectorActionHandler.java 15.48% <14.00%> (+15.48%) 2.00 <0.00> (+2.00)
...arch/ad/transport/IndexAnomalyDetectorRequest.java 45.16% <45.16%> (ø) 7.00 <7.00> (?)
...rch/ad/transport/IndexAnomalyDetectorResponse.java 75.00% <75.00%> (ø) 4.00 <4.00> (?)
...transport/IndexAnomalyDetectorTransportAction.java 91.66% <91.66%> (ø) 2.00 <2.00> (?)
...d/transport/GetAnomalyDetectorTransportAction.java 51.21% <100.00%> (ø) 9.00 <1.00> (ø)
...earch/ad/transport/IndexAnomalyDetectorAction.java 100.00% <100.00%> (ø) 2.00 <2.00> (?)
...sticsearch/ad/indices/AnomalyDetectionIndices.java 63.04% <0.00%> (-1.45%) 24.00% <0.00%> (-2.00%)
... and 5 more

@@ -254,7 +254,8 @@ List<String> jacocoExclusions = [
'com.amazon.opendistroforelasticsearch.ad.transport.StatsAnomalyDetectorTransportAction',
'com.amazon.opendistroforelasticsearch.ad.transport.DeleteAnomalyDetectorTransportAction*',
'com.amazon.opendistroforelasticsearch.ad.transport.GetAnomalyDetectorTransportAction*',
'com.amazon.opendistroforelasticsearch.ad.transport.GetAnomalyDetectorResponse'
'com.amazon.opendistroforelasticsearch.ad.transport.GetAnomalyDetectorResponse',
'com.amazon.opendistroforelasticsearch.ad.transport.IndexAnomalyDetectorRequest'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added IndexAnomalyDetectorRequest using Powermock but JaCoCo doesnt read lines covered by Powermock tests.

@saratvemulapalli saratvemulapalli changed the title Adding RestActions support Create Detector API Adding RestActions support Create/Update Detector API Oct 10, 2020
@saratvemulapalli saratvemulapalli changed the base branch from fgac-get-api to master October 12, 2020 20:20
@@ -132,11 +141,15 @@ public IndexAnomalyDetectorActionHandler(
*/
public void start() throws IOException {
if (!anomalyDetectionIndices.doesAnomalyDetectorIndexExist()) {
System.out.println("AnomalyDetector Indices do not exist");
Copy link
Contributor

@ylwu-amzn ylwu-amzn Oct 12, 2020

Choose a reason for hiding this comment

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

Remove System.out.println, check other places too

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.. there are other debugging logs as well. Will remove them.

@ohltyler
Copy link
Contributor

Could you rebase with master to only have the changes related to create/update detector?

@saratvemulapalli
Copy link
Contributor Author

Could you rebase with master to only have the changes related to create/update detector?

Sure, just rebased and merged master changes into this PR.

Copy link
Contributor

@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.

LGTM!

Copy link
Contributor

@ylwu-amzn ylwu-amzn left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the change!

@saratvemulapalli saratvemulapalli merged commit ebf145a into master Oct 13, 2020
@saratvemulapalli saratvemulapalli deleted the fgac-start-api branch October 13, 2020 00:05
@ohltyler ohltyler added the enhancement New feature or request label Oct 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants