Skip to content

Move the HostController::joinFix() method to DependencyNode#1244

Merged
nilmerg merged 1 commit into
mainfrom
fix/centerlize-join-fix
Jul 10, 2025
Merged

Move the HostController::joinFix() method to DependencyNode#1244
nilmerg merged 1 commit into
mainfrom
fix/centerlize-join-fix

Conversation

@sukhwinder33445
Copy link
Copy Markdown
Contributor

No description provided.

@sukhwinder33445 sukhwinder33445 requested a review from nilmerg July 8, 2025 13:06
@sukhwinder33445 sukhwinder33445 self-assigned this Jul 8, 2025
@cla-bot cla-bot Bot added the cla/signed CLA is signed by all contributors of a PR label Jul 8, 2025
Copy link
Copy Markdown
Member

@nilmerg nilmerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use the new method in ObjectDetail as well? Then please do so.

Comment thread library/Icingadb/Model/DependencyNode.php Outdated
@sukhwinder33445 sukhwinder33445 force-pushed the fix/centerlize-join-fix branch from 4b82a37 to 65ac062 Compare July 9, 2025 07:46
@sukhwinder33445
Copy link
Copy Markdown
Contributor Author

Is it possible to use the new method in ObjectDetail as well? Then please do so.

The ObjectDetail::createAffectedObjects() only fetch failed edges.

@sukhwinder33445 sukhwinder33445 requested a review from nilmerg July 9, 2025 08:20
@nilmerg nilmerg requested a review from Copilot July 10, 2025 06:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() to DependencyNode to encapsulate the host‐filter logic
  • Updates HostController::fetchDependencyNodes() to use forHost() and removes joinFix()
  • Removes unused imports and the old joinFix() method from HostController

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 Query annotation to the docblock of forHost() 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 forHost is a bit vague; consider renaming to something like filterByHost or queryForHost to better convey that this returns a query scoped to a host.
    public static function forHost(string $hostId, Connection $db, bool $fetchParents = false): Query

Comment thread library/Icingadb/Model/DependencyNode.php
@nilmerg nilmerg changed the title Move the HostController::joinFix() method to DependecyNode Move the HostController::joinFix() method to DependencyNode Jul 10, 2025
@nilmerg nilmerg added this to the 1.2.2 milestone Jul 10, 2025
@nilmerg nilmerg added the area/framework Affects third party integrations label Jul 10, 2025
@sukhwinder33445 sukhwinder33445 force-pushed the fix/centerlize-join-fix branch from 65ac062 to cde4282 Compare July 10, 2025 07:12
@nilmerg nilmerg merged commit eed9a3b into main Jul 10, 2025
10 checks passed
@nilmerg nilmerg deleted the fix/centerlize-join-fix branch July 10, 2025 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/framework Affects third party integrations cla/signed CLA is signed by all contributors of a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants