D.13 Every change is a release: choosing the number and writing the entry
What you will learn
- State the release rule: every change, however small, is a release, and one request is one version.
- Choose the kind of number increase (major, minor, patch) from what the change does to a user.
- Write a change-log entry in the house format, and know where the version lives and where it must not be copied by hand.
The rule
The project has one rule that surprises newcomers: there is no "unreleased" state. Every change to the program, to its settings, to its documentation or to its tests ends in a numbered release with a change-log entry. The reason is the reason of the whole book: a result must be traceable to the exact program that produced it. If two different programs can carry the same number, a stored bundle cannot be tied to either.
Two corollaries follow.
- One request is one version. Several fixes asked for together are one release with several bullets. A second request is a second release.
- No quiet edits. A change that "does not matter" (a typo in a message, a reworded help line) is still a release, because it changes what a user sees and a user may have quoted it.
Choosing the number
The scheme is the usual three-part one. What matters is the test applied: what happens to someone who upgrades without reading the notes?
| Increase | The test | Examples of kind |
|---|---|---|
| Major | an existing settings file or an existing output stops working or means something different | a key renamed or removed; a column of a result file changed in meaning; a result that was in one file moved to another |
| Minor | something is added or a default changes, and nothing old breaks | a new option, a new command, a new check, a new output file; a changed default (users who relied on the old default see a different result, so it is not a patch) |
| Patch | a fix, or a change to documentation only | a wrong message corrected; a defect in a calculation fixed; a page of the manual reworded |
Three rules of thumb resolve most doubts.
- A changed default is at least minor, even if it is "obviously better". The user who did not choose the old value did not choose the new one either.
- A fix that changes a published number is not "just a patch" in the change-log text: the entry says which results change and under what condition (page D.5). The number is a patch; the words carry the warning.
- When two kinds fit, take the larger. A release numbered too high costs nothing; one numbered too low can break a validated workflow.
Where the number lives
The version is stored in one place, the project's manifest. Everything else that shows a version, the banner, the --version text, the headers of generated files, reads it from there. A version typed by hand in a second place is a defect waiting to happen, and a test checks for the commonest one: the release date in the banner must equal the date of the newest change-log entry.
The documentation carries a version line of its own (the manual states which release it describes). That line is updated in the same release as the code, and it is part of the checklist on page D.14.
The change-log entry
The entry has a fixed form:
## [X.Y.Z] - YYYY-MM-DD
* **Short name.** One or two sentences: what changed for a user, and under what condition.
* **Another change.** …
(Here X.Y.Z stands for the three numbers; the book does not quote a real release.)
Rules for writing it.
| Rule | Why |
|---|---|
| Write for the user, in the user's words (the option, the file, the message), not the function names | the reader is a pharmacometrician, not a maintainer |
| Say the condition under which a result changes | "results differ when the data contain BLQ rows in the first period" can be checked; "improved handling of BLQ" cannot |
| One bullet per change, a short bold name first | scanning |
| Never rewrite a past entry. To correct one, add a new entry that says so | the log is a record; a record that can be edited is not one |
| Keep the date true | the date test above enforces it |
A worked entry
Illustration: the --max-findings option of page D.6.
## [X.Y.Z] - YYYY-MM-DD
* **Limit on listed findings.** `qc-data` accepts `--max-findings N`
(settings key `[output] max_findings`) to shorten the findings list in the
summary. The findings file still holds every finding. The default is
unchanged.
This is a minor release: a new option, nothing old affected. The same change with a changed default (the list is shortened unless asked otherwise) would still be minor, but the entry would need a second sentence saying so in plain words, because someone's summary will look different.
What a reviewer checks
- Does the change have an entry, in the house form, under a new number?
- Is the kind of increase right by the upgrade test above?
- Does the entry state the condition under which any result changes?
- Is the date today's, and equal to the banner's?
- Is the version stored once, and read everywhere else?
Review checklist
- Can you explain why "unreleased" is not a state?
- Do you apply the upgrade test (what happens to someone who upgrades without reading?) to choose the increase?
- Is a changed default treated as at least minor?
- Do you describe, in the entry, which results change and when?
Navigation
See the previous page, the next page and the developer reference.