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

Update readme #1010

Merged
merged 4 commits into from
Feb 9, 2024
Merged

Update readme #1010

merged 4 commits into from
Feb 9, 2024

Conversation

tcoz
Copy link
Collaborator

@tcoz tcoz commented Feb 9, 2024

For users that want to run on a Mac, Python3, and everything local/native, they'll need these notes and the code tweak in init.py

Summary by CodeRabbit

  • Documentation
    • Updated the README with instructions for local setup, including installations and configurations.
    • Added details on setting up Keycloak and frontend, and running tests.
    • Highlighted potential port conflicts on Mac OS 12.1 due to AirPlay receiver.
    • Enhanced documentation to aid in understanding the system.

Some notes for people that might want to run full-on native, with detail about how Mac hijacks port 7000 and how to get around it.
This reverts commit 096887c.
Some details for user that might be running Python3, Mac, and want to run everything locally/natively.
Copy link
Contributor

coderabbitai bot commented Feb 9, 2024

Walkthrough

Walkthrough

The recent updates provide comprehensive instructions for setting up and running the application locally, addressing both the installation requirements and configuration steps necessary for Keycloak, the frontend, and testing procedures. Additionally, the updates highlight a potential issue with port conflicts on Mac OS 12.1 and enhance the understanding of the system. Moreover, there's an important note on the backend regarding the preferred MySQL library for Python 3 environments outside Docker.

Changes

File(s) Summary
README.md Added instructions for local setup, including Keycloak, frontend, testing, and noted Mac OS port conflicts.
spiffworkflow-backend/.../__init__.py Added comments on using pymysql over MySQLdb for Python 3 non-Docker setups.

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

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between 4b2fbd8 and 25f8377.
Files selected for processing (2)
  • README.md (4 hunks)
  • spiffworkflow-backend/src/spiffworkflow_backend/init.py (1 hunks)
Additional comments: 2
README.md (2)
  • 28-32: The guidance to modify __init__.py by adding pymysql as a replacement for MySQLdb is crucial for Python 3 users. Ensure that the instructions are consistent with the actual changes made in the __init__.py file of the spiffworkflow-backend project.
  • 74-74: The additional note in the Docker section about MacOS 12.1 and AirPlay receiver port conflicts reinforces the importance of this information. Ensure this advice is consistent and clear across different sections where port conflicts are mentioned.

Comment on lines +19 to +35
## If you want to run all locally:

If you're on a Mac and trying to run native (might translate elsewhere) running python 3 and get errors with mysqlclient and psycopgen2 when running the Poetry install, you may need to install mysql-client, pkg-config, mysqlclient, and psycopgen2 first, remove mysqlclient and psycopgen2 from the pyproject.toml (or Poetry will try to build them and crash), and run the Poetry install again.

brew install mysql-client pkg-config
export PKG_CONFIG_PATH="$(brew --prefix)/opt/mysql-client/lib/pkgconfig"
pip install mysqlclient
pip install psycopg2

Python3 also won't recognize MySQLdb as a module. After the above installs (which you would do pre-Poetry), add these lines to __init__.py in the backend project:

import pymysql;
pymysql.install_as_MySQLdb()

On a Mac, port 7000 (used by the app) might be hijacked by Airplay. See the Docker section below.

Remember, if you don't need a full-on native dev experience, you can run the docker image, which saves you from all the native setup.
Copy link
Contributor

Choose a reason for hiding this comment

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

The instructions for resolving issues with mysqlclient and psycopg2 during the Poetry install are clear but consider adding a note about the potential need for these steps only if errors are encountered. This could prevent unnecessary pre-emptive modifications to pyproject.toml.

import pymysql;
pymysql.install_as_MySQLdb()

On a Mac, port 7000 (used by the app) might be hijacked by Airplay. See the Docker section below.
Copy link
Contributor

Choose a reason for hiding this comment

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

The note about port 7000 potentially being used by AirPlay on Mac is helpful. Consider adding a command or step-by-step guide on how to check if the port is currently in use, providing a more complete solution to the problem.

Comment on lines +28 to +32
# This is necessary to make sure that the pymysql library is used as the MySQLdb library
# This is only needed if you want to run non-docker local and are using Python 3.
# See the repo's top-level README for details.
# import pymysql;
# pymysql.install_as_MySQLdb()
Copy link
Contributor

Choose a reason for hiding this comment

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

The comments explaining the use of pymysql as a replacement for MySQLdb are commented out. If these instructions are meant to be followed by users, consider moving this guidance to the README.md or ensuring it's uncommented and executed as part of the application setup.

Copy link
Contributor

@burnettk burnettk left a comment

Choose a reason for hiding this comment

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

thanks!

@burnettk burnettk merged commit 223ff95 into sartography:main Feb 9, 2024
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.

None yet

2 participants