Skip to content
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

[Index Management] Add index mode field in index template form #199521

Merged
merged 15 commits into from
Nov 14, 2024

Conversation

ElenaStoeva
Copy link
Contributor

@ElenaStoeva ElenaStoeva commented Nov 8, 2024

Closes #198620

Summary

This PR adds a field for index mode setting in the Logistics step in Index Template form.

Screen.Recording.2024-11-13.at.13.32.52.mov

How to test:

  1. Go to Index Management -> Index Templates and start creating an index template
  2. Verify that the index mode is only enabled if the data stream toggle is on.
  3. Verify that typing the logs-*-* index pattern sets the index mode to "LogsDB":
Screenshot 2024-11-13 at 13 00 10
  1. Go to the Settings step and verify that the index mode callout is displayed correctly.
  2. Go to Review step and verify that Index mode is displayed correctly in both the summary and the preview request.
  3. Save the template and verify that the template details tab correctly displays the index mode.
Screenshot 2024-11-13 at 17 22 54 Screenshot 2024-11-13 at 17 22 31

Checklist

Delete any items that are not applicable to this PR.

@ElenaStoeva ElenaStoeva force-pushed the index-template/index-mode-field branch from 207ee92 to c73ae20 Compare November 11, 2024 13:16
@ElenaStoeva ElenaStoeva self-assigned this Nov 12, 2024
@ElenaStoeva ElenaStoeva added Feature:Index Management Index and index templates UI Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more release_note:skip Skip the PR/issue when compiling release notes v9.0.0 backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) v8.17.0 labels Nov 12, 2024
@ElenaStoeva ElenaStoeva marked this pull request as ready for review November 13, 2024 13:38
@ElenaStoeva ElenaStoeva requested a review from a team as a code owner November 13, 2024 13:38
@elasticmachine
Copy link
Contributor

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

@ElenaStoeva ElenaStoeva force-pushed the index-template/index-mode-field branch from adc10b9 to 364b5b0 Compare November 13, 2024 17:07
Copy link
Contributor

@mattkime mattkime left a comment

Choose a reason for hiding this comment

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

Overall the code looks good and works well but I have a few questions. I'm not sure anything will change but I figure its at least worth a conversation.

I'm a bit confused by what the 'Create Data Stream' toggle does. I see that it corresponds to the ES api which leaves me similarly confused. I thought it might create a data stream but it doesn't seem to have done that. Or perhaps I did something wrong or I'm otherwise confused.

Is the callout about index.mode being set really needed? I could see displaying it if the user attempted to set the value but most of the time we're probably telling people not to do something they have no intention of doing. IMO it would be better to display it only if someone was trying to set it.

I noticed that the index settings mode will show the index.mode setting when an index template is edited but not on initial creation. Ideally the content would be the same.

@ElenaStoeva
Copy link
Contributor Author

I'm a bit confused by what the 'Create Data Stream' toggle does. I see that it corresponds to the ES api which leaves me similarly confused. I thought it might create a data stream but it doesn't seem to have done that. Or perhaps I did something wrong or I'm otherwise confused.

My understanding of the docs is that if the data_stream object is included, this template can be used for creating data streams that match the index pattern of this index template.

Is the callout about index.mode being set really needed? I could see displaying it if the user attempted to set the value but most of the time we're probably telling people not to do something they have no intention of doing. IMO it would be better to display it only if someone was trying to set it.

That was a bit of a last-minute decision with the idea that we might update this depending on usage evaluations. cc: @bitzandeb

I noticed that the index settings mode will show the index.mode setting when an index template is edited but not on initial creation. Ideally the content would be the same.

Do you mean that the editor doesn't have the index mode setting prepopulated with the selected index mode field? If so, this is a bit too complex, given that there are different formats of inputting the settings (i.e. "index.mode" or "index": {"mode"...}) and we would need to parse and modify any existing input that the user has added. For the sake of merging the changes on time, we decided to only display the warning callout as we don't know how these interactions are going to play out.

@ElenaStoeva ElenaStoeva requested a review from a team as a code owner November 14, 2024 15:12
Copy link
Member

@dmlemeshko dmlemeshko left a comment

Choose a reason for hiding this comment

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

x-pack/test_serverless/api_integration/services/index_management/svl_templates.helpers.ts changes LGTM

