Skip to content
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

Feature/reset pi go button #978

Merged
merged 3 commits into from
Feb 6, 2024
Merged

Feature/reset pi go button #978

merged 3 commits into from
Feb 6, 2024

Conversation

jasquat
Copy link
Contributor

@jasquat jasquat commented Feb 6, 2024

Fixes #767

This ensures human tasks that were created for a given task are removed if the process instance is reset to that task. This is apparently how we were getting duplicate human tasks in the table for the same task guid.

This also includes a data migration to remove duplicate human task rows. It finds all rows that have the same task guid and deletes the oldest ones. This should allow for a much cleaner migration with #811.

Copy link
Contributor

coderabbitai bot commented Feb 6, 2024

Walkthrough

Walkthrough

The updates introduce a new function to remove duplicate rows in the HumanTaskModel table, enhancing data integrity. Additionally, a parameter is added to the reset process to handle task IDs correctly, ensuring proper task completion and addressing duplicated human tasks. These changes aim to improve the reliability and accuracy of task processing and management within the system.

Changes

Files Change Summary
.../bin/data_migrations/run_all.py Added remove_duplicate_human_task_rows() to delete duplicate HumanTaskModel rows.
.../src/spiffworkflow_backend/services/process_instance_processor.py Added to_task_guid parameter to reset_process method for correct task ID handling.
.../src/spiffworkflow_backend/services/task_service.py Updated update_all_tasks_from_spiff_tasks method to include to_task_guid parameter.
.../tests/spiffworkflow_backend/unit/test_process_instance_processor.py Adjusted tests for reset_process method to reflect changes in task ID handling.

Related issues

  • added uniqueness constraint to human task #811: The changes directly address the issue of duplicate human task entries by introducing a function to remove duplicates and adjusting task handling to prevent future duplications. This aligns with the issue's goal of enforcing uniqueness in the human_task table.

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?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 7

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between a61f2d6 and d7aec41.
Files selected for processing (4)
  • spiffworkflow-backend/bin/data_migrations/run_all.py (3 hunks)
  • spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py (1 hunks)
  • spiffworkflow-backend/src/spiffworkflow_backend/services/task_service.py (1 hunks)
  • spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_processor.py (1 hunks)
Additional comments: 2
spiffworkflow-backend/bin/data_migrations/run_all.py (1)
  • 90-90: Ensure that calling remove_duplicate_human_task_rows does not impact the performance of the data migration script, especially when dealing with large datasets.
spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py (1)
  • 1232-1232: The addition of to_task_guid parameter to update_all_tasks_from_spiff_tasks method call in reset_process method correctly implements the intended functionality to address the issue of duplicate human tasks by ensuring the reset process uses the correct task ID. This change aligns with the PR objectives and enhances the system's task management capabilities.

@jasquat jasquat merged commit 5ae5936 into main Feb 6, 2024
22 checks passed
@jasquat jasquat deleted the feature/reset-pi-go-button branch February 6, 2024 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reset process here - Go button doesn’t work as expected
2 participants