Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Refactor controllers #1446
What does this PR do ?
Disclaimer: I know there is a lot of things that could be improved (eg: stop using assert in security controller) but this PR is big enough. I left a lot of
Kuzzle storage is now handled by the StorageEngine class.
Elasticsearch services are wrapped by the ClientAdapter class. This class maintain the indexCache and test for index/collection existence before calling ES service methods. Controllers and core components (eg: internalIndex) are no longer responsible for the IndexCache.
The IndexStorage class is a wrapper around an ES index. This class has roughly the same methods as the ES service but they are all scoped to an index. It is used for the internal index and also plugin indexes.
Helpers methods have been added to the BaseController class. These methods are used to extract param from the request object instead of asserting there presence and then get them.
SonarQube analysis reported 12 issues
Watch the comments in this conversation to review them.
3 extra issues
Note: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here: