Skip to content

Fix the drop_indices helper for ES version portability - #1013

Merged
AlfonsoUceda merged 2 commits into
toptal:masterfrom
mattmenefee:fix-drop-indices-json-format
Mar 25, 2026
Merged

Fix the drop_indices helper for ES version portability#1013
AlfonsoUceda merged 2 commits into
toptal:masterfrom
mattmenefee:fix-drop-indices-json-format

Conversation

@mattmenefee

@mattmenefee mattmenefee commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Switch drop_indices test helper from parsing text-format cat.indices output to using format: 'json', which is stable across ES versions
  • Filter out system indices (prefixed with .) to avoid deleting ES-internal indices like .security or .kibana

Test plan

  • Existing specs pass with the updated drop_indices helper
  • Index cleanup works correctly between test runs

@mattmenefee
mattmenefee requested a review from a team as a code owner March 18, 2026 16:03
@mattmenefee
mattmenefee force-pushed the fix-drop-indices-json-format branch from c35d0c8 to cea243e Compare March 18, 2026 16:05
The previous implementation parsed the text-format `cat.indices`
response by splitting on whitespace and taking column index [2].
This is brittle — column order can change between ES versions.

Switch to `format: 'json'` and extract the `index` key from each
entry. Also filter out system indices (prefixed with '.') to avoid
deleting ES-internal indices like .security or .kibana.
@mattmenefee
mattmenefee force-pushed the fix-drop-indices-json-format branch from cea243e to df52b48 Compare March 18, 2026 16:05
@mattmenefee mattmenefee changed the title Fix drop_indices helper for ES version portability Fix the drop_indices helper for ES version portability Mar 18, 2026

@AlfonsoUceda AlfonsoUceda left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@mattmenefee Thank you!

@AlfonsoUceda
AlfonsoUceda merged commit ac0cba3 into toptal:master Mar 25, 2026
13 checks passed
@mattmenefee
mattmenefee deleted the fix-drop-indices-json-format branch March 25, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants