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

Create a script for recursive version bumping across the workspace #3348

Closed
thomaseizinger opened this issue Jan 18, 2023 · 5 comments
Closed

Comments

@thomaseizinger
Copy link
Contributor

Description

This issue tracks the creation of the script described in #2902 (comment).

The interface should look like this:

scripts/bump-version.sh <workspace-crate> <level>

For example:

scripts/bump-version.sh libp2p-core minor

The script needs to:

  1. Use cargo release version to bump the specified crate by the provided level
  2. Figure out, which workspace crates depend on this crate
  3. Bump the version of those crates by the same level
  4. Repeat (2) + (3) if new crates have been affected

As an example:

  1. Issue a minor level bump for libp2p-core
  2. libp2p-swarm depends on libp2p-core so it needs to be bumped by a minor level as well
  3. libp2p-identify depends on libp2p-swarm so it also needs to be bumped by a minor level
  4. libp2p-metrics so it also needs to be bumped by a minor level
  5. libp2p-metrics depends on libp2p-identify but also on libp2p-core so it would have already been bumped as part of (2) and should not be bumped again

To generalize the whole thing, one could introduce a configuration file in which one can specify, which version bumps end up "bubbling up" (which at the end of the day can be figured out by checking which ones appear in the public API).

Related crate-ci/cargo-release#628.

Motivation

Make version bumping as part of PRs and/or releases less manual and error-prone.

Open questions

Are you planning to do it yourself in a pull request?

Maybe.

@thomaseizinger
Copy link
Contributor Author

Tagging this as difficulty:easy because it requires no knowledge of rust-libp2p internals and only shell-scripting skills.

@mxinden
Copy link
Member

mxinden commented Jan 18, 2023

With humanities next big step in mind, namely to move off of bash scripts, I would not be opposed to using Python instead of Bash here.

@thomaseizinger
Copy link
Contributor Author

I guess it will be more complicated than calling a few binaries and piping them together so perhaps a more capable language would be good yes.

If it can be done with just pipes and filters, I am not opposed to a bash solution.

@thomaseizinger
Copy link
Contributor Author

Perhaps https://github.com/matklad/cargo-xtask/ is the way to go here.

@thomaseizinger
Copy link
Contributor Author

I am closing this because now that we have #3715, this isn't actually a problem anymore.

@thomaseizinger thomaseizinger closed this as not planned Won't fix, can't repro, duplicate, stale May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants