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

Support syncing data stores in the DB with those defined in process_group.json files #1052

Merged
merged 10 commits into from
Feb 19, 2024

Conversation

jbirddog
Copy link
Contributor

@jbirddog jbirddog commented Feb 15, 2024

Work on #1037 - this adds the support for syncing the data store data base tables with the data store specifications found in various process_group.json files on disk. During a run of save_all_process_models the data store specifications are aggregated by a compound key of (type, location, identifier), then existing models are aggregated by the same compound key. From there set operations are used to identify what needs to be inserted, updated or deleted. As noted before data does not migrate, just the specifications.

Summary by CodeRabbit

  • New Features
    • Improved data synchronization capabilities in the backend.
    • Enhanced support for identifying specific file types in the system.

Copy link
Contributor

coderabbitai bot commented Feb 15, 2024

Walkthrough

Walkthrough

The recent updates introduce enhancements in data management and file handling in the project. New data store models and their synchronization logic have been added, improving how data is managed internally. Additionally, a new file system utility method has been introduced to identify specific file types, streamlining file processing tasks.

Changes

File Path Change Summary
spiffworkflow-backend/src/spiffworkflow_backend/services/data_setup_service.py Added imports for JSONDataStore, KKVDataStore, JSONDataStoreModel, KKVDataStoreModel. Introduced all_data_store_specifications dictionary. Added logic to sync data store models with specifications. Defined _sync_data_store_models_with_specifications method for model synchronization.

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: 2

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between c465efc and 4f42838.
Files selected for processing (2)
  • spiffworkflow-backend/src/spiffworkflow_backend/services/data_setup_service.py (3 hunks)
  • spiffworkflow-backend/src/spiffworkflow_backend/services/file_system_service.py (1 hunks)
Additional comments: 4
spiffworkflow-backend/src/spiffworkflow_backend/services/data_setup_service.py (3)
  • 6-10: Ensure the newly added imports are utilized within the file. Unused imports should be removed to maintain code cleanliness.
  • 35-35: Initialization of all_data_store_specifications dictionary is correct and follows the specified objectives.
  • 99-99: The call to _sync_data_store_models_with_specifications correctly uses the aggregated specifications. Ensure that any exceptions raised within this method are appropriately handled or logged.
spiffworkflow-backend/src/spiffworkflow_backend/services/file_system_service.py (1)
  • 65-67: The addition of is_process_group_json_file method is correctly implemented and aligns with the PR objectives to identify process_group.json files based on their extension.

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: 0

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between 4f42838 and e8c918f.
Files selected for processing (1)
  • spiffworkflow-backend/src/spiffworkflow_backend/services/data_setup_service.py (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • spiffworkflow-backend/src/spiffworkflow_backend/services/data_setup_service.py

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: 0

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between e8c918f and bbe153c.
Files selected for processing (1)
  • spiffworkflow-backend/src/spiffworkflow_backend/services/data_setup_service.py (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • spiffworkflow-backend/src/spiffworkflow_backend/services/data_setup_service.py

@jbirddog jbirddog merged commit 6a81d68 into main Feb 19, 2024
22 checks passed
@jbirddog jbirddog deleted the ds_setup branch February 19, 2024 17:21
@madhurrya madhurrya linked an issue Feb 27, 2024 that may be closed by this pull request
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.

Persist data store definitions in the process_group.json file
2 participants