Relocate Rule Trigger Condition to Entry Action Config (Release N)#270
Conversation
- Implemented `get_entry_action` and `get_entry_condition` in `Rule` class. - Added dual-read compatibility layer with priority: Entry Action config > trigger_condition. - Updated `Rule.compile_conditions` and runtime components (`RuleCoordinator`, `SubRuleHandler`) to use encapsulated APIs. - Implemented conservative migration patch for relocating legacy conditions. - Updated Rule Builder frontend to support dual-writing Start Node conditions. - Added unit tests for migration and validated all existing rule tests.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR implements the Release N phase of relocating the Rule Trigger Condition from the root
RuleDocType to theEntry Actionchild table configuration.Changes:
get_entry_action()andget_entry_condition()toRule.resolve_entry_condition()implements the dual-read logic where data in theEntry Actionconfig takes priority over the legacytrigger_conditionfield.compile_conditions,RuleCoordinator,SubRuleHandler, andcompile_serviceto use the new encapsulated APIs instead of direct field reads.migrate_trigger_condition_to_entry_action.pythat safely moves data to the Entry Action config for all existing rules, logging ambiguities tofrappe.log_error.useRuleStore.jsto implement dual-write behavior. Changes to the Start Node condition are now persisted to both the legacy field and the child table config during the transition period.test_migration.pycovering case-by-case migration logic and idempotency. Verified all backend tests pass.PR created automatically by Jules for task 4521664746683897442 started by @ruzaqiarkan-eng