-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pi-migration-delete-tasks #1929
Conversation
WalkthroughWalkthroughThe changes introduce modifications to handle the migration of process instances involving timers in the BPMN workflow. New imports and variables are added to handle tasks before and after migration. The changes also include tests for the new migration functionality and updates to existing tests for accuracy. Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files ignored due to path filters (1)
spiffworkflow-backend/poetry.lock
is excluded by!**/*.lock
Files selected for processing (5)
- spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_service.py (3 hunks)
- spiffworkflow-backend/tests/data/migration-test-with-timer/migration-initial.bpmn (1 hunks)
- spiffworkflow-backend/tests/data/migration-test-with-timer/migration-new.bpmn (1 hunks)
- spiffworkflow-backend/tests/spiffworkflow_backend/helpers/base_test.py (5 hunks)
- spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_service.py (7 hunks)
Additional comments not posted (9)
spiffworkflow-backend/tests/data/migration-test-with-timer/migration-initial.bpmn (1)
1-106
: Well-defined BPMN process for timer event handling.The BPMN file is well-structured and defines a clear process involving start events, script tasks, intermediate catch events, and end events. The timer event is correctly defined with a repeating interval, which is crucial for the intended functionality.
spiffworkflow-backend/tests/data/migration-test-with-timer/migration-new.bpmn (1)
1-106
: Updated timer settings in the new BPMN file.The BPMN structure remains consistent with the initial version, with an updated timer setting from 60 seconds to 30 seconds. This change likely represents a scenario testing or process optimization. Ensure that this new setting aligns with the expected behavior and testing requirements.
spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_service.py (3)
2-2
: Adjusted imports and added new import for task model.The changes in imports, including the addition of
TaskModel
, are appropriate for the new functionalities being tested. Ensure that these changes do not introduce any unresolved dependencies.Also applies to: 16-16
123-123
: Updated datetime references to fully qualified imports.The changes from
datetime.now(timezone.utc)
todatetime.datetime.now(datetime.timezone.utc)
are consistent and correct, reflecting the modified import statements. This ensures clarity in the code by using fully qualified names.Also applies to: 134-134, 145-145, 157-157
417-490
: Comprehensive test for process instance migration with a timer.The new test method
test_it_can_migrate_a_process_instance_a_timer
is well-structured and covers a significant scenario involving timer events in process migration. It includes setup, execution, and assertion phases that are crucial for validating the migration logic.spiffworkflow-backend/tests/spiffworkflow_backend/helpers/base_test.py (2)
1-2
: Added necessary imports for new functionalities.The imports added, including
datetime
,TaskModel
, andflag_modified
, are necessary for the new functionalities introduced in this file. These are used effectively in the new methods for handling timer events and tasks.Also applies to: 15-15, 33-33, 42-42
653-672
: New methods for handling timer events and tasks.The methods
set_timer_event_to_new_time
andget_all_children_of_spiff_task
are well-implemented, providing functionalities essential for manipulating timer events and navigating task hierarchies in tests. These methods enhance the testing capabilities for BPMN processes involving timers.spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_service.py (2)
43-43
: Review of the new import statement.The import of
BpmnProcessModel
is consistent with the summary that mentions new BPMN process definitions. Ensure that this model is utilized appropriately in the subsequent code.
234-239
: Review of task state tracking variables.The introduction of
pre_migration_tasks
andpost_migration_tasks
is appropriate for tracking the state of tasks before and after migration. This is crucial for understanding the changes and impacts of the migration process.
spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_service.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_service.py (7 hunks)
Files skipped from review as they are similar to previous changes (1)
- spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_service.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files ignored due to path filters (1)
spiffworkflow-backend/poetry.lock
is excluded by!**/*.lock
Files selected for processing (1)
- spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_service.py (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_service.py
Fixes #1909
This deletes tasks and bpmn processes out of the database if they were removed in a process instance migration. It also adds a test for timer events to make sure they can work as well.
Summary by CodeRabbit
New Features
Tests
Bug Fixes