-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Update @elastic/elasticsearch to 8.0.0-canary13 #98266
Conversation
@@ -22,7 +22,7 @@ export function setupSavedObjects( | |||
name: ACTION_SAVED_OBJECT_TYPE, | |||
hidden: true, | |||
namespaceType: 'single', | |||
mappings: mappings.action, | |||
mappings: mappings.action as SavedObjectsTypeMappingDefinition, |
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.
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? |
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.
Security Solution changes LGTM -- thanks @mshustov!
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.
Canvas type update LGTM
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.
infra
plugin code LGTM - thank you!
I left just a question about a @ts-expect-error
below.
fields, | ||
// @ts-expect-error @elastic/elasticsearch expects "runtime" property |
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.
Does it? I can find neither runtime_mappings
nor runtime
on the type. 🤔
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.
Agree, I can't find it anymore. I will update the comment
fields: ['*'], | ||
// @ts-expect-error @elastic/elasticsearch expects "runtime" property |
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.
Same was above: Is that message misleading because the type has neither?
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.
LGTM
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.
Stack Monitoring changes look good 👍
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.
Fleet changes LGTM
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.
Note that the name of the branch is misleading
}; | ||
} as const; |
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: why casting as const
instead of const mappings: IndexMapping = ...
? (in some other test files too)
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's probably a good thing to finally get rid of these manually maintained types
index: { | ||
settings: { | ||
blocks: { |
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.
Is this an actual API 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.
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
this.types.set(type.name, deepFreeze(type)); | ||
this.types.set(type.name, deepFreeze(type) as SavedObjectsType); |
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.
What change caused this cast to be required?
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 believe it's the fact that SavedObjectsFieldMapping
is the union type from now on.
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.
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: |
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.
LGTM
* 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/elaticsearch
to the nextcanary
version and fix type errors.Most of the changes have been caused by changes in the
@elastic/elaticsearch
naming schema.