From 6ae92a98b60227a8a9be94b3669b63ad79ee4990 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Juh=C3=A1s?= <xjuhas@fi.muni.cz>
Date: Thu, 1 Aug 2024 12:05:46 +0200
Subject: [PATCH] docs: update docs about commit message format

No API changes

Closes #250
---
 dev/README.md | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/dev/README.md b/dev/README.md
index b5fff413..3bb9e27e 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)
-- 
GitLab