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

spiff lib upgrade #1139

Merged
merged 7 commits into from
Mar 4, 2024
Merged

spiff lib upgrade #1139

merged 7 commits into from
Mar 4, 2024

Conversation

burnettk
Copy link
Contributor

@burnettk burnettk commented Feb 29, 2024

upgrade spiff lib.

Summary by CodeRabbit

  • New Features

    • Added a new BPMN process "Process_SecondFact" to fetch and display random facts from an API.
  • Bug Fixes

    • Resolved compatibility issues with pytest-xdist by downgrading its version.
    • Improved script execution within workflow processes by optimizing method calls and parameters.
  • Refactor

    • Streamlined the evaluation method in process instance processing for better efficiency.
    • Ensured consistency by renaming TestJSONFileDataStore to TestJsonFileDataStore.
    • Enhanced unit tests for clearer focus on custom script execution scenarios.
  • Chores

    • Updated dependency management configurations to enhance stability and compatibility.

Copy link
Contributor

coderabbitai bot commented Feb 29, 2024

Warning

Rate Limit Exceeded

@jasquat has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 0 minutes and 0 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between cf7b009 and c1b51aa.

Walkthrough

The recent updates to the spiffworkflow-backend focus on managing dependencies by downgrading pytest-xdist for compatibility reasons and streamlining the evaluation process in the workflow engine. Changes also include updating the SpiffWorkflow dependency to the main branch, improving script execution, introducing a new BPMN process for random facts, renaming a test class, and refining unit tests for updated script execution logic.

Changes

File(s) Change Summary
poetry.lock, pyproject.toml Downgraded pytest-xdist to 3.3.1; updated SpiffWorkflow to main branch.
.../models/message_instance.py, .../services/process_instance_processor.py Simplified evaluation by adjusting method calls.
.../services/script_unit_test_runner.py Modified script execution with external_context parameter.
tests/data/random_fact/random_fact_set.bpmn Added BPMN process for random facts retrieval and display.
.../integration/test_json_file_data_store.py Renamed TestJSONFileDataStore to TestJsonFileDataStore.
.../unit/test_process_instance_processor.py Refactored unit tests for script execution, focusing on "FactService" scenario.

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 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.

…rade

# Conflicts:
#	spiffworkflow-backend/poetry.lock
#	spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py
@jasquat jasquat marked this pull request as ready for review March 4, 2024 19:27
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: 3

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between a71af6e and 9b6d92f.
Files selected for processing (8)
  • spiffworkflow-backend/poetry.lock (3 hunks)
  • spiffworkflow-backend/pyproject.toml (2 hunks)
  • spiffworkflow-backend/src/spiffworkflow_backend/models/message_instance.py (1 hunks)
  • spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py (1 hunks)
  • spiffworkflow-backend/src/spiffworkflow_backend/services/script_unit_test_runner.py (1 hunks)
  • spiffworkflow-backend/tests/data/random_fact/random_fact_set.bpmn (1 hunks)
  • spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_json_file_data_store.py (1 hunks)
  • spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_processor.py (1 hunks)
Files skipped from review due to trivial changes (1)
  • spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_json_file_data_store.py
Additional comments: 9
spiffworkflow-backend/tests/data/random_fact/random_fact_set.bpmn (1)
  • 1-51: The BPMN process definition in random_fact_set.bpmn is well-structured and follows best practices for defining a simple process with a start event, a script task, and an end event. The use of camunda:inputOutput and camunda:inputParameter in the script task is appropriate for defining input parameters, though it's worth noting that the parameter Fact.type is defined but not used within the script. This might be intentional for future use or an oversight. If it's not required, consider removing it to avoid confusion.
spiffworkflow-backend/src/spiffworkflow_backend/models/message_instance.py (1)
  • 117-117: Replacing _evaluate with environment.evaluate in the payload_matches_expected_values method is a positive change that leverages the existing expression_engine's environment for evaluating expressions. This approach is more consistent and maintainable, ensuring that all evaluations use the same environment and evaluation logic. Ensure that the expression_engine and its environment are properly initialized and configured to handle the expressions used in correlation key retrieval.
spiffworkflow-backend/pyproject.toml (2)
  • 29-29: Updating the SpiffWorkflow dependency to track the main branch instead of a specific commit is a significant change that implies a desire to always use the latest version. While this can ensure access to the newest features and fixes, it also introduces the risk of instability if breaking changes or bugs are introduced in the main branch. Consider whether this aligns with the project's stability and reliability requirements. If stability is a priority, you might want to pin the dependency to a specific release or commit that has been tested and verified.

Consider the implications of tracking the main branch for the SpiffWorkflow dependency and evaluate whether a more stable approach, such as pinning to a specific release, would be more appropriate for the project's needs.

  • 107-107: Downgrading pytest-xdist to version 3.3.1 due to compatibility issues with versions 3.4 and higher is a prudent decision to ensure test suite stability. However, it's important to periodically review this decision and test newer versions of pytest-xdist as they are released. Future versions may resolve the compatibility issues, allowing you to benefit from new features and improvements.

Periodically re-evaluate the compatibility of newer pytest-xdist versions to determine if the project can safely upgrade and take advantage of improvements.

spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_processor.py (2)
  • 34-51: The test method test_script_engine_can_use_custom_scripts is well-structured and correctly tests the functionality of using custom scripts within the ProcessInstanceProcessor. It follows best practices for unit testing by setting up the necessary environment, executing the process, and asserting the expected outcome.
  • 52-52: Given the extensive nature of the provided file and the detailed review required for each test method, I've demonstrated the review process with an initial test method. Each test method should be reviewed similarly, focusing on correctness, logic, syntax, performance, maintainability, and adherence to best practices. Ensure that each test method accurately reflects the intended functionality, uses appropriate assertions, and handles any setup or teardown operations cleanly.
spiffworkflow-backend/poetry.lock (3)
  • 2219-2225: The downgrade of pytest-xdist from 3.5.0 to 3.3.1 is noted. While this change addresses compatibility issues, it's important to verify that this downgrade does not negatively impact the execution of parallel tests or introduce regressions with other dependencies.
  • 2977-2978: The update to point the spiffworkflow package to the main branch is acknowledged. While this ensures access to the latest developments, consider implementing a strategy to mitigate potential risks associated with tracking the main branch, such as specifying a more stable branch or tag for critical deployments.
  • 3454-3454: The update to the content-hash in the metadata section is a standard procedure following the changes made to the dependencies. This ensures the integrity and consistency of the dependency graph.

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 9b6d92f and cf7b009.
Files selected for processing (1)
  • spiffworkflow-backend/src/spiffworkflow_backend/services/script_unit_test_runner.py (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • spiffworkflow-backend/src/spiffworkflow_backend/services/script_unit_test_runner.py

@burnettk burnettk merged commit 3416843 into main Mar 4, 2024
20 checks passed
@burnettk burnettk deleted the feature/spiff-lib-upgrade branch March 4, 2024 20:29
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.

2 participants