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 Rollup out of legacy #62891

Merged
merged 10 commits into from
Apr 24, 2020
Merged

Conversation

cjcenizal
Copy link
Contributor

@cjcenizal cjcenizal commented Apr 8, 2020

This PR complements #21117, in which the client was moved out of legacy. This PR completes the migration by moving the server code out of legacy, too.

Other changes

Per discussion with @lukasolson and @flash1293, I attempted to remove the rollup search strategy code (649b172). This code was deprecated in favor of functionality provided by the data_enhanced plugin. However, this ended up breaking some TSVB functional tests so I reverted this change.

Reviewing

Reviewing each commit individually might be easier than reviewing the end result. I tried to make each one as atomic as possible. Note that the changes to the rollup search strategy in the first commit can be ignored because this code was removed in a subsequent commit.

Testing

Setup

The pattern for creating a rollup job and rollup index pattern is:

  • Install sample data (web logs is a good one).
  • Create a rollup job with an index pattern that captures this index (e.g. k*).
  • Set frequency to "minute". Clear the latency buffer field.
  • Select the time field which is the same time field selected in the installed index pattern (timestamp without an @ in the case of web logs).
  • Select a few terms, histogram, and metrics fields.
  • Create and start the rollup job. Wait a minute for the job to run. You should see the numbers for documents and pages processed change in the detail panel.
  • Create a rollup index pattern in the Index Patterns app.
  • Now you can create visualizations using this index pattern.

Settings

Set xpack.rollup.enabled: false and confirm the app isn't visible in the UI.

Create job

Validation

Verify that a validation error tells you when the index pattern doesn't match any indices.

image

Verify that a validation error tells you when there's a collision between the index pattern and rollup index name.

image

  • Verify that a validation error tells you when the index pattern matches rollup indices.
  • Verify that a success message tells you when the index pattern matches indices.

image

Verify that a validation error tells you that you need to input a time bucket size.

image

Review

Verify that the "Request" tab shows you the request you can make to create the rollup job you've configured.

image

Verify that checking the "Start now" checkbox creates the rollup job in a "Started" state.

Actions

  • Stop a job and confirm its "Delete" action isn't available.
  • Start a job and confirm its "Delete" action is available.
  • Delete a job.
  • Select a started job and a stopped job. Confirm that performing the "Start" option on them starts the stopped one and there are no errors.
  • Select a started job and a stopped job. Confirm that performing the "Stop" option on them starts the stopped one and there are no errors.
  • Select two started jobs and perform the "Stop" action on them.
  • Select two stopped jobs and perform the "Start" action on them.
  • Select two started jobs and confirm you can't "Delete" them. Stop them and then delete them.

Job configuration

Create a rollup job without terms, histogram, or metrics fields and confirm these tabs aren't visible in the job's detail panel after it's been created.

Missing entity

Open a detail flyout of a rollup job and then edit the URL so that it loads one that doesn't exist. Verify it shows a "not found" message.

image

Errors

Some of these errors are reproducible through the UI (e.g. creating jobs with name collisions), but some require editing the API code to send incorrect payloads to ES. I don't think reviewers need to test them -- I'm just recording this information to show that I tested these cases and verified that changes to the way the API returns errors haven't broken the way the UI handles them.

image

image

image

image

@cjcenizal cjcenizal added chore Feature:New Platform Feature:Rollups release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.8.0 v8.0.0 labels Apr 8, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

@elastic elastic deleted a comment from kibanamachine Apr 10, 2020
@cjcenizal cjcenizal force-pushed the np/rollup-out-of-legacy branch from 2d780ee to 29e23ad Compare April 10, 2020 02:15
@cjcenizal cjcenizal changed the title Move Rollup out of legacy [skip-ci] Move Rollup out of legacy Apr 10, 2020
@cjcenizal cjcenizal force-pushed the np/rollup-out-of-legacy branch 7 times, most recently from 8bee653 to b861ca8 Compare April 23, 2020 16:01
@cjcenizal cjcenizal changed the title [skip-ci] Move Rollup out of legacy Move Rollup out of legacy Apr 23, 2020
@cjcenizal cjcenizal added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Apr 23, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@cjcenizal cjcenizal marked this pull request as ready for review April 23, 2020 16:03
@cjcenizal cjcenizal requested a review from a team as a code owner April 23, 2020 16:03
@cjcenizal cjcenizal force-pushed the np/rollup-out-of-legacy branch from b861ca8 to bcb526f Compare April 23, 2020 16:26
@cjcenizal
Copy link
Contributor Author

@lukasolson @flash1293 Could you please confirm that the rollup search strategy code I removed in db4c9797f2a0beb4201f9ad732ca55105636e61d hasn't broken anything on the Kibana App side?

@cjcenizal
Copy link
Contributor Author

cjcenizal commented Apr 24, 2020

@flash1293 Can you take a look at my changes to the TSVB rollup tests in 5f9937d? These were originally failing because the metric text was 0, instead 3 as expected. What's odd is that as I watched the test run locally I noticed the time field was never being selected -- so I guess the question I have isn't as much what broke, but how were these originally passing? I'll take a look on master to compare behavior.

Edit: I checked out master and, yup, something in this PR has changed the way TSVB behaves when consuming rollup data. I'm not familiar enough with TSVB to lend any insight here.

… data_enhanced plugin now provides this functionality."

This reverts commit 649b172.
@cjcenizal
Copy link
Contributor Author

@lukasolson @flash1293 Sorry for the noise. 😅 I tried reverting my commit that removes the rollup search strategy and that got the tests passing again. So now the only things I need your eyes on are the changes to the rollup search strategy code in the original NP migration commit, 9434083.

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Tested visualize and TSVB and both still work fine, LGTM. No code review. @lukasolson probably knows better how the search endpoints line up behind the scenes.

Copy link
Contributor

@alisonelizabeth alisonelizabeth left a comment

Choose a reason for hiding this comment

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

Nice work @cjcenizal! Thanks for the detailed PR description - very helpful. I went through all the test cases and everything worked as expected. I left two non-blocker comments. Great to see another plugin 100% migrated 🎉

request: KibanaRequest
): APICaller => {
return rollupEsClient.asScoped(request).callAsCurrentUser;
// return (...args: any[]): APICaller => {
Copy link
Contributor

Choose a reason for hiding this comment

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

can this be deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, good spot!

@@ -0,0 +1,3 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

is this file necessary?

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@cjcenizal cjcenizal merged commit 18d1af2 into elastic:master Apr 24, 2020
@cjcenizal cjcenizal deleted the np/rollup-out-of-legacy branch April 24, 2020 21:27
@rylnd
Copy link
Contributor

rylnd commented Apr 27, 2020

@cjcenizal does this still need to be backported to 7.x? I wasn't able to find a backport PR and my own NP backport conflicts with this, so I'm guessing so.

I created #64603 which is likely going to cause a conflict with your eventual 7.x backport (sorry!), but it should just be two lines in x-pack/index.js.

@cjcenizal
Copy link
Contributor Author

Thanks for the nudge @rylnd! Looks like I did miss the backport. 🤕

cjcenizal added a commit to cjcenizal/kibana that referenced this pull request Apr 28, 2020
cjcenizal added a commit that referenced this pull request Apr 28, 2020
* Move Rollup out of legacy (#62891)

* Put back 7.x-specific logic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Feature:NP Migration Feature:Rollups release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.8.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants