Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: simulate publishing #2194

Merged
merged 9 commits into from
Mar 6, 2023

Conversation

har7an
Copy link
Contributor

@har7an har7an commented Feb 26, 2023

Rationale

Zellij is a complex application, consisting of multiple subcrates that need to be released/published separately, along with a few application assets such as plugins, which are usually bundled with the application. For this reasons, it has depended for a long time now on external build-tools such as cargo-make/makers.

Recent contributions to the project have necessitated a different handling of these application assets (in particular: The bundled plugin binaries, see #1924) and introduced a new build system, xtask, to replace the previous cargo-make for a plethora of reasons (See #2012). All of these changes, although not obvious at first glance, introduce risk and uncertainty to the release process.

This is especially problematic because releasing a zellij version is not an atomic operation and can fail in the process, as it has a few times previously. Since there is no "undo"-button, a half-finished release sticks around and is visible for the public, although it is entirely unusable. Unfortunately, up until now, it is only possible to tell whether a release was successful after the release is performed. In turn, this means that a failure during release isn't uncovered until we're in the release process. This usually necessitates a decent amount of live-patching during the release process, as can be understood by looking at the release "history" between 0.34.0 and 0.34.3 (See 66593ec..67ac119).

This is both cumbersome to users and stressful to the maintainers responsible for the release. In order to alleviate this, I'm proposing this PR as a means to simulate a zellij release ahead of time.

Changes in this PR

This PR adds two new CLI flags to the cargo xtask publish command:

  • --git-remote: Allows specifying a git remote (other than the default origin) to push release commits to. In conjunction with a private zellij fork, this allows us to safely test release commits before we publish them to the main repository.
  • --cargo-registry: Allows specifying a different cargo registry to publish the zellij subcrates to. Just like --git-remote, this allows us to push/publish crates somewhere else than into the main crates.io registry.

In combination with a private registry, these allow us to simulate a full release ahead of time. Because the procedure requires a lot of manual setup and isn't exactly trivial (yet?), there is now a new piece of documentation in RELEASE.md, which explains how to set this up correctly.

I hope that in the future, this will make releases frictionless, even in the face of significant changes to the build/plugin system.

@har7an har7an temporarily deployed to cachix February 26, 2023 10:38 — with GitHub Actions Inactive
@har7an
Copy link
Contributor Author

har7an commented Feb 26, 2023

@imsnif I'd be very happy if you could go through the steps in RELEASE.md, run them locally and provide feedback to me in case anything doesn't work or is unclear. I've tried, to the best of my knowledge, to include all the changes/actions I needed to set this up to a working state.

@har7an har7an temporarily deployed to cachix February 26, 2023 10:41 — with GitHub Actions Inactive
@har7an har7an force-pushed the features/simulate-publish branch from c502e17 to 375d030 Compare March 6, 2023 04:04
@har7an har7an temporarily deployed to cachix March 6, 2023 04:04 — with GitHub Actions Inactive
that allow specifying a custom git remote to push to and a custom cargo
registry to publish packages to.
because it's not meant to be released at all.
so we see what crate is currently being published, too.
because otherwise it tries to pick up the debug builds of the plugins,
which aren't part of released version of `zellij utils`.
which explains how to simulate a zellij release.
because recent versions cause havoc in the release process in GitHub
pipelines and it's primary goal is to only reduce binary size. Current
rust versions seem to produce very compact wasm binaries themselves,
though.
@har7an har7an force-pushed the features/simulate-publish branch from 375d030 to ad24cfb Compare March 6, 2023 16:55
@har7an har7an temporarily deployed to cachix March 6, 2023 16:56 — with GitHub Actions Inactive
@har7an har7an merged commit 46b9bc7 into zellij-org:main Mar 6, 2023
har7an added a commit that referenced this pull request Mar 6, 2023
joshheyse pushed a commit to joshheyse/zellij that referenced this pull request Mar 11, 2023
* xtask: Add arguments to `publish`

that allow specifying a custom git remote to push to and a custom cargo
registry to publish packages to.

* xtask/publish: Don't release `xtask` subcrate

because it's not meant to be released at all.

* xtask/publish: Add status messages to publish

so we see what crate is currently being published, too.

* xtask/publish: Disable default features on `zellij`

because otherwise it tries to pick up the debug builds of the plugins,
which aren't part of released version of `zellij utils`.

* xtask/publish: Fix handling of custom registry

* docs: Add `RELEASE.md`

which explains how to simulate a zellij release.

* xtask: Apply rustfmt

* xtask: Remove `wasm-opt` from build steps

because recent versions cause havoc in the release process in GitHub
pipelines and it's primary goal is to only reduce binary size. Current
rust versions seem to produce very compact wasm binaries themselves,
though.

* .github: Don't install wasm-opt in workflows
joshheyse pushed a commit to joshheyse/zellij that referenced this pull request Mar 11, 2023
@har7an har7an deleted the features/simulate-publish branch July 7, 2024 05:36
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.

1 participant