@ElenaStoeva ElenaStoeva enabled auto-merge (squash) November 14, 2024 17:37
@ElenaStoeva ElenaStoeva merged commit 16127fc into elastic:main Nov 14, 2024
20 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11843726542

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
indexManagement 695 696 +1

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 236 238 +2

Async chunks

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

id before after diff
indexManagement 690.0KB 693.1KB +3.1KB

Page load bundle

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

id before after diff
indexManagement 46.1KB 46.3KB +287.0B
Unknown metric groups

API count

id before after diff
indexManagement 241 243 +2

History

cc @ElenaStoeva

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 14, 2024
…ic#199521)

Closes elastic#198620

## Summary

This PR adds a field for index mode setting in the Logistics step in
Index Template form.

https://github.com/user-attachments/assets/ee38bdec-66ff-468d-a55e-abf5354c3da2

**How to test:**
1. Go to Index Management -> Index Templates and start creating an index
template
2. Verify that the index mode is only enabled if the data stream toggle
is on.
3. Verify that typing the `logs-*-*` index pattern sets the index mode
to "LogsDB":

<img width="1401" alt="Screenshot 2024-11-13 at 13 00 10"
src="https://github.com/user-attachments/assets/d1825d08-5039-4c43-80a8-653233e0b677">

4. Go to the Settings step and verify that the index mode callout is
displayed correctly.
5. Go to Review step and verify that Index mode is displayed correctly
in both the summary and the preview request.
6. Save the template and verify that the template details tab correctly
displays the index mode.

<img width="1565" alt="Screenshot 2024-11-13 at 17 22 54"
src="https://github.com/user-attachments/assets/2055501b-32c9-463c-b61d-541b9687b459">

<img width="1565" alt="Screenshot 2024-11-13 at 17 22 31"
src="https://github.com/user-attachments/assets/21c9cf9e-5858-4403-9106-57ed8ccf3639">

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

