Skip to content

[Cross Cluster Replication] NP Shim#60121

Merged
jloleysens merged 21 commits intoelastic:masterfrom
jloleysens:np-shim/cross-cluster-replication
Mar 19, 2020
Merged

[Cross Cluster Replication] NP Shim#60121
jloleysens merged 21 commits intoelastic:masterfrom
jloleysens:np-shim/cross-cluster-replication

Conversation

@jloleysens
Copy link
Copy Markdown
Contributor

@jloleysens jloleysens commented Mar 13, 2020

Summary

Initial shimming of Cross Cluster Replication.

Future Work (for move out of legacy)

  • Proper handling of mounting the react application
  • Proper handling of license data and license route protection

Checklist

For maintainers

@jloleysens jloleysens added Feature:CCR and Remote Clusters v8.0.0 Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// release_note:skip Skip the PR/issue when compiling release notes v7.7.0 labels Mar 13, 2020
@elasticmachine
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
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.

Thanks for working on this @jloleysens!

I left a couple minor comments in the code. I also found two bugs that I think need to be addressed.

  • I cannot edit a follower index and get the following error:

Screen Shot 2020-03-16 at 11 03 18 AM

  • It looks like the Follower badge is missing in Index Management. I checked master, and it is working as expected, so I believe there was a regression in this PR.

Screen Shot 2020-03-16 at 11 14 40 AM

import { extractQueryParams } from '../services/query_params';
import { getRemoteClusterName } from '../services/get_remote_cluster_name';
import { API_STATUS } from '../constants';
import { API_STATUS, INDEX_ILLEGAL_CHARACTERS_VISIBLE } from '../constants';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you should be able to import INDEX_ILLEGAL_CHARACTERS_VISIBLE once #60186 is merged.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah I saw this guy coming up! I'll resolve once it is merged.

import { ManagementAppMountParams } from '../../../../../../../../src/plugins/management/public';

// @ts-ignore
import { BASE_PATH } from '../../../../common/constants';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this @ts-ignore needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nope! Placeholder from when it was a JS file!

esBase = `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}`;
};

export const autoFollowPatternUrl = () => `${esBase}/ccr-put-auto-follow-pattern.html`;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: now that these are functions, maybe consider renaming to use a verb, e.g., getAutoFollowPatternUrl?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Great point!

* you may not use this file except in compliance with the Elastic License.
*/

let esBase: () => string;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
let esBase: () => string;
let esBase: string;


// @ts-ignore
import { pauseAutoFollowPattern, resumeAutoFollowPattern } from '../../store/actions';
import { pauseAutoFollowPattern, resumeAutoFollowPattern } from '../../store/actions/index';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this change necessary?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

And by 👍 I mean no of course 😄

@jloleysens
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@jloleysens
Copy link
Copy Markdown
Contributor Author

@alisonelizabeth Thanks for taking a look!

I cannot edit a follower index and get the following error:

Hmm, curious, I remember seeing this on the create and then I changed the request body to be a string. Perhaps I hadn't pushed that change - I am able to create and edit auto follow patterns and create follower indices (but not edit them, it looks disallowed by the UI). Would you mind taking another look?

It looks like the Follower badge is missing in Index Management...

Very well caught! It looks like I introduced a logic regression for the data enricher on the server side! Just pushed a fix 👍

@alisonelizabeth
Copy link
Copy Markdown
Contributor

@jloleysens thanks for fixing the issue with the badge, looks good now!

I am able to create and edit auto follow patterns and create follower indices (but not edit them, it looks disallowed by the UI).

What do you mean by "it looks disallowed"? Maybe we have something set up differently? It is possible on my end, and I am still seeing the same error that I mentioned above. As you said, create/edit auto-follow patterns works as expected.

Screen Shot 2020-03-16 at 1 02 05 PM

Screen Shot 2020-03-16 at 1 03 33 PM

@jloleysens
Copy link
Copy Markdown
Contributor Author

@alisonelizabeth Ah ok I see, I was referring to the the greyed out text fields, but I see there is an advanced section that can be edited.

Copy link
Copy Markdown
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.

Latest changes LGTM. Thanks @jloleysens!

@jloleysens
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

Folder called __tests__ with Jest tests was breaking mocha.
@jloleysens
Copy link
Copy Markdown
Contributor Author

Waiting for #60186 to merge, will need to clean up duplication of ui/indices code

@cjcenizal
Copy link
Copy Markdown
Contributor

cjcenizal commented Mar 18, 2020

@jloleysens I just merged #60186

…-cluster-replication

