Open main menu

DAVE Developer's Wiki β

Changes

MISC-TN-028: GitLab-based workflow

48 bytes added, 08:33, 19 August 2023
Conclusion
==Essential steps of the workflow==
This section describes in detail the essential steps the workflow is composedof. To this end, we will use a very simple example based on a an ad hoc repository, named <code>test0</code>. The goal is to write the first release of the code by following the recommended workflow.
Once the repository is created on GitLab, we create an issue. Every implementation should start with this step: '''first of all, create an issue'''!
In this case, we call the issue "First release" as shown by the following picture:
[[File:Gitlab-wf-1.png|center|thumb|600px]]
Then, we create a merge request associated with the issue. We instruct GitLab to automatically create a branch associated with this issue as well. The branch will be called <code>1-first-release</code> and its source branch is <code>master</code>. This means then when the merge request is accepted, the new code in the branch <code>1-first-release</code> will be merged into the branch <code>master</code>.
[[File:Gitlab-wf-2.png|center|thumb|600px]]
Please note that the merge options are so that the branch will be deleted when the merge request is accepted. This usually makes sense because we don't need to keep the branch when the job is done. If you are asking to yourself, don't worry: although the branch is deleted, commits will not be lost. Therefore, the history of changes will be preserved.
[[File:Gitlab-wf-3.png|center|thumb|600px]]
On GitLab side everything is in place, so we can work on our local host to write our code. For the sake of simplicity, we will just edit one file, <code>README.md</code>.
</pre>
Then, we checkout check out the branch named <code>1-first-release</code>:
<pre class="workstation-terminal">
$ cd test0/
</pre>
[[File:Gitlab-wf-4.png|center|thumb|600px]]
On GitLab-side we can close the merge request. We mark it as ready in order to prepare it for merging:[[File:Gitlab-wf-5.png|center|thumb|600px]]In case you have the permission to start the merging by yourself, you can press the "Merge" button. If you do not have such permission, for example because you have been assigned a <code>developer</code> role, this operation will be run by the <code>maintainer</code> of the repository on your behalf, possibily possibly after reviewing your code.[[File:Gitlab-wf-6.png|center|thumb|600px]]After merging is complete, you should see something like this:[[File:Gitlab-wf-7.png|center|thumb|600px]]If we check the <code>master</code> branch, GitLab confirms that the merging was completed successfully:[[File:Gitlab-wf-8.png|center|thumb|600px]]We can also see a graphical representation of we just did: it is clear that the that temporary branch was deleted after it had been merged into the <code>master</code> branch: [[File:Gitlab-wf-9.png|center|thumb|600px]]
== Conclusion ==
We It is strongly recommend recommended to use this workflow for any implementation, being be it adding a new feature, fixing a bug, optimizing a function, or whatever. Even though it may seem a little bit cumbersome at first sight, it has proved to be very efficient and effective when several developers are involved in the same project.
4,650
edits