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

Move modules to indexing app #1758

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from

Conversation

lukavdplas
Copy link
Contributor

This redistributes some of the modules related to indexing and elasticsearch.

The main reason was that we now have an indexing app, so it makes sense that functions that are solely concerned with index management (e.g. creating or populating an index) are moved there, while the es app is kept for more fundamental elasticsearch business. In that vein, the module to construct an Elasticsearch instance is moved to the es module.

While moving the modules, I also split up some files that had grown beyond a practical size.

List of changes:

  • Move indexing functions and commands, with unit tests, to indexing app
  • Split es_index and es_alias modules into smaller modules:
    • es_index is split up into three modules: running a CreateIndexTask, running a PopulateIndexTask, and running an IndexJob (i.e. running all tasks).
    • For es_alias, functions related to versioning are extracted to a separate module.
  • Add one extra unit test 💪
  • Move ES client constructor to es app
  • For versioning-related functions, added typing and clarified the function names and docstrings.

Note for review: I did not change any code here, apart from updating imports and extracting some functions into separate modules. Since this code is all quite extensively unit-tested and git diffs for this kind of thing are usually a mess, I would recommend against trying to verify all the code changes. Just check if the list of changes makes sense.

@lukavdplas lukavdplas added code quality code & performance improvements that do not affect user functionality backend changes to the django backend labels Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend changes to the django backend code quality code & performance improvements that do not affect user functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant