Skip to content

RedHatInsights/insights-tag-service

Repository files navigation

Insights Tag Service

Dev Setup

  1. Install dependencies
pip install pipenv alembic --user
pipenv install
  1. Start Postgres Database (might need to run this as root depending on your docker setup)
docker-compose up insights-tag-db
  1. Migrate the Database
pipenv shell
PYTHONPATH=. alembic upgrade head
  1. Start the server
pipenv run server

Testing

  1. Install dependencies
pip install pipenv alembic --user
pipenv install
npm install oatts mocha chakram -g
  1. Run generated tests
pipenv run test

Dev Guidelines

  • In general exceptions should be handled via app.add_error_handler. See here

  • Follow these steps to generate a new migration

    1. Start a virtual env
    pipenv shell
    1. Update database to current version
    PYTHONPATH=. alembic upgrade head
    1. Generate new migration version from changes to db.models
    PYTHONPATH=. alembic revision --autogenerate -m "Description of model changes"
    1. Open db/migrations/versions/{new-script}.py and make any required manual changes

    2. Run the migration

    PYTHONPATH=. alembic upgrade head

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published