Skip to content

[Mappings editor] Remove boost parameter from field types#113142

Merged
sebelga merged 9 commits intoelastic:masterfrom
sebelga:index-management/remove-boost-index-template
Sep 30, 2021
Merged

[Mappings editor] Remove boost parameter from field types#113142
sebelga merged 9 commits intoelastic:masterfrom
sebelga:index-management/remove-boost-index-template

Conversation

@sebelga
Copy link
Contributor

@sebelga sebelga commented Sep 27, 2021

This PR removes support for the boost parameter in the mappings editor from 8.x.

Updated types

  • boolean
  • date and date_nanos
  • flattened
  • ip
  • keyword
  • numeric (all of them)
  • range (all of them)
  • text
  • token_count

I am going to check if index templates or component templates with mappings that contains the boost parameters are surfaced in Upgrade assistant. As this should be done ES side it does not block merging this work.

How to test

  • Navigate to index management > Index template tab
  • Create a new template
  • Fill the logistic step and navigate to the mappings editor
  • Create a field
  • Edit the field and make sure that the "boost" parameter is not present anymore
  • Change the type to one of the list above and make sure that the boost parameter not present

Fixes #78293

@sebelga sebelga requested a review from a team as a code owner September 27, 2021 16:57
@sebelga sebelga added 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.16.0 v8.0.0 labels Sep 27, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-stack-management (Team:Stack Management)

plugins: SetupDependencies
): IndexManagementPluginSetup {
const { fleet, usageCollection, management } = plugins;
const kibanaVersion = new SemVer(this.ctx.env.packageInfo.version);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cjcenizal as you can see, with a system like this in place it is easy to test 7.x and 8.x UIs without switching branch (and we know how long that can take).

Replace this line with: const kibanaVersion = new SemVer('7.16.0') and that's it.

Copy link
Member

Choose a reason for hiding this comment

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

Could we document this process in the readme of the app?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure (yet) that this deserves an entry in the README. It is practical to know this trick to test different UI behaviour on 7.x and 8.x while developing but not sure it is of interest of user testing the app.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It might be good to document it maybe in the dev docs. But we probably want to wait and see if the branching system changes in any way with the "make it minor" effort.

setValue(newValue);
return newValue;

if (isMounted.current) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I needed to add this if statement as there was a strange race condition in one of the tests.

Copy link
Member

Choose a reason for hiding this comment

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

Should we add any tests for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is test coverage for form.reset() in the use_form.test.tsx which test this part of the code. Aside this is a very low risk change as we are simply protecting ourselves from updating the state on an unmounted component.

// "PluginInitializerContext.env.packageInfo.version". In some cases it is not possible
// to dynamically inject that version without a huge refactor on the code base.
// We will then keep this single constant to declare on which major branch we are.
export const MAJOR_VERSION = '8.0.0';
Copy link
Contributor Author

@sebelga sebelga Sep 27, 2021

Choose a reason for hiding this comment

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

This will be changed to 7.16.0 when backported

Copy link
Member

Choose a reason for hiding this comment

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

Should we create a ticket so we don't forget to do so?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will immediately do it after merging 😊

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done on the PR itself: d45518a

})
: i18n.translate('xpack.idxMgmt.mappingsEditor.editFieldTitle', {
defaultMessage: "Edit field '{fieldName}'",
export const EditField = React.memo(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To review this file make sure to toggle "Hide whitespace changes" in Github.

@sebelga sebelga requested a review from sabarasaba September 27, 2021 17:05
@cjcenizal cjcenizal added Feature:Index Management Index and index templates UI Feature:Mappings Editor Index mappings editor UI labels Sep 28, 2021
@sebelga
Copy link
Contributor Author

sebelga commented Sep 29, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
indexManagement 508 546 +38

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
indexManagement 163 164 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
indexManagement 534.3KB 527.9KB -6.4KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
esUiShared 125.7KB 125.7KB +13.0B
indexManagement 29.3KB 50.3KB +21.0KB
total +21.0KB
Unknown metric groups

API count

id before after diff
indexManagement 168 169 +1

History

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

Copy link
Member

@sabarasaba sabarasaba 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 @sebelga! Code LGTM, tested locally. Left a few minor comments only 🥳

setValue(newValue);
return newValue;

if (isMounted.current) {
Copy link
Member

Choose a reason for hiding this comment

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

Should we add any tests for this?

if (resetValue) {
hasBeenReset.current = true;
const newValue = deserializeValue(updatedDefaultValue ?? defaultValue);
// updateStateIfMounted('value', newValue);
Copy link
Member

Choose a reason for hiding this comment

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

can we remove this comment?

plugins: SetupDependencies
): IndexManagementPluginSetup {
const { fleet, usageCollection, management } = plugins;
const kibanaVersion = new SemVer(this.ctx.env.packageInfo.version);
Copy link
Member

Choose a reason for hiding this comment

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

Could we document this process in the readme of the app?

// "PluginInitializerContext.env.packageInfo.version". In some cases it is not possible
// to dynamically inject that version without a huge refactor on the code base.
// We will then keep this single constant to declare on which major branch we are.
export const MAJOR_VERSION = '8.0.0';
Copy link
Member

Choose a reason for hiding this comment

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

Should we create a ticket so we don't forget to do so?

@sebelga
Copy link
Contributor Author

sebelga commented Sep 30, 2021

Thanks for the review @sabarasaba ! I will merge this and remove the unnecessary comment on my current branch. 👍

@sebelga sebelga merged commit 50134cb into elastic:master Sep 30, 2021
@sebelga sebelga deleted the index-management/remove-boost-index-template branch September 30, 2021 09:18
sebelga added a commit to sebelga/kibana that referenced this pull request Sep 30, 2021
…3142)

# Conflicts:
#	x-pack/plugins/index_management/__jest__/client_integration/helpers/constants.ts
#	x-pack/plugins/index_management/public/application/lib/indices.ts
#	x-pack/plugins/index_management/public/application/store/selectors/indices_filter.test.ts
sebelga added a commit that referenced this pull request Sep 30, 2021
) (#113512)

* [Mappings editor] Remove boost parameter from field types (#113142)

# Conflicts:
#	x-pack/plugins/index_management/__jest__/client_integration/helpers/constants.ts
#	x-pack/plugins/index_management/public/application/lib/indices.ts
#	x-pack/plugins/index_management/public/application/store/selectors/indices_filter.test.ts

* Change MAJOR_VERSION to 7.16.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Index Management Index and index templates UI Feature:Mappings Editor Index mappings editor UI 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.16.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Mappings editor] Remove boost parameter from field types

5 participants