Advanced

Versioning inside one repository

When several things ship from one repository, they do not all move at once. A release is a set of versions, and the set has to be consistent: a library and an application built from different commits of the same branch is a release that was never tested together.

What you will see

One hash that defines every artifact in the release - the single reference a release should be describable by.

About 1 min of reading

Try It

Pin one commit.

1

The snapshot

git log -1 --format='%H' release/2.5

Before you run it, say out loud what it will print. Then open the answer.

What it prints
One hash that defines every artifact in the release - the single reference a release should be describable by.

Data Flow

One commit defines a release.
1 Cut the release branch
↓
2 Build every component from it
↓
3 Version each by what changed
↓
4 Verify the compatibility pairs
Why this works
Cut a branch per release

A release branch cut from main is the snapshot everything is built from. Building from main while main moves is the bug that makes two artifacts in one release disagree.

Verify the pair

A test that runs the application against its stated library version, run as part of the release. That test is the only thing that makes the pair a fact rather than a note.

Examples

One commit, many artifacts

Every artifact in a release comes from the same commit. That is the property that makes the release describable by one hash, and it is what a build farm has to enforce.

Per component versions

A component that did not change keeps its old version. Bumping everything on every release produces numbers that carry no information, and consumers compare them.

The compatibility pair

State which library version each application version was tested against. That pair is the contract; an unstated pair is a claim that nothing was verified.

Words this lesson uses

Each one is defined here on this site. Open the entry for the full definition and the other words it points at.

← Long term support windows
Previous Lesson
Long term support windows
Next Lesson
Planning a release as a document
Planning a release as a document →