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

Move get monitor and search monitor action / request / responses to common-utils #566

Merged
merged 4 commits into from
Nov 22, 2023

Conversation

ohltyler
Copy link
Member

@ohltyler ohltyler commented Nov 21, 2023

Description

Moves get monitor and search monitor action, request, and response definitions (and all tests) from alerting to this plugin. This is so we can expose get monitor & search monitor functionality at the transport level using AlertingPluginInterface. This follows the same strategy as previous migrations - see #254 as an example.

  • created getMonitor and searchMonitors fn in AlertingPluginInterface
  • created GET_MONITOR_ACTION_NAME / GET_MONITOR_ACTION_TYPE, SEARCH_MONITORS_ACTION_NAME / SEARCH_MONITORS_ACTION_TYPE in AlertingActions
  • moved over GetMonitorRequest / GetMonitorResponse / GetMonitorRequest and related tests
  • removed the status field from GetMonitorResponse. This is so we can change the response from extending ActionResponse and ToXContentObject explicitly, and changing to BaseResponse, which has an override for getStatus(). Note the BaseResponse extends the same ActionResponse and ToXContentObject. This follows the same approach as done previously - see https://github.com/opensearch-project/alerting/pull/556/files as an example.

Confirmed the existing tests and added test in AlertingPluginInterfaceTests are passing. I've also confirmed this doesn't break functionality when alerting takes a dependency on these changes - there will be a follow up PR in alerting to change the dependencies from the alerting plugin definitions -> common-utils definitions.

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • 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.

Copy link

codecov bot commented Nov 21, 2023

Codecov Report

Attention: 88 lines in your changes are missing coverage. Please review.

Comparison is base (aa6246d) 75.14% compared to head (9b3f1be) 74.05%.

Files Patch % Lines
...arch/commons/alerting/action/GetMonitorResponse.kt 10.00% 53 Missing and 1 partial ⚠️
...earch/commons/alerting/action/GetMonitorRequest.kt 0.00% 23 Missing ⚠️
...ch/commons/alerting/action/SearchMonitorRequest.kt 0.00% 8 Missing ⚠️
...search/commons/alerting/AlertingPluginInterface.kt 72.72% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #566      +/-   ##
============================================
- Coverage     75.14%   74.05%   -1.10%     
- Complexity      874      877       +3     
============================================
  Files           130      133       +3     
  Lines          5685     5789     +104     
  Branches        698      708      +10     
============================================
+ Hits           4272     4287      +15     
- Misses         1104     1191      +87     
- Partials        309      311       +2     

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

@ohltyler
Copy link
Member Author

Related PR in alerting: opensearch-project/alerting#1305

eirsep
eirsep previously approved these changes Nov 21, 2023
@ohltyler ohltyler changed the title Move get monitor action / request / response to common-utils Move get monitor and search monitor action / request / responses to common-utils Nov 21, 2023
@bowenlan-amzn bowenlan-amzn merged commit 2ff995b into opensearch-project:main Nov 22, 2023
10 of 11 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 22, 2023
…ommon-utils (#566)

* Add get monitor request/response

Signed-off-by: Tyler Ohlsen <[email protected]>

* Remove status from response; add to interface

Signed-off-by: Tyler Ohlsen <[email protected]>

* Add UT

Signed-off-by: Tyler Ohlsen <[email protected]>

* Repeat for search monitor action

Signed-off-by: Tyler Ohlsen <[email protected]>

---------

Signed-off-by: Tyler Ohlsen <[email protected]>
(cherry picked from commit 2ff995b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@ohltyler ohltyler deleted the alerting-migration branch November 22, 2023 17:47
lezzago pushed a commit that referenced this pull request Nov 22, 2023
…ommon-utils (#566) (#567)

* Add get monitor request/response



* Remove status from response; add to interface



* Add UT



* Repeat for search monitor action



---------


(cherry picked from commit 2ff995b)

Signed-off-by: Tyler Ohlsen <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
engechas pushed a commit to engechas/common-utils that referenced this pull request Feb 12, 2024
…ommon-utils (opensearch-project#566)

* Add get monitor request/response

Signed-off-by: Tyler Ohlsen <[email protected]>

* Remove status from response; add to interface

Signed-off-by: Tyler Ohlsen <[email protected]>

* Add UT

Signed-off-by: Tyler Ohlsen <[email protected]>

* Repeat for search monitor action

Signed-off-by: Tyler Ohlsen <[email protected]>

---------

Signed-off-by: Tyler Ohlsen <[email protected]>
AWSHurneyt pushed a commit to AWSHurneyt/common-utils that referenced this pull request Apr 12, 2024
…ommon-utils (opensearch-project#566) (opensearch-project#567)

* Add get monitor request/response



* Remove status from response; add to interface



* Add UT



* Repeat for search monitor action



---------


(cherry picked from commit 2ff995b)

Signed-off-by: Tyler Ohlsen <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: AWSHurneyt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants