~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

Releases are cut from change files, as the Release pull

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:release/flow

Releases are cut the way knotless cuts its own: a pull that changes what people see adds a knope change file, just release turns main's change files into a Release <version> pull with the changelog, and once that lands the next just release tags it v<version>. Unlike knotless, a person runs it rather than a daily workflow, as the repository is private and no run can write to it.

Claude Opus 5.5 · medium

What changes

Change files. knope.toml versions the workspace (Cargo.toml, and the three crates' Cargo.lock entries) from .changeset/*.md into CHANGELOG.md, conventional commits ignored. knope document-change writes one.

The changes check. check gains a step, harness/changes.sh: a pull that changes crates/*/src, web/src, web/messages, lexicons/fyi or packages/sdk/src fails without a new change file, unless one of its commits says Changeset: none on a line of its message. knotless reads that line from the pull's body; here the pull record is in the repository's space, which a run's unauthenticated getRecord can't read, so it is read from the commits.

just release (deploy/release.sh). First tags the release that last landed: main's version, when a commit on main is titled Release <version> and v<version> isn't a tag, which mirror then pushes to GitHub. Then, with change files on main, it runs knope release --override-version in a throwaway worktree at main's tip, the version worked out as knotless's release-pull.yml does (0.x: minor/major bump the minor), commits Release <version>, force-pushes release/next, and opens the pull or retitles and rewrites the open one. A pull already holding main's change files that still merges is left alone. --dry-run tags nothing and prints the body, pushing nothing.

Docs: AGENTS.md (Versioning, and the check), docs/development.md (Releasing), docs/reference/cli.md (just release).

Why

knotless's release-pull.yml and release.yml push a branch, open a pull and tag as the owner with an app password on ci.knotless.dev. For this repository that can't work: it's private, reading or writing its space takes an OAuth login's space credential that an app password can't get (the reason just docs-deploy is run by hand too), a workflow's write-back can't touch the default branch or open a pull, and knotless refuses a private repository's releases, so there is nothing to publish binaries to. What carries over is the version, the changelog, the standing release pull and the tag.

How it was checked

knope release --override-version 0.2.0 in a worktree with a minor and a patch change file bumped Cargo.toml and the three crates in Cargo.lock and wrote the section; without the trailing blank line in CHANGELOG.md the first section's heading ran into the header, hence that line. deploy/release.sh --dry-run, pointed at a local commit with those two files, said there was nothing to tag, worked out 0.2.0 and printed the body, leaving no worktree behind. harness/changes.sh against a local branch failed a change to crates/opensocial/src alone, and passed it with a change file, with a Changeset: none commit, and a README-only change. git ls-remote --exit-code tells an absent tag (2) from a present ref (0) over knotless://. node harness/docs.mjs: 0 problems.

Shortcomings

The push, pull and tag halves of just release first run for real on the first release. That knotless tag create on this private repository moves a ref the runners see, so mirror pushes the tag, is assumed, not seen. Nothing ships binaries of the host or the command; a release is a version, a changelog and a tag.

Approved

This adds knope change files, a changes step in check, and just release (deploy/release.sh). The script tags the release that last landed, then opens or refreshes the Release <version> pull. I found nothing that must change.

  • The version read from Cargo.toml is the [workspace.package] one, and it is the first version = line at column 0, so the sed | head -1 is right.
  • The Release <version> match for tagging and the already-current test (.changeset tree of FETCH_HEAD^ against main) hold together.
  • changes.sh watches only source paths. A release pull, which touches Cargo.toml, Cargo.lock, CHANGELOG.md and .changeset, therefore passes without a change file.

I could not check these from the diff:

  • knotless pull list prints tab-separated columns with the title in column 4. If it doesn't, the script finds no open release pull and opens a duplicate on every run.
  • KNOTLESS_RUN_BASE and the full history that base..HEAD needs exist in the runner's checkout.
  • knotless tag create on a private repository makes a ref that mirror pushes. You already say this one is assumed.

Smaller things:

  • The knope.toml header says "release-pull.yml runs it", but no such workflow exists here. It should say deploy/release.sh.
  • In release.sh, git ls-remote --exit-code returns 2 for an absent ref. Any other failure, such as a network error, also falls through to the knotless tag create branch. Testing for exit code 2 exactly would be safer.
knope.tomlline 5Outdated
# a group, calling the host or using the command sees adds one, with
# `knope document-change`, naming the bump and saying what changed for
# them. `knope release` bumps the workspace's version, writes CHANGELOG.md
# and removes the files it used; release-pull.yml runs it. No
review.knotless.dev

Stale: no release-pull.yml exists in this repository; deploy/release.sh (just release) runs it.

deploy/release.shline 52Outdated
landed=$(git log --format='%H%x09%s' "$main" | awk -F '\t' -v t="Release $current" '$2 == t { print $1; exit }')
if [ -z "$landed" ]; then
echo "main's $current came from no release pull: nothing to tag"
elif git ls-remote --exit-code -q "$REPO" "refs/tags/v$current" >/dev/null; then
review.knotless.dev

Only exit code 2 means the tag is absent. Any other ls-remote failure (network, auth) lands in the tag branch here.

Approved

This adds knope change files, a changes step in check, and just release (deploy/release.sh). release.sh tags the release that last landed, then cuts or refreshes the Release <version> pull. I read the whole diff and found nothing that blocks merging.

  • The version arithmetic is right: 0.x bumps the minor for minor or major, and 1.0 and later bump their own part.
  • Tagging is safe to repeat. It finds the commit by its Release <version> title, so it still works after more commits land on main.
  • Running release.sh with no change files exits cleanly, and the worktree trap cleans up.
  • The release pull itself changes no source paths, so changes.sh passes it.

The push, pull-edit and tag halves have never run for real, as you say. I couldn't check the knotless pull list column order that the awk parse relies on, or pull retarget --head. Watch the first real run.

One small fix: the knope.toml header says "release-pull.yml runs it", but no such workflow exists here, because just release runs it.

knope.tomlline 5Outdated
# a group, calling the host or using the command sees adds one, with
# `knope document-change`, naming the bump and saying what changed for
# them. `knope release` bumps the workspace's version, writes CHANGELOG.md
# and removes the files it used; release-pull.yml runs it. No
review.knotless.dev

Stale: there is no release-pull.yml in this repository. just release (deploy/release.sh) runs it.

Approved

Both small things from my earlier reviews are fixed in ffb0524, and I found nothing new.

  • release.sh now tags only when git ls-remote --exit-code returns exactly 2. Success means the tag exists. Any other status stops the script with an error. || asked=$? is safe under set -e.
  • The knope.toml header now names just release (deploy/release.sh) as what runs it.

The merge of main into the branch brought in other pulls' changes, which are not this pull's. I read the pull's own diff, and it matches what I approved before.

The first real run of the push, pull-edit and tag steps is still unchecked, as the body says. I also can't confirm the knotless pull list column order that the awk parse relies on.

Merged as c072963