Start using make as task manager
I propose to start using make as en entry point to run the different dev tasks.
The idea is to leverage the power of Make to define dependent tasks and use them to build more advanced task scenarios. Already run tasks will most of the time by shipped unless we explicitly require them to always run (e.g. install the package poetry install
).
This will be similar to the front/packages.json scripts section, but for the project and the api.
The Makefile itself already documents the available tasks for the developers, complex behavior should be commented and/or extracted into scripts
Here are a few tasks I hope to implement:
Project:
- dev: init a fully working dev setup with build+run+migration+seed using docker-compose #2071
- dev-federation: init a federation network with instances using docker-compose #2107
- version: bump the packages version to a new one (replace scripts/set-api-build-metadata.sh)
- docs: run a docs dev setup using docker-compose (docs and dev will be split to reduce complexity)
- clean: cleanup the project, but keep important files (git clean -xdf but keep .env, and other files)
- release: once the versions are bumped, the project is clean, we can run the task to release a new version, and let the user do the final "git push --follow-tags"
API:
- install: poetry install into api/.venv
- format: format all the code using black+isort (either via pre-commit, or directly with black and isort)
- lint: lint the api package using all available linters (pylint, mypy, maybe flake8)
- test: test the api package using pytest (running individual groups of tests should be done manually) (maybe splitting
test
intounit
andintegration
) - schema: generate the api schema
Docs:
- install: poetry install into docs/.venv
- build: build the docs, this would replace the existing scripts
It seems the docs ship a Makefile (from sphinx) but it isn't used.
Some other "common" tasks can be added, I might have missed some. We need to be careful and make sure the time invested in a makefile tasks is actually worth it. For example I can see the gitpod spec use the makefile, but scripting gitpod specific tasks in the makefile is probably not generic enough.