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

bug/alerting-action-preview #337

Closed

Conversation

sikhote
Copy link
Contributor

@sikhote sikhote commented Oct 2, 2022

Signed-off-by: David Sinclair dsincla@rei.com

Description

  • Fixes how the alert query response is saved, so it is stored in the same way as the DefineMonitor component here: public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.js
  • In componentDidMount of DefineTrigger, also run the onRun method to get the context saved from the upper ConfigureActions component, which is the same context used to display preview messages.

Issues Resolved

This will hopefully resolve #152 -- note, the correct use of Mustache template for the issue in the ticket would be like this:

{{#ctx.results.0.hits.hits.0}}
{{_source.agent}}
{{/ctx.results.0.hits.hits.0}}

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.

Signed-off-by: David Sinclair <dsincla@rei.com>
@sikhote sikhote requested a review from a team October 2, 2022 18:30
Signed-off-by: David Sinclair <dsincla@rei.com>
@codecov-commenter
Copy link

Codecov Report

Merging #337 (dc3dcb5) into main (6305d7f) will decrease coverage by 0.06%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #337      +/-   ##
==========================================
- Coverage   52.73%   52.67%   -0.07%     
==========================================
  Files         209      207       -2     
  Lines        5450     5443       -7     
  Branches      763      763              
==========================================
- Hits         2874     2867       -7     
  Misses       2574     2574              
  Partials        2        2              
Impacted Files Coverage Δ
...eTrigger/containers/DefineTrigger/DefineTrigger.js 12.12% <0.00%> (-0.19%) ⬇️
...gins/alerting-dashboards-plugin/utils/constants.js
...plugins/alerting-dashboards-plugin/babel.config.js

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@amsiglan
Copy link
Collaborator

resolves #332

} = this.props;
switch (searchType) {
case SEARCH_TYPE.CLUSTER_METRICS:
if (canExecuteClusterMetricsMonitor(uri)) this.onRunExecute();
break;
default:
onRun();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looking at this method inside the ConfigureTriggers, it seems to be calling the same endpoint with the same monitor data it receives as prop which is passed to this component. Can you explain a little more, why we need this call?

@AWSHurneyt
Copy link
Collaborator

The cypress tests are failing because the alerting plugin is currently set to version 2.4, whereas OpenSearch-Dashboards branch used by the workflow is set to 2.4.1. Once this PR #363 is merged, and you've rebased your dev branch, the cypress check should succeed.

@AWSHurneyt
Copy link
Collaborator

@sikhote PR #363 has been merged. Can you rebase the recent changes onto your dev branch? That should resolve the failing cypress workflow.

@@ -131,7 +131,7 @@ class ConfigureTriggers extends React.Component {
case SEARCH_TYPE.QUERY:
case SEARCH_TYPE.GRAPH:
const searchRequest = buildRequest(formikValues);
_.set(monitorToExecute, 'inputs[0].search', searchRequest);
_.set(monitorToExecute, 'inputs[0]', searchRequest);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just FYI, This is already checked in as part of another PR

@sikhote
Copy link
Contributor Author

sikhote commented Dec 8, 2022

The original issue seems to be fixed by #334 -- closing this.

@sikhote sikhote closed this Dec 8, 2022
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.

[BUG] OpenSearch Dashboards Alerting Action Preview
5 participants