-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
Fix SCM provider to only search tags that are reachable by the current commit #975
Conversation
ead221b
to
17f106c
Compare
4768ece
to
3efca40
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #975 +/- ##
==========================================
+ Coverage 97.33% 97.38% +0.04%
==========================================
Files 42 55 +13
Lines 2104 2373 +269
==========================================
+ Hits 2048 2311 +263
- Misses 56 62 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
dca166e
to
f0dc835
Compare
codecov is failing, but I don't know what else to test. Any ideas? |
The scm provider requires tags to be the source of truth for the current version, instead of files. Therefore, the current version should be the highest tag version upstream from the current commit.
f0dc835
to
dfd0b0c
Compare
b9013b0
to
23516be
Compare
I keep adding tests but the codecov is not improving. Any suggeestions? |
Description
The scm provider currently uses all of the tags in the repo to determine the current version, but it should instead only consider tags that are upstream from the current commit. This means commitizen currently consider tags that are in the future or on other branches when determining the version. This doesn't make sense. The pep621 provider doesn't determine the current version from the latest commit of
pyproject.toml
or from commits on other branches, it looks at the current state of the repo.Checklist
./scripts/format
and./scripts/test
locally to ensure this change passes linter check and testExpected behavior
The expected behavior is that the current version should be determined by the "highest" version tag reachable by the current commit. In order to determine "highest" I had to add sortability to
VersionProtocol
, but luckily this is already implemented byBaseVersion
.Steps to Test This Pull Request
Additional context