Commit Graph

9 Commits

Author SHA1 Message Date
Jeremy Stretch 9abbebe392 Add v4.7 release notes 2026-08-14 13:53:02 -04:00
Jeremy Stretch ca76dacbf3
#18159: Handle malformed paths and absent data in conditions (Pre-release QA) (#22911)
Distinguish absent values from malformed or unwalkable paths during
condition evaluation.

Preserve valid empty-list traversal, support changes in snapshot shape,
and reject snapshot attributes which are missing from both snapshots.

Normalize absent job payloads and ensure conditioned rules fail closed
when no payload is available. Add regression coverage and streamline the
related documentation and comments.
2026-08-14 10:09:05 +02:00
bctiemann d88b6a65dd
Closes #18159: Expose snapshots to Event Rule condition evaluation (#22637)
Expose an event's prechange and postchange snapshots to event rule
condition evaluation, making snapshots.prechange.<attr> and
snapshots.postchange.<attr> available through the existing dot-path
syntax.

Add changed and unchanged snapshot operators for comparing an attribute
across the two snapshots without requiring a condition value. These
operators support rules such as firing only when a field transitions to a
specific state.

Make condition values optional only for snapshot operators by introducing
a missing-value sentinel, while preserving value requirements for all
other operators. Reject invalid combinations such as using changed or
unchanged with an explicit value or with an attr starting with snapshots.

Fail closed when condition paths traverse invalid snapshot structures,
including raw scalar snapshot values such as status strings, by treating
unresolvable snapshot-operator paths as missing and converting invalid
direct paths to InvalidCondition.

Document the new snapshot path syntax, changed and unchanged operators,
create/delete snapshot behavior, and the serialization differences
between snapshot data and REST API data. Add regression and integration
tests covering validation, transition behavior, null snapshot edge cases,
direct snapshot paths, and event rule evaluation.
2026-07-11 18:32:22 +02:00
mr1716 122e2d13dd #20175 Fix Grammatical Error Related To Capitalization 2025-08-25 14:28:35 -04:00
Kenny Y 22e474ff96 Update attr in conditions example 2023-11-02 10:22:54 -04:00
kkthxbye df499ea8ac
Fixes #11459 - Allow using null in conditions (#11722)
* Fixes #11459 - Allow using null in conditions
- Update docs to reflect this
- Change docs example from primary_ip to primary_ip4 as computed properties are not serialized when queuing webhooks

* Update netbox/extras/conditions.py

---------

Co-authored-by: Simon Toft <SITO@telenor.dk>
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-02-13 17:44:35 -05:00
jeremystretch 4b81d86311 Closes #8376: Correct example condition defitinions; call out value vs label ealuation for choice fields 2022-01-18 11:31:39 -05:00
jeremystretch dcececf9c0 Improve documentation and testing for conditions 2021-11-03 14:02:43 -04:00
jeremystretch 2423e0872f Documentation & changelog for #6238 2021-10-25 09:52:08 -04:00