Update @elastic/elasticsearch to 8.0.0-canary13#98266
Update @elastic/elasticsearch to 8.0.0-canary13#98266mshustov merged 100 commits intoelastic:masterfrom
Conversation
| hidden: true, | ||
| namespaceType: 'single', | ||
| mappings: mappings.action, | ||
| mappings: mappings.action as SavedObjectsTypeMappingDefinition, |
There was a problem hiding this comment.
mappings imported from json file are inferred with { type: string since we cannot enforce immutability with as const, so I had to cast the type manually
|
@jgowdyelastic Would you be able to check ML plugin type errors, please? |
poffdeluxe
left a comment
There was a problem hiding this comment.
Canvas type update LGTM
weltenwort
left a comment
There was a problem hiding this comment.
infra plugin code LGTM - thank you!
I left just a question about a @ts-expect-error below.
| }, | ||
| // @ts-expect-error @elastic/elasticsearch doesn't declare body.fields on AsyncSearchSubmitRequest | ||
| fields, | ||
| // @ts-expect-error @elastic/elasticsearch expects "runtime" property |
There was a problem hiding this comment.
Does it? I can find neither runtime_mappings nor runtime on the type. 🤔
There was a problem hiding this comment.
Agree, I can't find it anymore. I will update the comment
| }, | ||
| // @ts-expect-error @elastic/elasticsearch doesn't declare body.fields on AsyncSearchSubmitRequest | ||
| fields: ['*'], | ||
| // @ts-expect-error @elastic/elasticsearch expects "runtime" property |
There was a problem hiding this comment.
Same was above: Is that message misleading because the type has neither?
igoristic
left a comment
There was a problem hiding this comment.
Stack Monitoring changes look good 👍
pgayvallet
left a comment
There was a problem hiding this comment.
Note that the name of the branch is misleading ![]()
| }, | ||
| }, | ||
| }; | ||
| } as const; |
There was a problem hiding this comment.
NIT: why casting as const instead of const mappings: IndexMapping = ... ? (in some other test files too)
There was a problem hiding this comment.
When TS infers a type for an object { type: 'keyword' }, it ends up with { type: string } since the object can be mutated. as const asserts that the object is immutable and the final type will be { type: "keyword" }.
There was a problem hiding this comment.
we can do const mappings: IndexMapping =, but it found as const easier to understand 🤷♂️
| export interface SavedObjectsCoreFieldMapping { | ||
| type: string; | ||
| null_value?: number | boolean | string; | ||
| index?: boolean; |
There was a problem hiding this comment.
That's probably a good thing to finally get rid of these manually maintained types
| body: { | ||
| index: { | ||
| settings: { | ||
| blocks: { |
There was a problem hiding this comment.
Is this an actual API change?
There was a problem hiding this comment.
According to the Elasticsearch tests, both forms are valid
https://github.com/elastic/elasticsearch/blob/27089e74602dc442656cf97ca4b29af79f724933/qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/FullClusterRestartIT.java#L560
https://github.com/elastic/elasticsearch/blob/27089e74602dc442656cf97ca4b29af79f724933/qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/FullClusterRestartIT.java#L301
I picked one supported by @elastic/elasticsearch client
| } | ||
| validateType(type); | ||
| this.types.set(type.name, deepFreeze(type)); | ||
| this.types.set(type.name, deepFreeze(type) as SavedObjectsType); |
There was a problem hiding this comment.
What change caused this cast to be required?
There was a problem hiding this comment.
I believe it's the fact that SavedObjectsFieldMapping is the union type from now on.
shahzad31
left a comment
There was a problem hiding this comment.
Uptime changes LGTM !!
💚 Build SucceededMetrics [docs]Public APIs missing comments
Async chunks
Public APIs missing exports
History
To update your PR or re-run it, just comment with: |
* bump @elastic/elasticsearch to canary.7 * address errors in core * address errors in data plugin * address errors in Alerting team plugins * remove outdated messages in Lens * remove unnecessary comments in ML * address errors in Observability plugin * address errors in reporting plugin * address errors in Rule registry plugin * fix errors in Security plugins * fix errors in ES-UI plugin * remove unnecessary union. * update core tests * fix kbn-es-archiver * update to canary 8 * bump to v9 * use new typings * fix new errors in core * fix errors in core typeings * fix type errors in data plugin * fix type errors in telemetray plugin * fix data plugin tests * fix search examples type error * fix errors in discover plugin * fix errors in index_pattern_management * fix type errors in vis_type_* * fix errors in typings/elasticsearch * fix type errors in actions plugin * fix type errors in alerting and apm plugins * fix type errors in canvas and cases * fix errors in event_log * fix type errors in ILM and ingest_pipelines * fix errors in lens plugin * fix errors in lists plugin * fix errors in logstash * fix errors in metrics_entities * fix errors in o11y * fix errors in watcher * fix errors in uptime * fix errors in upgrade_assistant * fix errors in task_manager * fix errors in stack_alerts * fix errors in security_solution * fix errors in rule_registry * fix errors in snapshot_restore * fix remaining errors * fix search intergration tests * adjust assetion * bump version to canary.10 * adapt code to new naming schema * use mapping types provided by the client library * Revert "adjust assetion" This reverts commit 19b8fe0. * fix so intergration tests * fix http integration tests * bump version to canary 11 * fix login test * fix http integration test * fix apm test * update docs * fixing some ml types * fix new errors in data plugin * fix new errors in alerting plugin * fix new errors in lists plugin * fix new errors in reporting * fix or mute errors in rule_registry plugin * more ML type fixes * bump to canary 12 * fix errors after merge conflict * additional ML fixes * bump to canary 13 * fix errors in apm plugin * fix errors in fleet plugin * fix errors in infra plugin * fix errors in monitoring plugin * fix errors in osquery plugin * fix errors in security solution plugins * fix errors in transform plugin * Update type imports for ES * fix errors in x-pack plugins * fix errors in tests * update docs * fix errors in x-pack/test * update error description * fix errors after master merge * update comment in infra plugin * fix new errors on xpack tests/ Co-authored-by: James Gowdy <jgowdy@elastic.co> Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co> # Conflicts: # package.json # src/core/server/saved_objects/migrationsv2/integration_tests/migration.test.ts # test/common/services/saved_object_info.ts # x-pack/plugins/snapshot_restore/server/routes/api/repositories.ts # x-pack/plugins/snapshot_restore/server/routes/api/snapshots.ts # yarn.lock
* Update @elastic/elasticsearch to 8.0.0-canary13 (#98266) * bump @elastic/elasticsearch to canary.7 * address errors in core * address errors in data plugin * address errors in Alerting team plugins * remove outdated messages in Lens * remove unnecessary comments in ML * address errors in Observability plugin * address errors in reporting plugin * address errors in Rule registry plugin * fix errors in Security plugins * fix errors in ES-UI plugin * remove unnecessary union. * update core tests * fix kbn-es-archiver * update to canary 8 * bump to v9 * use new typings * fix new errors in core * fix errors in core typeings * fix type errors in data plugin * fix type errors in telemetray plugin * fix data plugin tests * fix search examples type error * fix errors in discover plugin * fix errors in index_pattern_management * fix type errors in vis_type_* * fix errors in typings/elasticsearch * fix type errors in actions plugin * fix type errors in alerting and apm plugins * fix type errors in canvas and cases * fix errors in event_log * fix type errors in ILM and ingest_pipelines * fix errors in lens plugin * fix errors in lists plugin * fix errors in logstash * fix errors in metrics_entities * fix errors in o11y * fix errors in watcher * fix errors in uptime * fix errors in upgrade_assistant * fix errors in task_manager * fix errors in stack_alerts * fix errors in security_solution * fix errors in rule_registry * fix errors in snapshot_restore * fix remaining errors * fix search intergration tests * adjust assetion * bump version to canary.10 * adapt code to new naming schema * use mapping types provided by the client library * Revert "adjust assetion" This reverts commit 19b8fe0. * fix so intergration tests * fix http integration tests * bump version to canary 11 * fix login test * fix http integration test * fix apm test * update docs * fixing some ml types * fix new errors in data plugin * fix new errors in alerting plugin * fix new errors in lists plugin * fix new errors in reporting * fix or mute errors in rule_registry plugin * more ML type fixes * bump to canary 12 * fix errors after merge conflict * additional ML fixes * bump to canary 13 * fix errors in apm plugin * fix errors in fleet plugin * fix errors in infra plugin * fix errors in monitoring plugin * fix errors in osquery plugin * fix errors in security solution plugins * fix errors in transform plugin * Update type imports for ES * fix errors in x-pack plugins * fix errors in tests * update docs * fix errors in x-pack/test * update error description * fix errors after master merge * update comment in infra plugin * fix new errors on xpack tests/ Co-authored-by: James Gowdy <jgowdy@elastic.co> Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co> # Conflicts: # package.json # src/core/server/saved_objects/migrationsv2/integration_tests/migration.test.ts # test/common/services/saved_object_info.ts # x-pack/plugins/snapshot_restore/server/routes/api/repositories.ts # x-pack/plugins/snapshot_restore/server/routes/api/snapshots.ts # yarn.lock * revert @ts-expect-error changes in infra plugin * update docs
Summary
closes #97970
closes #99526
Update
@elastic/elaticsearchto the nextcanaryversion and fix type errors.Most of the changes have been caused by changes in the
@elastic/elaticsearchnaming schema.