Recently, there’s been quite a few odd things our team has done and I haven’t put that much thought into them. So I have either:
- approved their Pull Request, putting my trust in the developer that it was the correct thing to do
- casually skimmed over something someone else has approved.
Then, when I spend more time in that area, I then think; “what the hell are we doing?”
I was making some tweaks to our build process and then thought “why do we have two builds for every check-in we do?”
So I look at the definitions and it’s basically this:
| Build 1 | Build 2 |
| Download and install | Download and install |
| Run linter | Run linter |
| Run tests | Run tests |
| Produce report |
So the second build is just to produce a report, which it needs a valid build to produce. But it could just use Build 1. The sensible thing to do is just to delete Build 1, since Build 2 has the full steps we actually want.
So I ask the developer that set-up these builds and he said “it is quicker”.
So I’m like “what!? how?”
“it runs in parallel”
So? Both builds initially do the same thing, but one has an extra step so Build 2 takes longer. We have to wait until both builds complete before the code can be checked in. If Build 1 fails for some reason (e.g. Unit Test failure), then you are 99% guaranteed that Build 2 is gonna fail, therefore is a waste of time and money. The report can’t generate unless there’s a valid build, so the report may as well just use the existing build. Since they run in parallel, the total time is just the time of the longest running build e.g. Build 2.
He didn’t even seem convinced.