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] Test LogsDb Index Template Modifications #206548

Merged
merged 7 commits into from
Jan 17, 2025

Conversation

SoniaSanzV
Copy link
Contributor

@SoniaSanzV SoniaSanzV commented Jan 14, 2025

Part of #203716

Summary

This PR introduces a new test case for LogsDB in both Stateful and Serverless:

Verify that users can override LogsDB index settings including: ignore_above, ignore_malformed, ignore_dynamic_beyond_limit, subobjects and timestamp format.

For modify subobjects and timestamp format it must be done from the mappings tab. For ignore_above, ignore_malformed, ignore_dynamic_beyond_limit the configuration is done in the Settings tab.

It also introduces a test case only for Stateful (enableMappingsSourceFieldSection is disabled for serverless)

Verify that users cannot disable synthetic source for a LogsDB index.

@SoniaSanzV SoniaSanzV 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 backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Jan 14, 2025
@SoniaSanzV SoniaSanzV self-assigned this Jan 14, 2025
@SoniaSanzV SoniaSanzV requested a review from a team as a code owner January 14, 2025 08:30
@elasticmachine
Copy link
Contributor

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

@SoniaSanzV SoniaSanzV mentioned this pull request Jan 14, 2025
11 tasks
Copy link
Contributor

@ElenaStoeva ElenaStoeva 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 @SoniaSanzV! Overall, it looks good, but I have a few comments/questions. Let me know what you think.

@@ -79,5 +79,96 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
// Close detail tab
await testSubjects.click('closeDetailsButton');
});

it('can modify ignore_above, ignore_malformed, ignore_dynamic_beyond_limit, subobjects and timestamp format in an index template with logsdb index mode', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This test verifies that we can create an index template with the mentioned index/mappings settings, but doesn't the test flow require overriding them? I'm wondering if we should also verify that we can edit these settings after the initial creation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right! I can create the index template from ES and then modify it in this test.

@@ -128,6 +128,94 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
expect(await testSubjects.getVisibleText('indexModeValue')).to.be('LogsDB');
await testSubjects.click('closeDetailsButton');
});