* 'master' of github.com:elastic/kibana: (89 commits)
  Sort by name when fetching alerts and connectors (elastic#60506)
  Make slack param validation handle empty messages (elastic#60468)
  [Alerting] Adds navigation by consumer and alert type to alerting (elastic#58997)
  Introduce search interceptor (elastic#60523)
  [ML] Add functional tests for file data visualizer (elastic#60413)
  [APM] Optimize service map query (elastic#60412)
  [SIEM][Detection Engine] Adds lists feature flag and list values to the REST interfaces
  Enhancement/update esdocs datasource (elastic#59512)
  [junit] only include stdout in report for failures (elastic#60530)
  Update dependency nock to v12 (elastic#60422)
  upgrade execa to get stdout/stderr in error messages (elastic#60537)
  skip flaky suite (elastic#60471)
  [Ingest] Agent Config Details - Data sources list ui (elastic#60429)
  [SIEM] Create ML Rules (elastic#58053)
  skip flaky suite (elastic#60559)
  fix agent type (elastic#60554)
  Fixed default message for index threshold includes both threshold values (elastic#60545)
  [Ingest] Add support for `yaml` field types (elastic#60440)
  Solved the issue for a GROUP BY expression validation (elastic#60558)
  [Maps] Mark instance state as readonly (elastic#60557)
  ...

# Conflicts:
#	x-pack/legacy/plugins/cross_cluster_replication/public/np_ready/app/components/auto_follow_pattern_form.js
#	x-pack/legacy/plugins/cross_cluster_replication/public/np_ready/app/components/follower_index_form/follower_index_form.js
#	x-pack/legacy/plugins/cross_cluster_replication/public/np_ready/app/components/follower_index_form/follower_index_form.test.js
#	x-pack/legacy/plugins/cross_cluster_replication/public/np_ready/app/services/auto_follow_pattern_validators.js
#	x-pack/legacy/plugins/cross_cluster_replication/public/np_ready/app/services/input_validation.js
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

History

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

@jloleysens jloleysens merged commit 254cf99 into elastic:master Mar 19, 2020
@jloleysens jloleysens deleted the np-shim/cross-cluster-replication branch March 19, 2020 14:42
jloleysens added a commit to jloleysens/kibana that referenced this pull request Mar 19, 2020
* Public in WiP state, removed all 'ui/' imports

* First iteration of public shimmed and working

* A whole lotta WIP server side

* Server-side to using the NP router + client side changes

Updated the client code to properly encode requests to the
server. Did first E2E test.

Route tests are probably broken, need to fix them.

* Removed unused error wrapping code

* Update client Jest tests

* Add breadcrumbs service mock

* Fix server side Jest tests

* Add helper functions file for server side Jest tests

* Fix API integration tests

* Fixed boolean logic mistake in due to refactor in index mgmt ext.

Also migrated to the a more NP friendly version of index mgmt
extension.

* Remove unused import

* Clean up some cruft and refactor URL variable names

* Fix stringification of body and fix boolean server logic

* Fix mocha

Folder called __tests__ with Jest tests was breaking mocha.

* Refactor to Jest test

* Fix types issues in jest test

* Migrate to new config-schema API

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
jloleysens added a commit that referenced this pull request Mar 19, 2020
* Public in WiP state, removed all 'ui/' imports

* First iteration of public shimmed and working

* A whole lotta WIP server side

* Server-side to using the NP router + client side changes

Updated the client code to properly encode requests to the
server. Did first E2E test.

Route tests are probably broken, need to fix them.

* Removed unused error wrapping code

* Update client Jest tests

* Add breadcrumbs service mock

* Fix server side Jest tests

* Add helper functions file for server side Jest tests

* Fix API integration tests

* Fixed boolean logic mistake in due to refactor in index mgmt ext.

Also migrated to the a more NP friendly version of index mgmt
extension.

* Remove unused import

* Clean up some cruft and refactor URL variable names

* Fix stringification of body and fix boolean server logic

* Fix mocha

Folder called __tests__ with Jest tests was breaking mocha.

* Refactor to Jest test

* Fix types issues in jest test

* Migrate to new config-schema API

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Mar 20, 2020
* master:
  [ML] Use a new ML endpoint to estimate a model memory (elastic#60376)
  [Logs UI] Correctly update the expanded log rate table rows (elastic#60306)
  fixes drag and drop flakiness (elastic#60625)
  Removing isEmptyState from embeddable input (elastic#60511)
  [Cross Cluster Replication] NP Shim (elastic#60121)
  Clear changes when canceling an edit to an alert (elastic#60518)
  Update workflow syntax (elastic#60626)
  Updating project assigner workflows to v2.0.0 of the action and back to default tokens (elastic#60577)
  migrate saved objects management edition view to react/typescript/eui (elastic#59490)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:CCR and Remote Clusters 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 t// v7.7.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants