Skip to content

Latest commit

 

History

History
101 lines (76 loc) · 2.08 KB

CONTRIBUTING.md

File metadata and controls

101 lines (76 loc) · 2.08 KB

CONTRIBUTING

Contributions are welcome, and are accepted via pull requests. Please review these guidelines before submitting any pull requests.

Setup

Clone your fork, then install the dev dependencies:

composer install

You can use the devx/docker-compose.yml file to run a local postgresql database with the pgvector extension available.

docker-compose up -d

Process

  1. Fork the project
  2. Create a new branch
  3. Code, test, commit and push
  4. Open a pull request detailing your changes.

Guidelines

  • Please ensure the coding style running composer lint.
  • Send a coherent commit history, making sure each individual commit in your pull request is meaningful.
  • You may need to rebase to avoid merge conflicts.
  • Please remember that we follow SemVer.

Refactor

Refactor your code:

composer refactor

Lint

Lint your code:

composer lint

Tests

Run all tests:

composer test

Check code quality:

composer test:refactor

Check types:

composer test:types

Unit tests:

composer test:unit

Integration tests

You'll need a API key from OPENAI and export it as a env var. You also need to have a postgresql database running with the same parameters as in the docker-compose.yaml file from devx folder.

Then run this sql query to create the table for the tests:

CREATE EXTENSION vector;

CREATE TABLE IF NOT EXISTS test_place (
                                          id SERIAL PRIMARY KEY,
                                          content text,
                                          type text,
                                          sourcetype text,
                                          sourcename text,
                                          embedding vector
);

Then run:

composer test:int

You can set host names for the various services involved in integration tests using these environment variables:

PGVECTOR_HOST
ELASTIC_URL
MILVUS_HOST
REDIS_HOST