Integration Build

A Developer Workspace, lets you develop code. But you want integration and release to happen in a well-defined environment. This pattern describes how to ensure that integrated code works and maintains the quality of the Main Line

Integration Build

Consistency Challenges

A Developer Workspace should allow developers to do a fairly thorough build and test cycle. Developers need to build locally to get prompt feedback. But you don’t want to share code or release software that was (only) built on a developer’s desktop:

Continuous Integration in a shared environment is a well-known practice that adds quality and speed to a process. We don’t want the CI environment to be the first place code is built and tested; A build that passes in a developer workspace should likely pass in a CI environment.

Because you want the mechanisms for running building and testing to be low overhead, the developer build won’t be exactly the same as the CI build:

We want a lightweight way to check that new code doesn’t break existing code while still enabling a productive developer build and test cycle.

Automated Backstop

** Establish an Integration Build that runs when changes are pushed to a Task Branch and on a merge to the Main Line. The Integration Build should share elements with the developer workspace build **

An Integration Build is an Automated Check that runs:

An Integraton Build provides a backstop to ensure that the code passes all of the quality gates before it is shared with other developers (in the case of a push to a Task Branch) or before code is released (in the case of a merge to the Main Line).

The Integration Build:

Your CI build might also perform housekeeping, such as reformatting code to match standards.

If you support a Continuous Deployment mode, the integration build that occurs on a merge to the Main Line will have a follow-up step that can deploy the latest artifact to some environment, either a development or staging environment or production.

An Integration Build helps to ensure consistency of the build results.

While the Integration Build may have some process wrapper steps that are necessary to set up a build on the server platform, the core part of the build should be executable in a developer workspace.

Cautions

An Integration Build is a critical check, but the expectation is that it will pass. In cases where the local build and test cycle is slow, developers might be tempted to limit test execution to code they changed and rely on the Integration Build. If this happens, investigate ways to speed up the build on developer machines.

If checks frequently fail in the CI Build, consider how to push those checks (or processes that address the errors) down to the developer workspace.

Be aware of the duration of the integration build. A long integration build can reduce flow. Some have noted that consistency of build time is more important than duration (Jaspan and Green 2023):

If build latencies were consistent or if the build system could usefully inform the developer of expected latency, the developer could make a better decision about what to do next. Reducing build latency is not our only lever to improve productivity here; we can also improve developers’ ability to make decisions around build latency as it is.

Next Steps

An Integration Build can be more than just Build and Test,. It can also support Automated Checks

To reduce the chance of failing Integration Builds have a mechanism to allow for a uniform build that is shared between the integration build and the developer workspace.

References