Project

General

Profile

Git Workflow » History » Version 16

Alexander Watzinger, 2020-11-06 12:56

1 1 Alexander Watzinger
h1. Git Workflow
2
3
We are using "git":https://git-scm.com/ as a versioning system using the "Git Branching Workflows":https://git-scm.com/book/en/v2/Git-Branching-Branching-Workflows
4
5 6 Alexander Watzinger
h2. Main branches
6 1 Alexander Watzinger
7 14 Alexander Watzinger
* *main* - the stable version used in productive environments. It is the latest release version which is tested and, to our knowledge, bug-free.
8
* *develop* - here the latest development branches are joined when they are finished. At a release the develop branch is merged into the main branch.
9 1 Alexander Watzinger
10 2 Alexander Watzinger
The branches in which the work (in progress) is happening have following prefixes:
11 1 Alexander Watzinger
* *feature_* - e.g. feature_user_profile_images
12
* *fix_* - e.g. fix_map_bug
13
14 13 Alexander Watzinger
h2. Workflow
15 1 Alexander Watzinger
16 13 Alexander Watzinger
If working on a new feature/fix:
17
18 16 Alexander Watzinger
* Start with a new branch from *develop* and call it _feature_something_ or _fix_something_
19 15 Alexander Watzinger
<pre>
20
git checkout develop
21
git checkout -b feature_something
22
</pre>
23
* Implement changes, commit
24
<pre>
25
git add .
26
git commit -m "Implemented feature something"
27
</pre>
28 1 Alexander Watzinger
* Merge *develop* regularly to your branch to keep merge conflicts to a minimum but at least before merging back
29 15 Alexander Watzinger
<pre>
30
git merge develop 
31
</pre>
32 13 Alexander Watzinger
* Make sure that all tests pass, ideally have 100% coverage and Mypy checks are passing too
33
* Document database changes (see below) and add translations if needed
34 1 Alexander Watzinger
* Merge your branch to *develop*
35 15 Alexander Watzinger
<pre>
36
git checkout develop
37
git merge feature_something 
38
</pre>
39 13 Alexander Watzinger
40 14 Alexander Watzinger
Around once a month a new version is released where the *develop* branch is merged into the *main* branch.
41 1 Alexander Watzinger
42 6 Alexander Watzinger
h2. Database changes
43
44
If there are database changes make sure that 
45
46 8 Alexander Watzinger
* there is a comment with the issue number at the SQL update script (e.g. at install/upgrade/3.12.0.sql)
47 6 Alexander Watzinger
* that the issue is noted at util/changelog.py
48
49
That way it's easier to deal with updates in the *develop* branch when dealing with multiple new features which need database updates.