Update Developer guide - branch name rule becomes more simple authored by Bouvry Arnaud's avatar Bouvry Arnaud
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
title: Developer guide title: Developer guide
--- ---
# IMPORTANT # IMPORTANT
If you have a local clone of the repository that **predates Feb. 19th, 2025, you must absolutely make a new clone**. If you have a local clone of the repository that **predates Feb. 19th, 2025, you must absolutely make a new clone**.
...@@ -153,22 +154,24 @@ To configure the new branch, click on the drop-down arrow on the right of the bl ...@@ -153,22 +154,24 @@ To configure the new branch, click on the drop-down arrow on the right of the bl
![MR-dropdown-arrow](uploads/bd81fe2fe9d0c46fe5e4906fea3bee15/MR-dropdown-arrow.png) ![MR-dropdown-arrow](uploads/bd81fe2fe9d0c46fe5e4906fea3bee15/MR-dropdown-arrow.png)
When creating a branch, always check that you are branching from the correct source branch (see [Branching strategy : git-flow](#branching-strategy--git-flow)). When creating a branch, always check that you are branching from the correct source branch (see [Branching strategy : git-flow](#branching-strategy--git-flow) ; the default branch is `develop`).
When the correct source is selected, click on "Create merge request", at the bottom of the drop-down. Never directly click on "Create merge request", **always use the button at the bottom of the drop-down**. When the correct source is selected, click on "Create merge request", at the bottom of the drop-down.
Never directly click on "Create merge request", **always use the button at the bottom of the drop-down**.
![image](uploads/58fc4e981b344bd934eae9d4da3f175d/image.png){width=537 height=302} ![image](uploads/58fc4e981b344bd934eae9d4da3f175d/image.png){width=537 height=302}
The branch name push rule in the public repository is set with the following regular expression: The branch name push rule in the public repository is set with the following regular expression:
`^(main|develop|(\d+)-hotfix-.+|(\d+)-feature-.*|release-v\d+\.\d+\.\d+)$` `^(main|develop|(\d+)-.*|release-v\d+\.\d+\.\d+)$`
Examples of valid branch names are listed below. You can test the regular expression above by copy/pasting it in https://regex101.com/ and tweaking your text until it matches the expression. Examples of valid branch names are listed below.
**When creating a branch from an Issue in Gitlab, the default name of the branch is always compatible with the repository push rules.**
You can test the regular expression above by copy/pasting it in https://regex101.com/ and tweaking your text until it matches the expression.
Valid branch names: Valid branch names:
- main - main
- develop - develop
- \<issue number\>-hotfix-\<arbitrary text\> (e.g. 2-hotfix-pvgis-api) - \<issue number\>-\<issue title\> (e.g. : 69-feature-grassim-refactoring, generated from issue #69 )
- \<issue number\>-feature-\<issue title\> (e.g. : 69-feature-grassim-refactoring, generated from issue #69 )
- release-v\<major version\>.\<minor version\>.\<patch version\> (e.g. release-v1.2.4) - release-v\<major version\>.\<minor version\>.\<patch version\> (e.g. release-v1.2.4)
Once the branch and merge request are created, you can pull the branch locally, e.g. : Once the branch and merge request are created, you can pull the branch locally, e.g. :
... ...
......