MON-199535 Factorize Tools Implementation#231
Merged
Conversation
denrou
approved these changes
Jun 2, 2026
denrou
reviewed
Jun 2, 2026
denrou
left a comment
Contributor
There was a problem hiding this comment.
🔍 Automated Review — Action Required
Reviewed with the Centreon automated review skill. Complexity: medium–high — Recommended reviewers: 2. All 84 tests pass and CI is green; the refactor itself is clean and consistent. See inline comments for details.
🔴 Critical
- Default sort order dropped for all list endpoints —
components/base.py. The new_listsendssort_by=Nonewhen noorderis passed, where the old helper always applied each model's default sort field. This silently changes default result ordering (and pagination) for all 11 list tools. See inline comment.
🟠 Important
- No test coverage for the new generic helpers — the component tests mock
_list/_create/_delete/_patch, socomponents/base.pyis never executed (regression for_delete's aggregation logic). See inline comment. - Dead code: the old generic
_listinutils/base.py(~L37) is now unused after this refactor and can be removed.
🟡 Suggestion
- Stale test comment in
test_component_host.py. See inline comment.
🤖 Generated with Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Ticket Jira: MON-199535
What ?
Factorize tool implementations.
Why ?
Some components related to models inheriting from the same mixins have a common implementation of tools such as
create,list, anddelete. Defining generic CRUD tools will simplify the code by removing redundancy.How ?
_create,_list,_delete,_patchmethods in a newcomponents.base.py.