Changesets and releases
How a change reaches the changelog and a version number, and how a release is made. Versions and changelog entries are mechanical: each pull request says what it changes in a changeset, and knope turns the pending changesets into versions at release time. What a version promises is in API stability.
Changesets
A change users of the crates notice comes with a changeset: a Markdown
file in .changeset/, named after the change (toast-corner.md). Its
front matter names each crate the change touches and the bump it takes;
the text below is the changelog entry, written for users.
---
egui-pop-core: major
egui-pop-api: major
egui-pop: major
---
The debug bridge has a mode: `AppBuilder::debug_bridge` takes a
`BridgeMode` (`On`, the default as before, `ReadOnly` or `Off`). To move:
replace `debug_bridge(true)` with `debug_bridge(BridgeMode::On)`.
knope document-change asks for the crates, the bumps and a summary
and writes the file; writing it by hand is as good. The names are the
crates’ package names; the gallery, the template and the tools are not
published and take no changeset.
Which bump
| Bump | For | Before 1.0 | From 1.0 |
|---|---|---|---|
patch | a fix | 0.2.3 to 0.2.4 | 1.2.3 to 1.2.4 |
minor | an addition, or a change that breaks nothing | 0.2.3 to 0.2.4 | 1.2.3 to 1.3.0 |
major | a breaking change | 0.2.3 to 0.3.0 | 1.2.3 to 2.0.0 |
Before 1.0, a breaking change takes a new minor version (0.2 to
0.3), and additions and fixes share the patch number. A changeset still
says major for a break: knope applies it to the middle number while
the version starts with 0, and the changelog lists it under “Breaking
changes”. Declare what the change is, not the number you expect.
What breaks is the Rust API (cargo semver-checks tells), and also the
extension contract: tokens, steps, commands, strings and ids, the debug
bridge (GOVERNANCE.md).
A break travels up. The crates above a broken one re-export its
types, so each published crate depending on a crate that takes a
major takes a major too, up to the facade. The check below names the
missing ones.
One changeset per change; a pull request doing one thing has one. A changeset may name several crates with different bumps; its entry goes under its highest bump and names every crate it lists.
When none is needed
Tests, examples, benchmarks, the documentation, the gallery, CI and the
tools change no published crate. A change inside a crate that users do
not notice (a refactoring, a comment, an internal rename) needs none
either: label the pull request internal.
The check
CI’s Changesets job (cargo xtask changeset-check) fails when:
- a changeset names a crate that is not published, or a bump other
than
patch,minorormajor; - a crate takes a
majorand a published crate depending on it does not; - a pull request changes the shipped files of a published crate (its
src/, its manifest, its README; nottests/,examples/orbenches/) and adds no changeset, unless it is labelledinternal. Adding the label runs CI again.
A release pull request, which deletes changesets and adds none, passes. Locally:
cargo xtask changeset-check --base origin/main
Commit subjects
Commit subjects, and pull request titles (a squash merge makes the title the commit’s subject), follow Conventional Commits:
<type>(<scope>)!: <what changed>
- type:
feat(an addition),fix,perf,refactor,docs,test,build,ci,chore(chore(release)for a release),styleorrevert; - scope, optional: the crate without its
egui-pop-prefix (core,api,views), or the area (gallery,xtask,ci,deps); !marks a breaking change, asmajordoes in its changeset.
feat(views): the list sorts by any column
fix(core)!: a focus scope restores the focus it took
docs: how a release is made
knope reads the changesets only, not the commits
(ignore_conventional_commits in knope.toml): a change described by
both would be counted twice. The subject format keeps the history
readable and says at a glance what a commit is. CI’s Pull request
title workflow checks the title, and runs again when it is edited.
Releasing
Publishing is the owner’s call, and stays a manual step.
-
Prepare, on a branch from an up-to-date
main:knope release --dry-run # what would change knope releaseknope raises each crate’s version from the pending changesets (its manifest, its requirement in
[workspace.dependencies],Cargo.lock) and deletes them; thencargo xtask release-noteswrites the release intoCHANGELOG.md, sets the egui-pop version both templates’cargo-generate.tomlpropose to the facade’sMAJOR.MINOR(cargo xtask templates; pr-lint’scargo xtask templates --checkfails a release that leaves it behind), and commits everything, signed off, aschore(release): <the facade's version>(or the crates and their versions when the facade does not move). The section lists the crates it publishes and groups the entries under “Breaking changes”, “Features” and “Fixes”, each entry naming its crates.Then write the release’s fixtures, on the same branch:
cargo xtask fixtures <the facade's version> # e.g. 0.22.0 git add fixtures/ && git commit -s -m "test: fixtures of <version>"The gallery runs headless through a fixed scenario (a setting changed, a key rebound, a panel moved, an arrangement saved, a place’s value kept, a theme saved from the editor) and
fixtures/<version>/keeps every document it wrote, the theme file andexpected.json, the values the scenario set. The gallery’srelease_fixturestest loads every folder with today’s code: no error, every value back, each migration reported (ADR 0008). A released folder is never rewritten; a format change that cannot read one is a break.Then run the real windows check on Linux, which CI does not run: the bench box’s
egui-pop-window-smokejob (Helios’stools/bench/Benchfile,egui_pop=<the release branch>) runs the window smoke run (tools/window-smoke.py, testing, “Other platforms”) in a headless labwc, under Wayland and under X11: a detached window focused, keys typed into it, each window’s scale. Everycheckline of both sessions must sayPASS; Windows and macOS get the same checks from the platforms workflow onnext.Next to it, the screen reader pass (testing, “Screen readers”): the bench box’s
egui-pop-screen-readerjob (egui_pop=<the release branch>) walks five gallery pages with Orca and compares what it says withtools/wbox/screen_reader.json; every step must sayPASS. Then walk the same pages with NVDA on Windows, by hand, with that section’s checklist. -
Review: push the branch, open a pull request titled like the commit, read the changelog and the versions. Merge it: on
next, CI’s semver job checks the new versions against crates.io (the release raises the crates’ manifests and deletes the changesets, both of which select it). -
Publish, from the merged commit on
main, by hand:cargo xtask publish --dry-run # the plan, and crates changed but not raised cargo xtask publishIt publishes the crates whose version is not on crates.io yet, in the order of their dependencies. First it runs
cargo semver-checks check-releaseon those that have an earlier release (it needscargo install cargo-semver-checks --locked, and GStreamer’s and WebKitGTK’s development packages for the video and web view features); a failure publishes nothing.--skip-semverleaves the checks out, for a run resumed after they passed. -
Tag a minor of the facade,
vX.Y.0, on the commit it was published from; patches and sub-crates are not tagged:cargo xtask tag # refuses until crates.io has the version git push origin v0.3.0
knope is a development tool, not a dependency:
cargo install knope --locked (CI pins its version, see
.github/workflows/semver.yml).
Semver checks
CI’s Semver checks job blocks main’s promotion. It runs when a
published crate’s build input or a changeset changed since main, every
night on next, and by hand (.github/workflows/semver.yml;
CI jobs); cargo xtask publish runs the checks
again before uploading. It first runs
knope pending-versions, which writes in its checkout the versions the
pending changesets lead to, then
cargo semver-checks check-release --workspace, which compares every
published crate with its latest release on crates.io (the baseline is
what users have). A breaking change passes when its changeset makes
the crate’s version a new minor (before 1.0) and fails otherwise,
naming what broke.
The baseline is built from crates.io in a fresh resolution, which takes
the newest version of each dependency unless told otherwise; one that
needs a newer Rust than the pinned toolchain fails the build (kstring
2.0.5, through gstreamer, needs Rust 1.96 for egui-pop 0.18.0’s
publish). .cargo/config.toml sets
resolver.incompatible-rust-versions = "fallback", so the checks, run
from the checkout, pick versions the toolchain builds. A run from
elsewhere sets CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS=fallback;
never skip the checks for it.
The switch to changesets
Changesets started after 0.2.0. The changes merged before them are in
CHANGELOG.md’s Unreleased section, written by hand; one changeset
without text, .changeset/since-0.2.0.md, declares their bumps. The
0.3.0 release moves that section under its heading: release-notes
puts any Unreleased section it finds into the release it writes.
From then on, entries are written as changesets only.