Skip to content

Latest commit

Β 

History

History
86 lines (60 loc) Β· 2.63 KB

File metadata and controls

86 lines (60 loc) Β· 2.63 KB

Quality Gate Status Coverage

Ruff

SoftwareONE MPT Tool

A Python-based migration tool for extensions that standardizes migration execution. It provides a CLI-based interface to manage both schema and data migrations across multiple backends, ensuring consistent behavior in all environments.

Documentation

πŸ“š Complete Usage Guide

Getting started

Prerequisites

  • Docker and Docker Compose plugin (docker compose CLI)
  • make
  • CodeRabbit CLI (optional. Used for running review check locally)
  • Copy .env.sample to .env

Make targets overview

Common development workflows are wrapped in the makefile:

  • make help – list available commands
  • make bash – start the app container and open a bash shell
  • make build – build the application image for development
  • make check – run code quality checks (ruff, flake8, lockfile check)
  • make check-all – run checks and tests
  • make format – apply formatting and import fixes
  • make down – stop and remove containers
  • make review – check the code in the cli by running CodeRabbit
  • make run – run the CLI tool
  • make test – run the test suite with pytest

Running CLI commands

Run the CLI tool:

make run

Running tests

Tests run inside Docker using the dev configuration.

Run the full test suite:

make test

Pass additional arguments to pytest using the args variable:

make test args="-k test_cli -vv"
make test args="tests/test_cli.py"

Pre-commit

Checking migrations with pre-commit:

Add this to your .pre-commit-config.yaml

-   repo: https://github.com/softwareone-platform/mpt-tool
    rev: ''  # Use the sha / tag you want to point at
    hooks:
    -   id: check-migrations

Developer utilities

Useful helper targets during development:

make bash      # open a bash shell in the app container
make check     # run ruff, flake8, and lockfile checks
make check-all # run checks and tests
make format    # auto-format code and imports
make review    # check the code in the cli by running CodeRabbit