You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The FIELD pseudo-cause was introduced as an easy way to mark the per-field handlers (@kopf.on.field), and then to select them on the event handling. The field handlers were handled separately, after all the object handlers.
Over time, this pseudo-cause was merged into the overall handling routine, and has become a problem: it prevents further refactoring (of event/cause detection and handling), which in turn is needed for the test coverage.
This PR is a set of changes extracted from a bigger branch for the ease of code review (one small part at a time). It does NOT change the behaviour of the framework or of any handlers; it just changes the internal implementation of it:
No more FIELD pseudo-causes in the code.
The catch-all handlers (event==None) with field property set are now used — i.e. any event as long as this field is in the diff. Efficiently, it means only the UPDATE events — same as before.
In addition, the tests of handler selection were improved to reflect all cases; and to make the test ids more readable.
The text was updated successfully, but these errors were encountered:
kopf-archiverbot
changed the title
[archival placeholder]
[PR] Refactor the FIELD pseudo-cause into the catch-all events and a field filter
Aug 19, 2020
The
FIELD
pseudo-cause was introduced as an easy way to mark the per-field handlers (@kopf.on.field
), and then to select them on the event handling. The field handlers were handled separately, after all the object handlers.Over time, this pseudo-cause was merged into the overall handling routine, and has become a problem: it prevents further refactoring (of event/cause detection and handling), which in turn is needed for the test coverage.
This PR is a set of changes extracted from a bigger branch for the ease of code review (one small part at a time). It does NOT change the behaviour of the framework or of any handlers; it just changes the internal implementation of it:
FIELD
pseudo-causes in the code.event==None
) withfield
property set are now used — i.e. any event as long as this field is in the diff. Efficiently, it means only theUPDATE
events — same as before.In addition, the tests of handler selection were improved to reflect all cases; and to make the test ids more readable.
The text was updated successfully, but these errors were encountered: