Move the HostController::joinFix() method to DependencyNode#1244
Merged
Conversation
nilmerg
requested changes
Jul 8, 2025
Member
nilmerg
left a comment
There was a problem hiding this comment.
Is it possible to use the new method in ObjectDetail as well? Then please do so.
4b82a37 to
65ac062
Compare
Contributor
Author
The |
There was a problem hiding this comment.
Pull Request Overview
This PR moves the host-specific join workaround from HostController into a new DependencyNode::forHost() static method and cleans up the controller accordingly.
- Adds
forHost()toDependencyNodeto encapsulate the host‐filter logic - Updates
HostController::fetchDependencyNodes()to useforHost()and removesjoinFix() - Removes unused imports and the old
joinFix()method fromHostController
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| library/Icingadb/Model/DependencyNode.php | Added forHost() method with EXISTS filter to handle bug in ipl-orm |
| application/controllers/HostController.php | Updated fetchDependencyNodes() to call forHost() and removed joinFix() plus unused imports |
Comments suppressed due to low confidence (3)
library/Icingadb/Model/DependencyNode.php:137
- Add an
@return Queryannotation to the docblock offorHost()to clarify the method’s return type.
/**
library/Icingadb/Model/DependencyNode.php:149
- Consider adding unit tests for
forHost()to verify correct filtering of parents vs. children and to prevent regressions once the underlying ipl-orm issue is fixed.
public static function forHost(string $hostId, Connection $db, bool $fetchParents = false): Query
library/Icingadb/Model/DependencyNode.php:149
- [nitpick] The method name
forHostis a bit vague; consider renaming to something likefilterByHostorqueryForHostto better convey that this returns a query scoped to a host.
public static function forHost(string $hostId, Connection $db, bool $fetchParents = false): Query
nilmerg
requested changes
Jul 10, 2025
HostController::joinFix() method to DependecyNodeHostController::joinFix() method to DependencyNode
- Centerlize the method
65ac062 to
cde4282
Compare
nilmerg
approved these changes
Jul 10, 2025
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.
No description provided.