This file servers as a documentation for the Dev branch. This documentation includes:
- Why
Devbranch was created. - Installing Pre-commits.
- Push the code to Dev branch.
- Create Branch protection rules.
- Merge your code with the main branch.
- File implementation.
The Dev branch was created as an initial stage that allows the developer to relocate his code from the a machine to the remote infrastructure Github. Moreover, it's the first step in a CI/CD pipeline.
Pre-commits are configuration files implemented by the developer to fix common issues with his code or documentation before any commit. Some of this issues can be white spaces, new lines, or spellings.
To execute this configuration a .pre-commit-config.yaml file is created. This file checks all the new git-added files for any issues before being committed to any branch.
The issues or test samples are based on hooks found in public repos. The hooks are based on ids which contains rules that checks whetter you files have passed or failed the rules.
For this branch the main rules that are used, are to check for white spaces and EOF are:
end-of-file-fixertrailing-whitespace
The full documentation link :
Please refer to Pre-Commit-Configuration-File
After editing your files, and adding them using the git add file_name, The next step is to commit.
when committing, you will be prompt the following:
If there is no file to check:
In case of failure:
If successful.
At this phase, the developer is insuring that the updated code is available remotely through Github, while making sure that his updated files have passed the pre-commit checks.
The purpose of these rules is to ensure that no merge has been done between the main brach and side branches.
There are many rules to be implemented, however, for the simplicity of this branch, since it's the first phase of development, only one rules was implemented.
The rule implemented is a PR review, which requires a pull request before merging, then a review for the corresponding request is issued. This review requires a contributor different that the issue whom approves the pull request.
Once the review is approved, then the side branch is merged towards the main branch.
Following the Branch protection Rules to merge this branch, Dev, with the main branch, a pull request is created. After the review is approved the Dev branch is merged to the main branch remotely, then you have to fetch locally the changes to the main branch.
To start a project, such as a pipeline, the needed files for this phase Before-source is :
Readme.mddocuments the whole aspect of this project.Before-Source.mddocuments the aspects of the creation of thedevbranch.CodeExample.pyserves as an example code. A code that can be used to test new notions..pre-commit-config.yamlis a checking mechanism that will be used throughout the initialization of this project. This mechanism makes sure that there are no white space or new lines.