(cherry picked from commit 16127fc)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 14, 2024
…199521) (#200244)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Index Management] Add index mode field in index template form
(#199521)](#199521)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Elena
Stoeva","email":"59341489+ElenaStoeva@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-11-14T18:58:42Z","message":"[Index
Management] Add index mode field in index template form
(#199521)\n\nCloses
https://github.com/elastic/kibana/issues/198620\r\n\r\n##
Summary\r\n\r\nThis PR adds a field for index mode setting in the
Logistics step in\r\nIndex Template
form.\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/ee38bdec-66ff-468d-a55e-abf5354c3da2\r\n\r\n\r\n**How
to test:**\r\n1. Go to Index Management -> Index Templates and start
creating an index\r\ntemplate\r\n2. Verify that the index mode is only
enabled if the data stream toggle\r\nis on.\r\n3. Verify that typing the
`logs-*-*` index pattern sets the index mode\r\nto
\"LogsDB\":\r\n\r\n<img width=\"1401\" alt=\"Screenshot 2024-11-13 at 13
00
10\"\r\nsrc=\"https://github.com/user-attachments/assets/d1825d08-5039-4c43-80a8-653233e0b677\">\r\n\r\n\r\n\r\n4.
Go to the Settings step and verify that the index mode callout
is\r\ndisplayed correctly.\r\n5. Go to Review step and verify that Index
mode is displayed correctly\r\nin both the summary and the preview
request.\r\n6. Save the template and verify that the template details
tab correctly\r\ndisplays the index mode.\r\n\r\n<img width=\"1565\"
alt=\"Screenshot 2024-11-13 at 17 22
54\"\r\nsrc=\"https://github.com/user-attachments/assets/2055501b-32c9-463c-b61d-541b9687b459\">\r\n\r\n<img
width=\"1565\" alt=\"Screenshot 2024-11-13 at 17 22
31\"\r\nsrc=\"https://github.com/user-attachments/assets/21c9cf9e-5858-4403-9106-57ed8ccf3639\">\r\n\r\n\r\n\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] Any UI
touched in this PR is usable by keyboard only (learn more\r\nabout
[keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n-
[x] Any UI touched in this PR does not create any new axe
failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[x] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[x] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)","sha":"16127fcc8faf128cfd9d2feffc6086eb6330c11f","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Index
Management","Team:Kibana
Management","release_note:skip","v9.0.0","backport:prev-minor","v8.17.0"],"title":"[Index
Management] Add index mode field in index template
form","number":199521,"url":"https://github.com/elastic/kibana/pull/199521","mergeCommit":{"message":"[Index
Management] Add index mode field in index template form
(#199521)\n\nCloses
https://github.com/elastic/kibana/issues/198620\r\n\r\n##
Summary\r\n\r\nThis PR adds a field for index mode setting in the
Logistics step in\r\nIndex Template
form.\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/ee38bdec-66ff-468d-a55e-abf5354c3da2\r\n\r\n\r\n**How
to test:**\r\n1. Go to Index Management -> Index Templates and start
creating an index\r\ntemplate\r\n2. Verify that the index mode is only
enabled if the data stream toggle\r\nis on.\r\n3. Verify that typing the
`logs-*-*` index pattern sets the index mode\r\nto
\"LogsDB\":\r\n\r\n<img width=\"1401\" alt=\"Screenshot 2024-11-13 at 13
00
10\"\r\nsrc=\"https://github.com/user-attachments/assets/d1825d08-5039-4c43-80a8-653233e0b677\">\r\n\r\n\r\n\r\n4.
Go to the Settings step and verify that the index mode callout
is\r\ndisplayed correctly.\r\n5. Go to Review step and verify that Index
mode is displayed correctly\r\nin both the summary and the preview
request.\r\n6. Save the template and verify that the template details
tab correctly\r\ndisplays the index mode.\r\n\r\n<img width=\"1565\"
alt=\"Screenshot 2024-11-13 at 17 22
54\"\r\nsrc=\"https://github.com/user-attachments/assets/2055501b-32c9-463c-b61d-541b9687b459\">\r\n\r\n<img
width=\"1565\" alt=\"Screenshot 2024-11-13 at 17 22
31\"\r\nsrc=\"https://github.com/user-attachments/assets/21c9cf9e-5858-4403-9106-57ed8ccf3639\">\r\n\r\n\r\n\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] Any UI
touched in this PR is usable by keyboard only (learn more\r\nabout
[keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n-
[x] Any UI touched in this PR does not create any new axe
failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[x] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[x] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)","sha":"16127fcc8faf128cfd9d2feffc6086eb6330c11f"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199521","number":199521,"mergeCommit":{"message":"[Index
Management] Add index mode field in index template form
(#199521)\n\nCloses
https://github.com/elastic/kibana/issues/198620\r\n\r\n##
Summary\r\n\r\nThis PR adds a field for index mode setting in the
Logistics step in\r\nIndex Template
form.\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/ee38bdec-66ff-468d-a55e-abf5354c3da2\r\n\r\n\r\n**How
to test:**\r\n1. Go to Index Management -> Index Templates and start
creating an index\r\ntemplate\r\n2. Verify that the index mode is only
enabled if the data stream toggle\r\nis on.\r\n3. Verify that typing the
`logs-*-*` index pattern sets the index mode\r\nto
\"LogsDB\":\r\n\r\n<img width=\"1401\" alt=\"Screenshot 2024-11-13 at 13
00
10\"\r\nsrc=\"https://github.com/user-attachments/assets/d1825d08-5039-4c43-80a8-653233e0b677\">\r\n\r\n\r\n\r\n4.
Go to the Settings step and verify that the index mode callout
is\r\ndisplayed correctly.\r\n5. Go to Review step and verify that Index
mode is displayed correctly\r\nin both the summary and the preview
request.\r\n6. Save the template and verify that the template details
tab correctly\r\ndisplays the index mode.\r\n\r\n<img width=\"1565\"
alt=\"Screenshot 2024-11-13 at 17 22
54\"\r\nsrc=\"https://github.com/user-attachments/assets/2055501b-32c9-463c-b61d-541b9687b459\">\r\n\r\n<img
width=\"1565\" alt=\"Screenshot 2024-11-13 at 17 22
31\"\r\nsrc=\"https://github.com/user-attachments/assets/21c9cf9e-5858-4403-9106-57ed8ccf3639\">\r\n\r\n\r\n\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] Any UI
touched in this PR is usable by keyboard only (learn more\r\nabout
[keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n-
[x] Any UI touched in this PR does not create any new axe
failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[x] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[x] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)","sha":"16127fcc8faf128cfd9d2feffc6086eb6330c11f"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Elena Stoeva <59341489+ElenaStoeva@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:Index Management Index and index templates 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 v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Index Management] Support for index.mode in index template creation
5 participants