Configuring new Gitlab project
Steps to configure new GitLab project
Create the project itself
If needed create a subgroup for the project:
Then, just hit +
:
- Choose
wemake.services
as the project owner - Project should be named with all lowercase letters and
_
sign to replaces spaces - Set project visibility level to
Internal
.
Creating initial project structure
We are using different generators to create a boilerplate code for the project. On this step it is required to create a project with the required generator and the push the initial code to the repository.
Also, make sure that the source code contains .gitlab-ci.yml
. If it does not, the project is not considered valid. And will be deleted.
Adding project roles
Each project’s README
should contain the current roles for this project.
Who is the client?
Who is the architect?
Adding issue templates
It is required to add issue and merge request templates to the repository. In order to copy the latest version run locally:
link="https://github.com/wemake-services/meta/tree/master/.gitlab"; rm -rf .gitlab; svn checkout ${link/tree\/master/trunk}
Configuring protected branches
- Protect
master
branch. Only@sobolevn
can push to it
Configuring protected tags
- Protect tags starting with
v*
. They are used for a release process.
Configuring push rules
- Set
Do not allow users to remove git tags with git push
- Set
Check whether author is a GitLab user
- Set
Prevent committing secrets to Git
- Configure
Branch name
to follow our formatissue-\d+
Configuring merge requests
- Set
Merge method
toFast-forward merge
, meaning only branches without conflicts could be merged. Otherwise, it should be rebased locally before creating a merge request - Activate
Merge request approvals
- Set number of approvals to
1
and@sobolevn
to theApprovers
- Set
Can override approvers and approvals required per merge request
- Set
Remove all approvals in a merge request when new commits are pushed to its source branch
- Set
Only allow merge requests to be merged if the pipeline succeeds
- Set
Show link to create/view merge request when pushing from the command line
Configuring issue labels
Our workflow only has 4
possible states of issues:
bug
with red colorfeature
with blue colordocumentation
with green colorresearch
with purple color
These labels should be created.
Creating issue boards
Issue boards are only required to make Cycle Analysis work. Create 4 issue boards from the issue labels:
Configuring deploy docker registry token
Deploy token for docker
registry is created in personal settings per project.
Each token should be named the same as a project it uses.
Each token should be valid for a year.
Each token should have only read_registry
permission.
Done
You are all set! You can now start using the project.