Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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

BumpForBefore 1.0From 1.0
patcha fix0.2.3 to 0.2.41.2.3 to 1.2.4
minoran addition, or a change that breaks nothing0.2.3 to 0.2.41.2.3 to 1.3.0
majora breaking change0.2.3 to 0.3.01.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, minor or major;
  • a crate takes a major and 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; not tests/, examples/ or benches/) and adds no changeset, unless it is labelled internal. 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), style or revert;
  • scope, optional: the crate without its egui-pop- prefix (core, api, views), or the area (gallery, xtask, ci, deps);
  • ! marks a breaking change, as major does 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.

  1. Prepare, on a branch from an up-to-date main:

    knope release --dry-run   # what would change
    knope release
    

    knope raises each crate’s version from the pending changesets (its manifest, its requirement in [workspace.dependencies], Cargo.lock) and deletes them; then cargo xtask release-notes writes the release into CHANGELOG.md, sets the egui-pop version both templates’ cargo-generate.toml propose to the facade’s MAJOR.MINOR (cargo xtask templates; pr-lint’s cargo xtask templates --check fails a release that leaves it behind), and commits everything, signed off, as chore(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 and expected.json, the values the scenario set. The gallery’s release_fixtures test 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-smoke job (Helios’s tools/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. Every check line of both sessions must say PASS; Windows and macOS get the same checks from the platforms workflow on next.

    Next to it, the screen reader pass (testing, “Screen readers”): the bench box’s egui-pop-screen-reader job (egui_pop=<the release branch>) walks five gallery pages with Orca and compares what it says with tools/wbox/screen_reader.json; every step must say PASS. Then walk the same pages with NVDA on Windows, by hand, with that section’s checklist.

  2. 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).

  3. Publish, from the merged commit on main, by hand:

    cargo xtask publish --dry-run   # the plan, and crates changed but not raised
    cargo xtask publish
    

    It publishes the crates whose version is not on crates.io yet, in the order of their dependencies. First it runs cargo semver-checks check-release on those that have an earlier release (it needs cargo 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-semver leaves the checks out, for a run resumed after they passed.

  4. 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.