diff --git a/.env.example b/.env.example index 06978e61..2441bcd9 100644 --- a/.env.example +++ b/.env.example @@ -17,6 +17,6 @@ MAX_STEPS_PER_RUN = 50 # Control log level LOG_LEVEL=INFO # Database connection string -DATABASE_STRING="postgresql+psycopg://skyvern-open-source@localhost/skyvern-open-source" +DATABASE_STRING="postgresql+psycopg://skyvern@localhost/skyvern" # Port to run the agent on PORT=8000 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..d30abad9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,94 @@ +name: Run tests and pre-commit + +# Run this job on pushes to `main`, and for pull requests. If you don't specify +# `branches: [main], then this actions runs _twice_ on pull requests, which is +# annoying. +on: + pull_request: + push: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + + # Service containers to run with `container-job` + services: + # Label used to access the service container + postgres: + # Docker Hub image + image: postgres + # Provide the password for postgres + env: + POSTGRES_USER: skyvern + POSTGRES_DATABASE: skyvern + POSTGRES_HOST_AUTH_METHOD: trust + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Maps tcp port 5432 on service container to the host + - 5432:5432 + + steps: + - uses: actions/checkout@v3 + + # If you wanted to use multiple Python versions, you'd have specify a matrix in the job and + # reference the matrixe python version here. + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + + # Cache the installation of Poetry itself, e.g. the next step. This prevents the workflow + # from installing Poetry every time, which can be slow. Note the use of the Poetry version + # number in the cache key, and the "-0" suffix: this allows you to invalidate the cache + # manually if/when you want to upgrade Poetry, or if something goes wrong. This could be + # mildly cleaner by using an environment variable, but I don't really care. + - name: cache poetry install + uses: actions/cache@v3 + with: + path: ~/.local + key: poetry-1.7.1 + + # Install Poetry. You could do this manually, or there are several actions that do this. + # `snok/install-poetry` seems to be minimal yet complete, and really just calls out to + # Poetry's default install script, which feels correct. I pin the Poetry version here + # because Poetry does occasionally change APIs between versions and I don't want my + # actions to break if it does. + # + # The key configuration value here is `virtualenvs-in-project: true`: this creates the + # venv as a `.venv` in your testing directory, which allows the next step to easily + # cache it. + - uses: snok/install-poetry@v1 + with: + version: 1.7.1 + virtualenvs-create: true + virtualenvs-in-project: true + + # Cache your dependencies (i.e. all the stuff in your `pyproject.toml`). Note the cache + # key: if you're using multiple Python versions, or multiple OSes, you'd need to include + # them in the cache key. I'm not, so it can be simple and just depend on the poetry.lock. + - name: cache deps + id: cache-deps + uses: actions/cache@v3 + with: + path: .venv + key: pydeps-${{ hashFiles('**/poetry.lock') }} + + # Install dependencies. `--no-root` means "install all dependencies but not the project + # itself", which is what you want to avoid caching _your_ code. The `if` statement + # ensures this only runs on a cache miss. + - run: poetry install --no-interaction --no-root + if: steps.cache-deps.outputs.cache-hit != 'true' + + # Now install _your_ project. This isn't necessary for many types of projects -- particularly + # things like Django apps don't need this. But it's a good idea since it fully-exercises the + # pyproject.toml and makes that if you add things like console-scripts at some point that + # they'll be installed and working. + - run: poetry install --no-interaction + + # Finally, run pre-commit. + - uses: pre-commit/action@v3.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eaea5ffd..607ecb88 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -78,6 +78,7 @@ repos: rev: v2.2.0 hooks: - id: doctoc + exclude: 'README.md' - repo: local hooks: - id: alembic-check diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 6787d51e..ff12ebf6 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,3 +1,22 @@ + + +**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* + +- [Code of Conduct - Skyvern](#code-of-conduct---skyvern) + - [Our Pledge](#our-pledge) + - [Our Standards](#our-standards) + - [Our Responsibilities](#our-responsibilities) + - [Scope](#scope) + - [Enforcement](#enforcement) + - [Enforcement Guidelines](#enforcement-guidelines) + - [1. Correction](#1-correction) + - [2. Warning](#2-warning) + - [3. Temporary Ban](#3-temporary-ban) + - [4. Permanent Ban](#4-permanent-ban) + - [Attribution](#attribution) + + + # Code of Conduct - Skyvern ## Our Pledge diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cdd48a99..2b9578c2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,27 @@ + + +**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* + +- [Contributing to Skyvern](#contributing-to-skyvern) + - [Table of Contents](#table-of-contents) + - [Code of Conduct](#code-of-conduct) + - [I Have a Question](#i-have-a-question) + - [I Want To Contribute](#i-want-to-contribute) + - [Reporting Bugs](#reporting-bugs) + - [Before Submitting a Bug Report](#before-submitting-a-bug-report) + - [How Do I Submit a Good Bug Report?](#how-do-i-submit-a-good-bug-report) + - [Suggesting Enhancements](#suggesting-enhancements) + - [Before Submitting an Enhancement](#before-submitting-an-enhancement) + - [How Do I Submit a Good Enhancement Suggestion?](#how-do-i-submit-a-good-enhancement-suggestion) + - [Your First Code Contribution](#your-first-code-contribution) + - [Improving The Documentation](#improving-the-documentation) + - [Styleguides](#styleguides) + - [Commit Messages](#commit-messages) + - [Join The Project Team](#join-the-project-team) + - [Attribution](#attribution) + + + # Contributing to Skyvern diff --git a/alembic.ini b/alembic.ini index c7ba48fe..354fc01b 100644 --- a/alembic.ini +++ b/alembic.ini @@ -61,7 +61,7 @@ version_path_separator = os # Use os.pathsep. Default configuration used for ne # output_encoding = utf-8 ; sqlalchemy.url = driver://user:pass@localhost/dbname -sqlalchemy.url = postgresql+psycopg://skyvern-open-source-@localhost/skyvern-open-source +sqlalchemy.url = postgresql+psycopg://skyvern@localhost/skyvern [post_write_hooks] diff --git a/setup.sh b/setup.sh index 3a3f47d5..fd32f39a 100755 --- a/setup.sh +++ b/setup.sh @@ -55,11 +55,11 @@ setup_postgresql() { brew install postgresql@14 brew services start postgresql@14 - if psql skyvern-open-source -U skyvern-open-source -c '\q'; then + if psql skyvern -U skyvern -c '\q'; then echo "Connection successful. Database and user exist." else - createuser skyvern-open-source - createdb skyvern-open-source -O skyvern-open-source + createuser skyvern + createdb skyvern -O skyvern echo "Database and user created successfully." fi } @@ -87,7 +87,7 @@ create_organization() { fi # Update the secrets-open-source.toml file - echo -e "[skyvern]\nconfigs = [\n {\"env\" = \"local\", \"host\" = \"http://0.0.0.0:8000/api/v1\", \"orgs\" = [{name=\"Skyvern-Open-Source\", cred=\"$api_token\"}]}\n]" > .streamlit/secrets.toml + echo -e "[skyvern]\nconfigs = [\n {\"env\" = \"local\", \"host\" = \"http://0.0.0.0:8000/api/v1\", \"orgs\" = [{name=\"Skyvern\", cred=\"$api_token\"}]}\n]" > .streamlit/secrets.toml echo ".streamlit/secrets.toml file updated with organization details." }