Skip to content

Architectural Audit and Implementation Plan for trigger_condition Deprecation#269

Open
ruzaqiarkan-eng wants to merge 5 commits into
developfrom
trigger-condition-deprecation-audit-11886580423312967736
Open

Architectural Audit and Implementation Plan for trigger_condition Deprecation#269
ruzaqiarkan-eng wants to merge 5 commits into
developfrom
trigger-condition-deprecation-audit-11886580423312967736

Conversation

@ruzaqiarkan-eng

Copy link
Copy Markdown
Collaborator

Performed a full repository audit of the trigger_condition JSON field. Evaluated the proposal to relocate this field to the Entry Action configuration to establish a single source of truth and align with the decentralized contract architecture. Produced a recommendation report and a phased implementation plan covering backend, frontend, migration, and testing strategies.


PR created automatically by Jules for task 11886580423312967736 started by @ruzaqiarkan-eng

…dition deprecation

This commit introduces two new reports under the `report/` directory:
1. `trigger-condition-architecture-audit.md`: A comprehensive review of the current implementation of `trigger_condition` and an evaluation of the proposal to move it to the `Entry Action` configuration.
2. `trigger-condition-implementation-plan.md`: A detailed, implementation-ready plan for migrating the data, updating the codebase (backend, frontend, tests), and handling deprecation gracefully.

No functional code changes were made as per the task requirements.
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

…r_condition deprecation

This commit provides a complete engineering blueprint for relocating the Rule Trigger Condition to the Entry Action config. It includes:
- An architecture audit confirming the move to Entry Action as the single source of truth.
- A technical implementation plan with centralized helpers (get_entry_action), idempotent migration logic, a detailed testing matrix, and a staged deprecation timeline.

No functional code changes were made per task requirements.
…_condition deprecation

This commit provides the final architectural audit and implementation blueprint for the relocation of Rule Trigger Conditions.

Key features of the design:
- Encapsulated Rule API for trigger access (get_entry_condition, etc.).
- Clearly defined ownership: Entry Action owns source JSON; Rule owns compiled artifact.
- Conservative, idempotent migration strategy bypassing lifecycle hooks.
- Centralized compatibility layer for a staged Release N to N+2 deprecation.
- Comprehensive testing matrix and success criteria.

No production code was modified during this audit phase.
This commit implements the architectural relocation of Rule Trigger Conditions
from the parent Rule DocType to the Entry Action (Start Node) child record.

Key Changes:
- Introduced encapsulated Rule API: get_entry_action(), get_entry_condition().
- Enforced strict runtime isolation: RuleCoordinator and SubRuleHandler now
  rely exclusively on compiled_expression. JSON reading removed from execution.
- Added Rule validation invariants for Entry Action (existence, topology).
- Redirected Rule Builder persistence and hydration to Entry Action config.
- Created idempotent migration patch for legacy data.
- Updated all core tests and documentation.
- Maintained dual-read compatibility for the Release N transition period.

Verified with 407 backend tests passing.
This commit applies automated formatting fixes to `flexirule/ruleflow/doctype/rule/rule.py`
to resolve CI failures in the Frappe Linter step.

- Fixed line length and indentation in Entry Action validation.
- Standardized whitespace throughout the file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant