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

[ILM] Refactor edit policy helpers #98031

Closed
yuliacech opened this issue Apr 22, 2021 · 3 comments
Closed

[ILM] Refactor edit policy helpers #98031

yuliacech opened this issue Apr 22, 2021 · 3 comments
Assignees
Labels
Feature:ILM Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more technical debt Improvement of the software architecture and operational architecture

Comments

@yuliacech
Copy link
Contributor

The file x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.helpers.tsx currently consist of more than 400 lines. The amount of helper functions is very large which makes for poor maintenance:

  • problem of forgetting to delete helpers when the form changes/tests are being deleted
  • risk of adding similar helpers
  • low discoverability of helpers functions
  • tests don't need to create all available helpers on setup

On the other hand, it's straightforward to use one single function to setup an edit policy test bed for client integration tests.

After a discussion with @jloleysens, these are suggestions to refactor the file:

  • extract helper functions into separate files that would contain logical groups of functions, for example node allocation helpers, timeline helpers etc
  • change setup function to be a factory function accepting an array of helpers initializing functions. That way setup function doesn't know about concrete form actions, only test files know which form actions they need to initialize.
@yuliacech yuliacech added technical debt Improvement of the software architecture and operational architecture Feature:ILM Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more labels Apr 22, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

@yuliacech yuliacech self-assigned this Apr 22, 2021
@cjcenizal
Copy link
Contributor

See #96111 (comment) for some additional context and a reference to some changes I made in support of this issue.

@yuliacech
Copy link
Contributor Author

This was addressed in #102383.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:ILM Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more technical debt Improvement of the software architecture and operational architecture
Projects
None yet
Development

No branches or pull requests

3 participants