diff --git a/dev/README.md b/dev/README.md index b5fff413a2ef228f2d8f61529cff44992fd9003e..3bb9e27efefa539627226a71770ec266d92c1cd7 100644 --- a/dev/README.md +++ b/dev/README.md @@ -5,6 +5,15 @@ It is the responsibility of the developer to keep these tools up-to-date, however the updating process should be kept simple. +## Sections +- [Docker containers](#docker-containers) +- [Commit messages](#commit-messages) +- [Git hooks](#git-hooks) +- [Backend versioning](#backend-versioning) +- [Definition versioning](#definition-versioning) +- [Adding tests](#adding-tests) + + ## Docker containers The backend uses a [PostgresSQL 16 database](https://www.postgresql.org/docs/16/index.html). To simplify development, there is a number of different docker compose scripts in the `build` directory: @@ -41,6 +50,53 @@ To seed the database with some initial data, use the provided [seed-db.sh](seed- The script is meant to be run in an environment where python is directly accessible, e.g. an image built from the `build/Dockerfile`, or after running `poetry shell`. +## Commit messages +In order to make life easier for the frontend team, +we provide a semi-detailed description of all API changes that happen for each merge request. +To make life easier for us, +we write these commit messages into the `Commit message` section of the merge request. +This makes it easy for the code reviewer to check the message. + +### Message format +If the merge request contains no graphql api changes: +``` +<feat/change/fix/dev/docs>: <simple description of the changes> + +No API changes + +Closes #<issue number> +``` + +If the merge request contains graphql api changes: +``` +<feat/change/fix/dev/docs>: <simple description of the changes> + +### Additions +- mention names of new types and fields/queries/mutations/subscriptions + +### Changes +- mention names of types and fields/queries/mutations/subscriptions that changed +- also include renaming in this section + +### Deletions +- mention names of deleted types and fields/queries/mutations/subscriptions + +Closes #<issue number> +``` + +In this case, only include sections which are relevant, +e.g. only include the `Additions` section if the changes add something to the api. + +When the merge request is ready to be merged, the commit message **has to be copied** into the +`edit message` box **before merging**. + +REST api changes are contained in the [openapi.yml](../openapi.yml) file. + +### Viewing changes +To view these changes you can simply use this command on the `main` branch of the repository: +```shell +git log --invert-grep --grep="^Merge branch" +``` ## Git hooks [Git hook documentation](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks)