-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Migrate CCR to new ES JS client. #100131
Migrate CCR to new ES JS client. #100131
Conversation
78d822b
to
e0b22af
Compare
@@ -74,17 +74,17 @@ export default function ({ getService }) { | |||
|
|||
describe('get()', () => { | |||
it('should return a 404 when the follower index does not exist', async () => { | |||
const name = getRandomString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sebelga I removed this helper in favor of explicit hard-coded values for a couple reasons:
- When debugging a test gone wrong (for example, clean up code that deletes these primitives), explicit hard-coded values can provide debugging information
- I generally try to simplify systems by removing any code that isn't necessary, and it didn't seem necessary to me to randomize these values
Do I have your blessing to make this change? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed on the reasoning. You do have my blessing! 👍 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, Seb!
2. Start your "remote" cluster by running `yarn es snapshot --license=trial -E cluster.name=europe -E transport.port=9400` in a separate terminal tab. | ||
3. Index a document into your remote cluster by running `curl -X PUT http://elastic:changeme@localhost:9201/my-leader-index --data '{"settings":{"number_of_shards":1,"soft_deletes.enabled":true}}' --header "Content-Type: application/json"`. | ||
Note that these settings are required for testing auto-follow pattern conflicts errors (see below). | ||
1. Ensure Kibana isn't running so it doesn't load up any data into your cluster. Run `yarn es snapshot --license=trial` to install a fresh snapshot. Wait for ES to finish setting up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yuliacech I believe you wrote these originally, but I wasn't able to get the original instructions to work. Can you check this and see if I was just doing it wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating those instructions, @cjcenizal! I can confirm that the previous instructions didn't work for me either, tested your steps and it worked like a charm 👍
@@ -11,21 +11,19 @@ import { EuiCallOut, EuiSpacer } from '@elastic/eui'; | |||
export function SectionError(props) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll migrate this to use our shared SectionError
as part of #84801
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
@elasticmachine merge upstream |
@@ -25,24 +24,9 @@ export interface StartDependencies { | |||
} | |||
|
|||
export interface RouteDependencies { | |||
router: CcrPluginRouter; | |||
router: IRouter<RequestHandlerContext>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: RequestHandlerContext
is the default value of the generics in the IRouter
interface
router: IRouter<RequestHandlerContext>; | |
router: IRouter; |
@@ -5,13 +5,12 @@ | |||
* 2.0. | |||
*/ | |||
|
|||
import { IRouter, ILegacyScopedClusterClient, RequestHandlerContext } from 'src/core/server'; | |||
import { IRouter, RequestHandlerContext } from 'src/core/server'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: RequestHandlerContext
is not needed, see comment below
import { IRouter, RequestHandlerContext } from 'src/core/server'; | |
import { IRouter } from 'src/core/server'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @cjcenizal, thanks a lot for migrating CCR to the new js client.
I tested locally and everything seems to work as before, I haven't noticed any regressions. Code changes LGTM too 👍 Just left a couple of nits in the comments.
1eab4f7
to
f2f583d
Compare
💚 Build SucceededMetrics [docs]Async chunks
Unknown metric groupsReferences to deprecated APIs
History
To update your PR or re-run it, just comment with: |
* Update SectionError component to render error root causes correctly. * Fix 404 error rendering. * Add test for follower index update API route.
…sens/kibana into reporting/new-png-pdf-report-type * 'reporting/new-png-pdf-report-type' of github.com:jloleysens/kibana: (46 commits) [Security Solution] Add Ransomware canary advanced policy option (elastic#101068) [Exploratory view] Core web vitals (elastic#100320) [Security solution][Endpoint] Add unit tests for fleet event filters/trusted apps cards (elastic#101034) [Lens] Use a setter function for the dimension panel (elastic#101123) [Index Patterns] Fix return saved index pattern object (elastic#101051) [CI] For PRs, build TS refs before public api docs check (elastic#100791) [Maps] fix line and polygon label regression (elastic#101085) Migrate CCR to new ES JS client. (elastic#100131) [Canvas] Switch Canvas to use React Router (elastic#100579) [Expressions] Use table column ID instead of name when set (elastic#99724) [DOCS] Updates docs landing page (elastic#100749) [DOCS] Corrects typo in step 3 (elastic#101079) [DOCS] Updates runtime example in Discover (elastic#100926) Migrate kibana.autocomplete config to data plugin (elastic#100586) [Uptime] New width/delay definition for waterfall sidebar item tooltip (elastic#100147) [FTR] Use importExport for saved_object/basic archive (elastic#100244) [Fleet] Better input for multi text input in agent policy builder (elastic#101020) [CI] Buildkite support with Baseline pipeline (elastic#100492) [Reporting/Telemetry] Do not send telemetry if we are in screenshot mode (elastic#100388) Create API keys with metadata (elastic#100682) ...
Summary
Partially addresses #73973 and #83910.
Changes
README
with new steps to testccr.getAutoFollowPattern
ccr.stats
ccr.followInfo
ccr.followStats
Behavior to test
Actions
Errors
Error checking permissions.
Error creating auto-follow pattern.
Error creating follower index.
Can't load auto-follow pattern (404).
Can't load follower index (404).