[PR #19885] [MERGED] Fixes #19633: Log all evaluations of invalid event rule conditions #15746

Closed
opened 2025-12-30 00:23:48 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/19885
Author: @jeremystretch
Created: 7/15/2025
Status: Merged
Merged: 7/15/2025
Merged by: @jnovinger

Base: mainHead: 19633-eventrule-invalid-condition


📝 Commits (3)

  • 2d59a2e flush_events() should catch only import errors
  • 9daf70d Fixes #19633: Log all evaluations of invalid event rule conditions
  • 90fc3f6 Correct comment

📊 Changes

5 files changed (+48 additions, -21 deletions)

View changed files

📝 docs/configuration/system.md (+1 -0)
📝 netbox/extras/conditions.py (+15 -8)
📝 netbox/extras/events.py (+1 -1)
📝 netbox/extras/models/models.py (+10 -2)
📝 netbox/extras/tests/test_conditions.py (+21 -10)

📄 Description

Fixes: #19633

  • Avoid catching unintended exceptions under flush_events()
  • Introduce the InvalidCondition exception
  • Raise InvalidCondition whenever an invalid event rule condition is encountered
  • Catch and log invalid conditions

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/19885 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 7/15/2025 **Status:** ✅ Merged **Merged:** 7/15/2025 **Merged by:** [@jnovinger](https://github.com/jnovinger) **Base:** `main` ← **Head:** `19633-eventrule-invalid-condition` --- ### 📝 Commits (3) - [`2d59a2e`](https://github.com/netbox-community/netbox/commit/2d59a2e1ec7ece0b7e517b10faeb57f3c5778df2) flush_events() should catch only import errors - [`9daf70d`](https://github.com/netbox-community/netbox/commit/9daf70d7140cf86930252d7aee108f3ca2cd1f18) Fixes #19633: Log all evaluations of invalid event rule conditions - [`90fc3f6`](https://github.com/netbox-community/netbox/commit/90fc3f6653e344a1c2a42b7347cb8502d6c6378e) Correct comment ### 📊 Changes **5 files changed** (+48 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `docs/configuration/system.md` (+1 -0) 📝 `netbox/extras/conditions.py` (+15 -8) 📝 `netbox/extras/events.py` (+1 -1) 📝 `netbox/extras/models/models.py` (+10 -2) 📝 `netbox/extras/tests/test_conditions.py` (+21 -10) </details> ### 📄 Description ### Fixes: #19633 - Avoid catching unintended exceptions under `flush_events()` - Introduce the InvalidCondition exception - Raise InvalidCondition whenever an invalid event rule condition is encountered - Catch and log invalid conditions --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:23:48 +01:00
adam closed this issue 2025-12-30 00:23:49 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15746