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

Check version bump when opening PRs #220

Merged
merged 45 commits into from
Sep 30, 2024
Merged

Conversation

matiasbzurovski
Copy link
Contributor

@matiasbzurovski matiasbzurovski commented Sep 25, 2024

Every time we forget to bump version on Cargo.toml, we get out of sync between the released version tag and the one indicated in such file.

This PR adds a check to verify every time a PR is opened against main, we have changed the version inside Cargo.toml.

You can see on this workflow run how CI failed when I had opened the PR against main (instead of ci/ubuntu-runners).

Screenshot 2024-09-25 at 14 17 51

Copy link

codecov bot commented Sep 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.0%. Comparing base (a12fdc6) to head (aab740c).

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main    #220   +/-   ##
=====================================
  Coverage   97.0%   97.0%           
=====================================
  Files        941     941           
  Lines      14863   14863           
  Branches      66      66           
=====================================
  Hits       14426   14426           
  Misses       430     430           
  Partials       7       7           
Flag Coverage Δ
kotlin 98.8% <ø> (ø)
rust 96.4% <ø> (ø)
swift 99.3% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@matiasbzurovski matiasbzurovski changed the base branch from main to ci/ubuntu-runners September 25, 2024 12:15
@matiasbzurovski matiasbzurovski changed the title [WIP] Check version bump when opening PRs Check version bump when opening PRs Sep 25, 2024
Base automatically changed from ci/ubuntu-runners to main September 25, 2024 13:18
@micbakos-rdx
Copy link
Contributor

@matiasbzurovski Should we maybe check to bump the version only if there are changes to rust, kotlin or swift src code? For example in the previous PR I changed the CI and the README, but didn't push any changes to src. What do you think?

@matiasbzurovski
Copy link
Contributor Author

@micbakos-rdx the problem is that every time we merge into main, a new release is generated. For example, with your CI/CD change, a new release was generated and since the Cargo.toml wasn't changed, it got out of sync.

@micbakos-rdx
Copy link
Contributor

@matiasbzurovski At least for sargon-android a new library build is produced and published. This library gets the version from cargo toml directly and appends the commit hash as suffix. So if there is no change to the version the hash will be different.

@matiasbzurovski
Copy link
Contributor Author

matiasbzurovski commented Sep 26, 2024

on iOS we set the dependency based on the release version. So, if we set it to 1.1.18, the app will use the library from such tag. However, such library has Cargo version set to 1.1.16, which leads to confusion IMO.

For example, on this app run I use dependency 1.1.18 but app shows Sargon: 1.1.16 (given 1.1.18 tag has set version: 1.1.16 in Cargo.toml).

Copy link
Contributor

@CyonAlexRDX CyonAlexRDX left a comment

Choose a reason for hiding this comment

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

cool, lets give it a spin

@matiasbzurovski matiasbzurovski merged commit 424a98f into main Sep 30, 2024
12 checks passed
@matiasbzurovski matiasbzurovski deleted the ci/check-version-bump branch September 30, 2024 10:01
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.

3 participants