feat: Conditional Workflow Unlocking and End-Node Completion#176
Conversation
Summary of ChangesHello @sthanikan2000, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the workflow management system by introducing advanced control mechanisms for node progression and workflow completion. It allows for more dynamic and flexible workflows through conditional unlocking logic based on DNF expressions and granular completion outcomes. Additionally, it provides the ability to define a specific 'end node' for a workflow, enabling path-based completion rather than strict adherence to all nodes finishing. These changes provide greater adaptability for complex business processes while maintaining full backward compatibility with existing implementations. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
The pull request introduces conditional workflow unlocking using DNF expressions and path-based completion via end nodes. While the implementation is solid and includes comprehensive tests, there are a few areas for improvement, specifically regarding consistency between Consignment and Pre-Consignment services and potential runtime safety issues like nil pointer dereferences.
There was a problem hiding this comment.
Code Review
This pull request introduces significant new features for workflow management, including conditional node unlocking using DNF expressions, outcome sub-states for completed nodes, and end-node-based workflow completion. The changes are well-structured, with new models, service enhancements, and comprehensive tests. The backward compatibility considerations are clearly articulated, which is excellent. The database migrations and seed data also align with the new functionality. Overall, the implementation appears robust and addresses the requirements effectively.
backend/internal/database/migrations/011_insert_unlock_config_seed.sql
Outdated
Show resolved
Hide resolved
…d unlock configuration
8aedfeb to
4f9c209
Compare
…ccurate reporting
…ons and update related logic
… node instance IDs and auto-completion of end nodes
Summary
This PR implements conditional workflow unlocking and end-node-based completion for Issue #174, and now supports generalized boolean unlock expressions.
Key capabilities:
General unlock expressions
expression.anyOf/allOfDNF payloads fully supported for backward compatibility.Completion outcomes
outcomeon workflow nodes to represent completion sub-states (APPROVED,REJECTED,FAST_TRACKED, etc.) without expanding core state enums.End-node workflow completion
EndNodeTemplateIDsupport so workflows can finish when a configured end node completes (instead of requiring all nodes to complete).Full backward compatibility
depends_onAND-all behavior.Type of Change
Changes Made
Schema and Migrations
unlock_configuration JSONBtoworkflow_node_templates.outcomeandunlock_configurationtoworkflow_nodes.end_node_template_idtoworkflow_templates.end_node_idtoconsignmentsto track resolved end-node instance.Unlock Configuration Model
expression.anyOffor ORexpression.allOffor ANDnodeTemplateIdplus optionalstateand/oroutcomeAnyOf/AllOfDNF support in place.expressionand legacyanyOftogether.ResolveToInstanceIDsandEvaluatenow support recursive expressions.Workflow/State Machine Behavior
Outcomeis set on completion and used during unlock evaluation.WorkflowCompletionConfig.Seed Data
Updated Fresh Coconut seed workflow in
backend/internal/database/migrations/011_insert_unlock_config_seed.sql:anyOf/allOfblocks toexpression-based boolean configsTesting
Backward Compatibility
depends_onbehavioranyOf/allOfDNF config → still supportedexpressionconfig → fully supportedRelated Issue
Closes #174
Notes
anyOf/allOfexpressionwith nestedanyOf/allOfexpression, while preserving legacy compatibility for existing data.