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

Harden Rust crate releasing against human errors #293

Closed
tgeoghegan opened this issue Jul 6, 2022 · 4 comments · Fixed by #2585
Closed

Harden Rust crate releasing against human errors #293

tgeoghegan opened this issue Jul 6, 2022 · 4 comments · Fixed by #2585
Assignees

Comments

@tgeoghegan
Copy link
Contributor

Currently, to release new versions of the janus_core and janus_client crates, you have to do the following:

  1. bump version in janus_core/Cargo.toml
  2. bump version in janus_client/Cargo.toml
  3. bump version of janus_core dependency in janus_client/Cargo.toml
  4. run a build to update Cargo.lock
  5. Make a PR with all that
  6. Merge PR to main
  7. Make a GitHub release

It's very easy to forget to do any of steps 1-4 (I have at least once, #292). We could do better here. Some ideas (which may exclude each other);

  • run cargo publish --dry-run in CI to prove that the crates aren't busted (though I'm not sure how to make this work if janus_client depends on an unpublished janus_core)
  • run cargo publish with --locked in CI and/or release workflows to guarantee that Cargo.lock is up to date (or run a cargo build and assert that Cargo.lock is unchanged)
  • write a much more elaborate release workflow that would handle rewriting versions in Cargo.toml based on the git tag
@divergentdave
Copy link
Collaborator

The set-version subcommand from the cargo-edit project can streamline step 3, FWIW. Running cargo set-version --bump patch -p janus_core does both step 1 and step 3 in one go.

@branlwyd
Copy link
Contributor

(3) is no longer necessary for non-major version updates: we now specify "internal" crate dependencies as major versions, so we should get the new version automatically.

The Cargo.lock update in (4) can be done by cargo update --workspace.

@tgeoghegan
Copy link
Contributor Author

@inahga, you're working on this currently, right?

@inahga
Copy link
Contributor

inahga commented Jan 30, 2024

Accidentally, yes! Didn't realize this issue existed.

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 a pull request may close this issue.

4 participants