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

feat(ci): ensure exactly one version bump #5804

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

elenaf9
Copy link
Contributor

@elenaf9 elenaf9 commented Jan 9, 2025

Description

Check in CI that the version of a crate has been bumped exactly once since the last release.

Based on discussion in #5781.

Notes & open questions

Current solution feels a bit hacky. Does anyone know a better way to solve this?

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@elenaf9
Copy link
Contributor Author

elenaf9 commented Jan 10, 2025

(Doing a couple of test commits now to see if the CI catches wrong version bumps; will drop these commits later)

@elenaf9 elenaf9 force-pushed the ci/check-version-bump branch from 2903528 to 5bccb0b Compare January 10, 2025 03:21
@elenaf9
Copy link
Contributor Author

elenaf9 commented Jan 10, 2025

Ahh it seems like for some packages there hasn't been a git tag created last time they were released. E.g. libp2p-floodsub is v0.45.0 on crates.io, but the newest git tag for it is libp2p-floodsub-v0.44.0.

Unfortunately this breaks the CI check, since the check is using git tags so see what the latest released version is.
Originally I wanted to use cargo search for that, but that's not available / supported in the CI.

Unless there is an alternative idea to solve this I think the PR has to wait until the next release.

@jxs
Copy link
Member

jxs commented Jan 10, 2025

Hi Elena, can't we create those tags? Should be easy to find which commits match the releases.
If you list the missing tags I can do it

@elenaf9 elenaf9 force-pushed the ci/check-version-bump branch from a915f5d to 37c24e7 Compare January 19, 2025 04:31
@elenaf9
Copy link
Contributor Author

elenaf9 commented Jan 19, 2025

So the CI (scripts/ensure-version-bump-and-changelog.sh) now checks that:

  • there has been a version bump if there is a diff in the crate's code (already existed prior to this PR): see failing CI check for libp2p-quic
  • there is only a single version bump since the last release: see failing CI check for libp2p-relay
  • the patch version is back to 0 if there was a minor version bump: see failing CI check for libp2p-server and libp2p-tls

It still feels a bit messy (well, it's bash....), but I wasn't able to come up with a better solution that checks all of the above criteria. Again, alternative suggestions are welcome.

@elenaf9 elenaf9 marked this pull request as ready for review January 19, 2025 06:39
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