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

[Alerting] Add scoped cluster client to alerts and actions services #80794

Merged

Conversation

justinkambic
Copy link
Contributor

@justinkambic justinkambic commented Oct 16, 2020

Summary

As part of #80116 we discovered that one of the alerts required usage of IndexPatternsFetcher. Presently, the alert/action services do not provide a scoped client for this purpose. This is already on the alerting team's roadmap, so it will unblock the aforementioned patch and resolve the roadmap issue.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@justinkambic justinkambic added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.11.0 labels Oct 16, 2020
@justinkambic justinkambic requested a review from a team as a code owner October 16, 2020 03:10
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

@justinkambic
Copy link
Contributor Author

@elasticmachine merge upstream

@mattkime
Copy link
Contributor

@elasticmachine merge upstream

Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

LGTM, simple enough :-)

It would be good to have some tests though - I think maybe we can just change one of our existing functional tests to use the new client - would be good enough for me. Eg, one like this:

await services.callCluster('index', {
index: params.index,
refresh: 'wait_for',
body: {
state,
params,
reference: params.reference,
source: 'alert:test.always-firing',
alertInfo,
},
});

@mikecote mikecote self-requested a review October 19, 2020 18:54
Copy link
Contributor

@mikecote mikecote left a comment

Choose a reason for hiding this comment

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

Changes LGTM. Agreed, it could use a test, happy to help

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@gmmorris
Copy link
Contributor

LGTM once a test is added, thanks for doing this!

That said, please remove the resolves above as this doesn't actually resolve the issue- once the legacy client is removed, then we can consider #50247 resolved. :)
It is still worth keeping a reference to #50247 in the desc to explain the context.

Thanks ❤️

Copy link
Member

@pmuellr pmuellr 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 updating that function test to use the new client!

@justinkambic justinkambic merged commit cc43b14 into elastic:master Oct 20, 2020
justinkambic added a commit to justinkambic/kibana that referenced this pull request Oct 20, 2020
…lastic#80794)

* Add scoped cluster client to alerts and actions services.

* Modify functional test to use new ES client.
gmmorris added a commit to gmmorris/kibana that referenced this pull request Oct 20, 2020
* master: (64 commits)
  Rename Security Solution Bug Template (elastic#81187)
  Update links (elastic#81125)
  Specify format for date range query (elastic#81025)
  [Alerting] Improve toast when alert is created (elastic#80327)
  [UX] Add empty states (elastic#80904)
  Add TS config for kibana_legacy (elastic#80992)
  [Telemetry] Add method to enable endpoint security data usage example (elastic#80940)
  [Alerting] Add scoped cluster client to alerts and actions services (elastic#80794)
  Fix reactRouterNavigate when used with a string (elastic#80520)
  [Security Solution] [Detections] Read privileges for dependencies (elastic#80852)
  [ML] Fixing exclude frequent in advanced wizard (elastic#81121)
  Fix security solution template label (elastic#80976)
  [DOCS] Update index management docs (elastic#80893)
  [APM] Error rate on service list page is not in sync with the value at the transaction page (elastic#80814)
  skip flaky suite (elastic#81072)
  [Task Manager] Cleans up legacy plugin structure (elastic#80381)
  Support unsigned_long fields (elastic#81115)
  [Form lib] Export internal state instead of raw state (elastic#80842)
  [Lens] Add toast notification when visualization is saved (elastic#80788)
  Index pattern edit field formatter API (elastic#78352)
  ...
justinkambic added a commit that referenced this pull request Oct 20, 2020
…80794) (#81167)

* Add scoped cluster client to alerts and actions services.

* Modify functional test to use new ES client.
@justinkambic
Copy link
Contributor Author

Backported to:
7.x/7.11.0 742ba6e
#81167

@justinkambic justinkambic deleted the alerting_scoped-cluster-client branch October 20, 2020 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants