Skip to content

Release riverui and riverproui from one commit - #750

Draft
bgentry wants to merge 1 commit into
masterfrom
bg/one-commit-release
Draft

bgentry wants to merge 1 commit into
masterfrom
bg/one-commit-release

Conversation

@bgentry

@bgentry bgentry commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

🤖 Releasing riverui and riverproui takes two pull requests today, with the two tags on different commits. riverproui requires riverui at the same version, and its go.sum must hold that version's hash. Neither the version nor the hash exists until riverui is tagged and published. So riverui is released first. Then a second PR moves riverproui to the new version, and that PR's merge commit gets the riverproui tag. This PR cuts that down to one PR and one commit that carries both tags.

How this removes the second round

Module zips are reproducible. Packaging the same commit gives the same zip and the same go.sum hash. So the riverui zip can be built before the release, and its hash can be committed.

A new script, packager/build-candidate-proxy.sh, does this. It builds the frontend and packages riverui from the commit's tracked files, the same way the release workflow does. It writes the zip to a directory that Go uses as a file:// module proxy, ahead of the real proxies. This description calls that zip the candidate. If the version is already published, the script packages nothing.

  • make release/prepare sets riverproui's riverui requirement to $VERSION. Then it runs go mod tidy against the candidate, which writes the hash into go.sum.
  • make release/verify builds riverproui against a new candidate. If riverui changed after the hash was written, the build fails with a checksum mismatch.
  • CI makes the same check on the PR. A new job, "Package riverui candidate", packages the candidate and uploads it as an artifact. The River Pro UI CI job and the River Pro UI image build download riverproui's dependencies through it, so a wrong hash fails the PR.

The release workflow doesn't change. Each tag's run packages only its own module and never resolves riverproui's dependencies, so both tags can point at the same commit.

A release after this PR

  1. Export VERSION and start a branch.
  2. Update CHANGELOG.md. Make sure the replace for riverui in riverproui/go.mod is commented out. Run make release/prepare. The changelog is part of the riverui zip, so run it again after any later change to riverui, including the changelog.
  3. Open the PR, get a review, and merge it.
  4. Pull master and run make release/verify. Then tag $VERSION and riverproui/$VERSION on that commit and push both tags.
  5. Edit the GitHub release notes, as before.

The development docs now describe this flow in full.

Things to know when reviewing

  • The new job runs on every PR, in both the CI workflow and the River Pro UI image workflow. On an ordinary PR, the required riverui version is already published. The job then checks out the repository, installs Go, and asks riverui's module proxy whether the version exists. It skips Node.js. The River Pro UI CI job and the image build now wait for this job.
  • The job is defined twice, once in each workflow, not as one shared reusable workflow. It has no secrets and read-only permissions.
  • The River Pro UI CI job and the image build are required checks, and they now run even if the candidate job fails (!cancelled()). Without this they would be skipped, and a skipped required check does not block a merge. With it, a release commit with no candidate fails in those jobs. The later image jobs check the image build's result directly for the same reason.
  • This PR's CI requires riverui v0.23.0, which is already published, so it only runs the ordinary path. The release path (package the candidate, upload it, download it, and build through it in CI and in the image build) has been rehearsed locally. It runs on GitHub Actions for the first time in the next release PR.

A release takes two rounds. `riverproui`'s `go.sum` needs the hash of a
`riverui` zip that exists only once `riverui` is tagged and published,
and neither CI nor the River Pro UI image build can resolve a `riverui`
version that the module proxy doesn't serve yet. So `riverui` releases
first, and a second pull request and tag move `riverproui` to it.

Module zips are reproducible, so building the frontend and packaging
`riverui` from an export of a commit's tracked files, as the release
workflow does, produces the zip that the release will publish. A new
script packages the `riverui` version that `riverproui` requires into a
directory that Go can use as a `file://` module proxy ahead of
`GOPROXY`, and can run a command in `riverproui` against it. It skips
versions that are already published, checking riverui's own proxy
rather than the public mirror, which would remember the miss for a
version about to be released. On an ordinary commit it only makes that
check, and the command uses the regular module cache. When it packages
a version, the command gets a throwaway module cache, so candidate zips
never stay in the regular cache under release version numbers. The
frontend build clears `NODE_ENV` and `VITE_` variables, which Vite would
otherwise bake into the bundle.

`make release/prepare` sets `riverproui`'s `riverui` requirement to
`$VERSION` and writes its `go.sum` lines with a `go mod tidy` against
the candidate proxy. `make release/verify` builds `riverproui` against
it, so a `riverui` change after the hashes were written fails with a
checksum mismatch.

CI and the River Pro UI image build package the candidate in a new job
that has no secrets and only reads the repository, because packaging
runs npm. On an ordinary commit that job only checks that the version
is published and skips Node.js. Otherwise it uploads the candidate as
an artifact. The River Pro UI CI job downloads `riverproui`'s
dependencies through it, which verifies the candidate against the
committed `go.sum` before any of its code builds. The image build
passes it to the Dockerfile as a named build context, which is empty by
default, for the same verified download.

The release workflow needs no change: each tag's run packages only its
own module from the tagged commit and never resolves `riverproui`'s
dependencies, so both tags can point at the same commit. The release
instructions now describe the one-commit flow, with `make
release/verify` run on the merged commit before tagging.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants