D.15 The gates: what must be green before a release
What you will learn
- Name the five gates and what each protects against.
- Explain why the second build variant exists, and why a visual look is a gate and not a courtesy.
- Treat a failing gate as information, and know what is never acceptable: weakening a gate to pass it.
Prerequisites: D.10, D.13 and D.14.
A release is not made when the change is finished; it is made when the gates are green. The book does not list build commands (users receive compiled programs), so the gates are described by what they ask.
The five gates
| # | Gate | The question it asks | What it catches |
|---|---|---|---|
| 1 | Formatting | does the code follow the one house layout? | noise in reviews; arguments about style |
| 2 | Lint, warnings as errors | does the code pass the static checks with no warning tolerated? | unused values, suspicious conversions, patterns that are usually bugs |
| 3 | The full test run | do all the unit tests and all the end-to-end tests pass? (about three minutes on a development machine) | regressions in behaviour; broken promises of pages D.3–D.5 |
| 4 | The second build variant | does the program also build and pass without the embedded language-model component? | code that leaks a dependency on the assistant into the engines |
| 5 | A visual look | do the HTML and PNG outputs look right when opened? | clipped labels, overlapping text, an empty panel, a figure with the wrong scale |
Why each gate is a gate
Warnings are errors because a warning that is tolerated today hides the one that matters tomorrow. A warning-free baseline makes a new warning visible and a review easy.
The full test run is not optional for a "small" change. Page D.13 said every change is a release; the run is three minutes, and the failure it prevents (a released regression in a validated environment) costs days.
The second build variant exists because the language-model component is optional in one of the two builds. The rule is architectural (page D.1: the engines never depend on the assistant) and the gate enforces it: if a change to a statistics routine imports something from the assistant, the variant without it fails to build. A rule that is only written down is a wish.
The visual look is a gate because no test sees a picture the way a person does. A figure can be produced, have the right size in pixels, and still be unreadable. The developer opens the HTML and the PNG produced by the affected commands and looks, as the reader of Chapter 41 was asked to open every page of a report (page 41.38). It is the cheapest check and the one most often skipped.
Reading a failure
| What fails | Usual cause | First move |
|---|---|---|
| Format | an editor setting | run the formatter; commit nothing else |
| Lint | a real finding | fix the code; a suppression needs a written reason beside it |
| An end-to-end test | a changed message, default or file name | decide whether the change or the test is wrong: the test encodes a promise |
| A test that differs only by timing | a determinism defect | page D.12 |
| The variant without the assistant | a dependency pointing the wrong way | move the shared code down a layer (page D.1) |
| The visual look | a layout rule broken by a long label | fix the layout, not the data |
What is never acceptable
- Loosening a test to make it pass. If a tolerance must change, the reason is written beside it and a reviewer agrees.
- Deleting a test that "no longer applies" without saying what promise it protected and where that promise is now kept.
- Skipping a gate "because the change is documentation only". A documentation change that breaks the banner date test is a failed release.
- Releasing with a known red and a plan to fix it later.
What the gates do not prove
Green gates mean the program does what its tests say. They do not say the tests are complete, or that the science is right: that is the work of the independent QC folder and the validation package (page D.10; Chapter 42). The gates are the floor.
Review checklist
- Can you name the five gates and say what each catches?
- Do you know why the variant without the assistant is built?
- Have you opened the HTML and PNG outputs of every command you touched?
- Is every suppression or relaxed tolerance justified in writing?
Navigation
See the previous page, the next page and the developer reference.