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

Merged
merged 6 commits into from
Jan 27, 2025

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
Copy link
Member

@jxs jxs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Thanks Elena! I think thi is good enough for our needs, we should after probably focus on releasing from github action, so that we ensure that tags are created and it will also probably help us with the release hierarchy of the sub-crates

protocols/relay/src/copy_future.rs Outdated Show resolved Hide resolved
@elenaf9
Copy link
Contributor Author

elenaf9 commented Jan 26, 2025

Okay great! I will drop all commits were I was just testing the new CI check.

@elenaf9 elenaf9 force-pushed the ci/check-version-bump branch from 609643c to a2a3ecc Compare January 26, 2025 08:16
Copy link
Member

@jxs jxs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we still need to add the git labels the the missing crates, or is that not needed as we added for the last release? Feel free to add the send-it label when you answer this Elena

@elenaf9
Copy link
Contributor Author

elenaf9 commented Jan 27, 2025

or is that not needed as we added for the last release?

Yes exactly

@mergify mergify bot merged commit fee8bf0 into libp2p:master Jan 27, 2025
71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants