[data.indexPatterns] Fix broken rollup index pattern creation #76593
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Creating rollup-based index patterns is currently broken: the
_fetch_fields_for_wildcard
route returns a 400 due to a missingrollup_index
param. Rollup index patterns are successfully created, but fields are unable to be retrieved, making them useless in most scenarios.Surprisingly, it was a result of this small PR: #76004
It turns out that the
typeMeta
-- which is the extension point used by rollups to customize index pattern behavior -- was accidentally serialized as the index patternmapping
instead of the actualtypeMeta
:kibana/src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts
Line 444 in e88470d
The missing
typeMeta
resulted in an improperly formatted saved index pattern object, which ultimately didn’t send the correct parameters when looking up fields on the rollup index as it couldn't read the meta it needed.If you're like me, you are probably wondering, "hey, why don't we have a functional test for this case?" The answer to that question is, we do. But unfortunately, it didn't have any assertions to ensure the newly-created rollup index pattern could actually be retrieved. As a result, the test runner had no idea the error was even happening.
This PR fixes the typo, and also updates the functional test to ensure that (A) No toasts appear after index pattern creation, which might indicate an error; and (B) The expected fields for the new index pattern are displayed in the UI.
Unblocks #75943