Skip to content

Fix alert rule tester misses after messages move into history - #426

Merged
bmfmancini merged 4 commits into
developfrom
fix_rule_tester_history
Oct 26, 2026
Merged

bmfmancini merged 4 commits into
developfrom
fix_rule_tester_history

Conversation

@bmfmancini

Copy link
Copy Markdown
Member

Description

An alert condition such as message begins with Disconnect can report no matches in the tester after a matching Disconnected ... message has moved from the incoming buffer to stored history.

When a condition-builder alert preview has no incoming matches, also test the newest 10,000 stored messages. Reuse the existing normalized filter compiler for host/program conditions, restore host/program names in samples, and label the historical scope in the preview dialog. Keep the existing ten-row response cap.

Alarm processing, Alarm Manager integration, SQL previews and removal previews are unchanged. Historical testing is read-only and never replays messages as alarms.

Related Issue

None linked.

Motivation and Context

The incoming table is temporary, so incoming-only previews can return zero for messages users can still see in stored history. A bounded historical fallback makes those condition-builder tests useful without scanning all retained messages.

How Has This Been Tested?

  • Local disposable MariaDB: 14 checks covering the reported example, the 10,000-message boundary, restored host/program names, custom incoming mappings, incoming precedence, unchanged SQL/removal behavior, invalid filters, database failure handling, literal LIKE wildcards, read-only behavior and the sample limit.
  • Filter compiler regression, PHP lint, JavaScript syntax and diff checks passed on the rebased branch.
  • Test-host CLI preview found one match for the reported historical example. Live browser interaction is unverified.
  • Full Pest execution is blocked locally by a missing Symfony Console dependency.

Types of changes

  • Bug fix
  • Breaking change

Checklist

  • Tester fix is separate from the Alarm Manager feature.
  • Repository documentation and focused regression test updated.

Copilot AI balanced review requested due to automatic review settings October 26, 2026 17:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Comment thread tests/regression/rule_preview_history_database_test.php Fixed
Comment thread tests/regression/rule_preview_history_database_test.php Fixed
Comment thread tests/regression/rule_preview_history_database_test.php Fixed
Comment thread tests/regression/rule_preview_history_database_test.php Fixed
Comment thread tests/regression/rule_preview_history_database_test.php Fixed
bmfmancini and others added 2 commits October 26, 2026 13:23
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
xmacan
xmacan previously approved these changes Oct 26, 2026
@sonarqubecloud

Copy link
Copy Markdown

@bmfmancini
bmfmancini requested a review from xmacan October 26, 2026 19:20
@bmfmancini
bmfmancini merged commit 19d6bc8 into develop Oct 26, 2026
8 checks passed
@bmfmancini
bmfmancini deleted the fix_rule_tester_history branch October 26, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants