Skip to content

Handle rule filter serialization#469

Open
BastianLedererIcinga wants to merge 21 commits into
mainfrom
rule-filter-handling
Open

Handle rule filter serialization#469
BastianLedererIcinga wants to merge 21 commits into
mainfrom
rule-filter-handling

Conversation

@BastianLedererIcinga
Copy link
Copy Markdown
Contributor

@BastianLedererIcinga BastianLedererIcinga commented Apr 28, 2026

resolve #466

Introduce RuleSerializer to create Json from a configured filter.

Introduce Icinga\Module\Notifications\Hook\V2 which no longer requires serializeRuleFilter() and getRuleFilterTargets() as they are now obsolete.

Adjust EventRuleController to skip target selection use the new RuleSerializer.

require Icinga/ipl-web#380

@cla-bot cla-bot Bot added the cla/signed CLA is signed by all contributors of a PR label Apr 28, 2026
@BastianLedererIcinga BastianLedererIcinga force-pushed the rule-filter-handling branch 2 times, most recently from e3da66a to b8a38fc Compare April 28, 2026 08:02
@BastianLedererIcinga BastianLedererIcinga force-pushed the rule-filter-handling branch 8 times, most recently from d5fe2f5 to 3bf7acb Compare May 7, 2026 08:23
@nilmerg nilmerg self-requested a review May 11, 2026 13:36
Comment thread library/Notifications/Util/RuleSerializer.php Outdated
Introduce a new version of the `SourceHook` interface for v 1.0
`RuleFilterSuggestions` use the relevant functions of the `V2\SourceHook`
to provide suggestions when editing event-rule filters
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.

Didn't look at the controller or suggestions yet.

Comment thread library/Notifications/Hook/V2/SourceHook.php Outdated
Comment thread library/Notifications/Hook/V2/SourceHook.php Outdated
Comment thread library/Notifications/Model/Source.php Outdated
Comment thread library/Notifications/Util/RuleSerializer.php Outdated
Comment thread library/Notifications/Util/RuleSerializer.php
Comment thread library/Notifications/Util/RuleSerializer.php Outdated
Comment thread library/Notifications/Common/SourceHookLocator.php Outdated
Comment thread application/controllers/EventRuleController.php Outdated
Comment thread application/forms/SourceForm.php Outdated
Comment thread library/Notifications/Hook/V2/SourceHook.php Outdated
Comment thread library/Notifications/Hook/V2/SourceHook.php Outdated
Comment thread library/Notifications/Hook/V2/SourceHook.php Outdated
Comment thread library/Notifications/Util/RuleSerializer.php Outdated
Comment thread library/Notifications/Web/Control/SearchEditor/RuleFilterSuggestions.php Outdated
Comment thread library/Notifications/Util/RuleSerializer.php
Comment thread application/controllers/EventRuleController.php Outdated
Comment thread application/controllers/EventRuleController.php Outdated
Comment thread application/controllers/EventRuleController.php Outdated
Comment thread library/Notifications/Util/RuleSerializer.php Outdated
Comment thread library/Notifications/Util/RuleSerializer.php Outdated
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.

please add a unit test for the source hook locator and the rule serializer.

$this->redirectNow(Links::eventRule($ruleId)->setParam('_filterOnly'));
});

$editor->getParser()->on(QueryString::ON_CONDITION, $hook->enrichCondition(...));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this may also throw, please guard it as well

} else {
$column = $requestData['column'] ?? null;
if ($column === null || $column === SearchEditor::FAKE_COLUMN) {
$provider = new EmptyIterator();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla/signed CLA is signed by all contributors of a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle rule filter rendering and serialization on our own again

2 participants