Version Control with Git
We wanted everything version controlled and we found Git to be the best decision for us at this point in time. It keeps everything stored and we are able to look at the
git log to track any changes made to the codebase.
If unfamiliar with version control, there are many resources available for git on moving to a version control and then using it.
There are also a million blog posts on the best way to use git workflows, but we use something similiar to:
pull > checkout -B newbranch > (make changes) > add & commit to new branch > push new branch > pull request new branch > code approval and merge
This works best because it allows us to peer review and also prevents everyone from pushing to the master branch.
We picked Gitlab because we liked the tools they offered as well as the unilmited private repos for organizations. Github offers many integrations that we liked, but we were not ready to pay the organization fee on a per monthly user basis for our current setup. We may move to Github in the future, but we like Gitlab for now. They also offer a nice CI/CD pipeline that we have taken advantage of and this has helped with our static site builds.
Getting setup on gitlab was very easy and I was able to attach to the organization very quickly. I was made an owner of the org and everything was setup very smoothly.
With this, I wanted to create and
admin user and add the integrations with our AWS pipelines through the
admin user. This means we will be able to track unwanted changes relatively easy and as maintainers and developers go on and off projects the admin user will stay the same and keep the same integrations.
Configuring Webhooks is on a project by project basis and the usage really depends on what you want from your application and your version control system. For us, we wanted to auto deploy any git updates to AWS and we needed to configure the webhooks using the
integrations tab in the project settings.
These webhooks can be configured in many ways, but unfortunately we were not able to change the header key when sending data to a site. By default this is set to
X-Gitlab-Token. We eventually found a workaround and got everything configured, but we had to do this from the other end with some custom code modifications.