Letzte Beiträge

Entwicklungspraxis 8. August 2019

How To Squash All Commits Of Your Feature Branch

Usually you have a lot of “intermediate” commits while developing on a feature branch like WIP, Review changes, Some cleanup, Fix jenkins. These commits are neither atomic nor does it help to read them in the history. They purely serve the purpose to persist the current work, trigger another build on your buildmachine or doing some fixes you discovered while testing. So before I rebase my changes to master I’d like to squash all commits that i’ve done to a single one. Usually I use interactive rebase for this purpose but since I need to actively tell every commit that I want to squash it I found it tedious. Also its easier, most of the time, to rebase onto master since you only apply conflicting changes to the end-result of your work without the intermediate steps you had to take. So I came up with my own git alias that solves this for me. Introducing: git squash <Commit/Branch> <Message>


Entwicklungspraxis 1. August 2019

Parallel Integration Tests With Random Ports On Jenkins

A common problem when doing end-to-end tests is colliding ports on you buildmachine with parallel execution. With the technology stack of Docker, Jenkins and Gradle I’ll demonstrate one solution I use in my current project to start the backend with a random port and use it in the test execution afterwards.

Our situation is the following: You want to execute a test which starts your backend application and fires against it from the outside. That way you can make sure that your whole infrastructure of the backend is working, including the servlet container for example. But the problem lies in the small detail that such tests usually take a while to execute and therefore lengthen your job runtime while blocking a single port over the time of execution. So the simplest solution by just starting the backend on a fixed port does not scale well for larger teams where a bunch of jobs are executed all the time. Therefore we’d think about starting the backend with randomly assigned ports. The graphic below demonstrates what’s happening on a single executor on Jenkins.


Entwicklungspraxis 24. Juli 2019

Useful Git Aliases That Ease Your Life

When you work with git you can define aliases to make your experience even more productive and elegant. In this short post I’d like to present aliases that I use frequently and how they work. And I’ll start with my favorite: git recent-branches.

Recent Branches

git recent-branches

This command gives you the following output:

This command shows you all branches you recently worked on. That solves the usual problem of me forgetting the names of the branches I worked on.


Entwicklungspraxis 18. Juni 2019

Never Design A Class That Knows How It's Used

When you design a class you should never design it in a way that the class itself knows how it is used from the outside. Breaking this principle will make it difficult for other developers providing other implementations. I recently stumbled upon an implementation of different entities where the implementation had to provide a unique id for itself. Why this is causing problems and how you better design such a situation I’ll explain in this post.


Entwicklungspraxis 24. Mai 2019

Jenkins Bitbucket Branch Source Plugin's Webhook Is Not Working

In my current project we use Bitbucket Server as our Git backend and Jenkins with a pipeline multibranch project to build our project. For better integration of both technologies we decided to use the Bitbucket Branch Source Plugin . This enables us to trigger automated builds and maintain dynamic jobs on our Jenkins. But installing the necessary webhooks turned out to not be a trivial task.

The goals I want to achieve are the following:


Top