it('can modify ignore_above, ignore_malformed, ignore_dynamic_beyond_limit, subobjects and timestamp format in an index template with logsdb index mode', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

For serverless FTRs, we usually add tests for the main functionalities unless some logic is different from stateful - otherwise, there is a lot of code duplication and too heavy tests. Since the related index templates logic is same for both stateful and serverless, I wonder whether it's necessary to add this test here as well. 🤔 Wdyt?

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 added both because it was specified in the Issue description, but I see your point. I don't have a strong opinion.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see...let's leave it then to make sure it works correctly in serverless too.

Copy link
Contributor

@ElenaStoeva ElenaStoeva 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 addressing my feedback @SoniaSanzV! I added a few more comments. Also, could you run the flaky test runner to check for flakiness?

data_stream: {},
template: {
settings: {
mode: 'logsdb',
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the setting should be index.mode instead of just mode. See https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html

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 seems that both are accepted. I'll keep yours since is more verbose.

await testSubjects.setValue(
'kibanaCodeEditor',
JSON.stringify({
index: {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this overwrites the index.mode setting to standard since we don't specify it explicitly and it might be reset to the default value 🤔

'_source can not be disabled in index using [logsdb] index mode'
);

// Comeback to templates tab
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this step?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After all the test we delete the index template and and click reloadButton to avoid refreshing the page. I'll add it in the afterEach section.

// Fill out required fields
await testSubjects.setValue('nameField', INDEX_TEMPLATE_NAME);
await testSubjects.setValue('indexPatternsField', 'logsdb-test-index-pattern');
describe('index modification', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

did you mean "index template modification"?

});

// Close detail tab
await testSubjects.click('closeDetailsButton');
Copy link
Contributor

Choose a reason for hiding this comment

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

This step could be added in a before() if it's needed for the next test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in the afterEach section.

@SoniaSanzV SoniaSanzV changed the title [Index Management] Create FTs for verify that user can change certain paramethers for a … [Index Management] Test LogsDb Index Template Modifications Jan 16, 2025
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
indexManagement 713.2KB 713.2KB +80.0B

History

cc @SoniaSanzV

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#7734

[✅] x-pack/test/functional/apps/index_management/config.ts: 200/200 tests passed.

see run history

@SoniaSanzV
Copy link
Contributor Author

Thanks for addressing my feedback @SoniaSanzV! I added a few more comments. Also, could you run the flaky test runner to check for flakiness?

Ran and passed!

Copy link
Contributor

@ElenaStoeva ElenaStoeva 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 addressing my comments @SoniaSanzV! Latest changes lgtm 👍

@SoniaSanzV SoniaSanzV merged commit 75e1866 into elastic:main Jan 17, 2025
8 checks passed
@SoniaSanzV SoniaSanzV deleted the logsdb_index_templates_fts branch January 17, 2025 06:15
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 17, 2025
…206548)

Part of elastic#203716

## Summary
This PR introduces a new test case for LogsDB in both Stateful and
Serverless:

> Verify that users can override LogsDB index settings including:
ignore_above, ignore_malformed, ignore_dynamic_beyond_limit, subobjects
and timestamp format.

For modify `subobjects` and `timestamp` format it must be done from the
mappings tab. For `ignore_above`, `ignore_malformed`,
`ignore_dynamic_beyond_limit` the configuration is done in the Settings
tab.

It also introduces a test case only for Stateful
(enableMappingsSourceFieldSection [is
disabled](https://github.com/elastic/kibana/blob/9c6de6aabced9d180bf1d68ec42708c27e5616d6/config/serverless.yml#L112)
for serverless)

> Verify that users cannot disable synthetic source for a LogsDB index.

(cherry picked from commit 75e1866)
@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 Jan 17, 2025
…06548) (#207019)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Index Management] Test LogsDb Index Template Modifications
(#206548)](#206548)

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

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

<!--BACKPORT [{"author":{"name":"Sonia Sanz
Vivas","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-17T06:15:23Z","message":"[Index
Management] Test LogsDb Index Template Modifications (#206548)\n\nPart
of https://github.com/elastic/kibana/issues/203716\n\n## Summary\nThis
PR introduces a new test case for LogsDB in both Stateful
and\nServerless:\n\n> Verify that users can override LogsDB index
settings including:\nignore_above, ignore_malformed,
ignore_dynamic_beyond_limit, subobjects\nand timestamp format.\n\nFor
modify `subobjects` and `timestamp` format it must be done from
the\nmappings tab. For `ignore_above`,
`ignore_malformed`,\n`ignore_dynamic_beyond_limit` the configuration is
done in the Settings\ntab.\n\nIt also introduces a test case only for
Stateful\n(enableMappingsSourceFieldSection
[is\ndisabled](https://github.com/elastic/kibana/blob/9c6de6aabced9d180bf1d68ec42708c27e5616d6/config/serverless.yml#L112)\nfor
serverless)\n\n> Verify that users cannot disable synthetic source for a
LogsDB
index.","sha":"75e186691509e613d2a0735a15d9aa60fa9c13a8","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.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"],"title":"[Index
Management] Test LogsDb Index Template
Modifications","number":206548,"url":"https://github.com/elastic/kibana/pull/206548","mergeCommit":{"message":"[Index
Management] Test LogsDb Index Template Modifications (#206548)\n\nPart
of https://github.com/elastic/kibana/issues/203716\n\n## Summary\nThis
PR introduces a new test case for LogsDB in both Stateful
and\nServerless:\n\n> Verify that users can override LogsDB index
settings including:\nignore_above, ignore_malformed,
ignore_dynamic_beyond_limit, subobjects\nand timestamp format.\n\nFor
modify `subobjects` and `timestamp` format it must be done from
the\nmappings tab. For `ignore_above`,
`ignore_malformed`,\n`ignore_dynamic_beyond_limit` the configuration is
done in the Settings\ntab.\n\nIt also introduces a test case only for
Stateful\n(enableMappingsSourceFieldSection
[is\ndisabled](https://github.com/elastic/kibana/blob/9c6de6aabced9d180bf1d68ec42708c27e5616d6/config/serverless.yml#L112)\nfor
serverless)\n\n> Verify that users cannot disable synthetic source for a
LogsDB
index.","sha":"75e186691509e613d2a0735a15d9aa60fa9c13a8"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/206548","number":206548,"mergeCommit":{"message":"[Index
Management] Test LogsDb Index Template Modifications (#206548)\n\nPart
of https://github.com/elastic/kibana/issues/203716\n\n## Summary\nThis
PR introduces a new test case for LogsDB in both Stateful
and\nServerless:\n\n> Verify that users can override LogsDB index
settings including:\nignore_above, ignore_malformed,
ignore_dynamic_beyond_limit, subobjects\nand timestamp format.\n\nFor
modify `subobjects` and `timestamp` format it must be done from
the\nmappings tab. For `ignore_above`,
`ignore_malformed`,\n`ignore_dynamic_beyond_limit` the configuration is
done in the Settings\ntab.\n\nIt also introduces a test case only for
Stateful\n(enableMappingsSourceFieldSection
[is\ndisabled](https://github.com/elastic/kibana/blob/9c6de6aabced9d180bf1d68ec42708c27e5616d6/config/serverless.yml#L112)\nfor
serverless)\n\n> Verify that users cannot disable synthetic source for a
LogsDB index.","sha":"75e186691509e613d2a0735a15d9aa60fa9c13a8"}}]}]
BACKPORT-->

Co-authored-by: Sonia Sanz Vivas <[email protected]>
cqliu1 pushed a commit to cqliu1/kibana that referenced this pull request Jan 17, 2025
…206548)

Part of elastic#203716

## Summary
This PR introduces a new test case for LogsDB in both Stateful and
Serverless:

> Verify that users can override LogsDB index settings including:
ignore_above, ignore_malformed, ignore_dynamic_beyond_limit, subobjects
and timestamp format.

For modify `subobjects` and `timestamp` format it must be done from the
mappings tab. For `ignore_above`, `ignore_malformed`,
`ignore_dynamic_beyond_limit` the configuration is done in the Settings
tab.

It also introduces a test case only for Stateful
(enableMappingsSourceFieldSection [is
disabled](https://github.com/elastic/kibana/blob/9c6de6aabced9d180bf1d68ec42708c27e5616d6/config/serverless.yml#L112)
for serverless)

> Verify that users cannot disable synthetic source for a LogsDB index.
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.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants