Guardians of the GitHub master

TL;DR: Use GitHub protected branches with required status checks. GitHub provides a feature called protected branches to disallow direct commits into certain branches. On top you can define status checks that need to pass before you can merge anything into the protected branch. Why is this important? It will provide a safety net for your project. I recently suggested a feature in one of the open source projects we’re using. [Read More]

jq for PHP

jq is a great tool for processing JSON on the command line. It’s easy to install (e.g. apt-get intall jq) and easy to use. When we started writing tests for our new REST API i wanted to have an easy way to query the returned JSON responses. The end result is a small wrapper around jq. You can find the project on GitHub Since i have revisited our testing strategy and we moved on to using JSON Schema. [Read More]
jq  json  php 

Reduce local test kitchen runtimes

At Zanui we’ve been working with Vagrant, Puppet and Chef for quite a while. We’re happy with these tools, at least most of the time. A major discomfort is the time taken to download any kind of assets during provisioning, e.g. Omnibus: Chef Install Apt update / packages Pip packages … While this is annoying it’s usually not an issue for non-repetitive runs. These usually occur with a new team member or when a development box needs to be rebuild due to errors. [Read More]

PostgreSQL - Add Primary Key to an Existing Table

The database we’re working on has some strange design issues and some of them are incompatible with the ORM layer we’re moving to. One of the issues is the lack of a primary key in some tables. In PostgreSQL we can solve this with the following steps: Add a column with type integer to your table Create a sequence Update the column table with sequence values Set the necessary column properties (e. [Read More]